Utilisable par les clubs

darcs-hash:20070530223848-c992d-a122d072707c59d5fd491cb501f00b9d7dec8c91.gz
This commit is contained in:
bos 2007-05-31 00:38:48 +02:00
parent 68826f87db
commit 7580abe8c5

View file

@ -30,9 +30,11 @@ class main(ModuleBase):
return "Mes Machines"
def icon(self):
return "machines_icon_fixe.png"
_club = True
def AJAXListeMachines(self):
adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0]
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
machines = []
for une_machine in adh.machines():
machineInfos = {}
@ -160,7 +162,7 @@ class main(ModuleBase):
##########################
def AJAXChangerNom(self, mid, nouveauNom):
try:
adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0]
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
mach = cherrypy.session['LDAP'].search('mid=' + mid, 'w')['machine'][0]
# tester si c'est bien la machine de l'adherent
if mach.proprietaire().compte() != cherrypy.session['uid']:
@ -182,7 +184,7 @@ class main(ModuleBase):
##########################
def AJAXchangerMAC(self, mid, nouvelleMAC):
try:
adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0]
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
mach = cherrypy.session['LDAP'].search('mid=' + mid, 'w')['machine'][0]
# tester si c'est bien la machine de l'adherent
if mach.proprietaire().compte() != cherrypy.session['uid']:
@ -206,7 +208,7 @@ class main(ModuleBase):
##########################
def AJAXSupprimerMachine(self, mid):
try:
adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0]
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
mach = cherrypy.session['LDAP'].search('mid=' + mid, 'w')['machine'][0]
# tester si c'est bien la machine de l'adherent
if mach.proprietaire().compte() != cherrypy.session['uid']:
@ -223,7 +225,7 @@ class main(ModuleBase):
# machine:creation
##########################
def AJAXCreerMachine(self, nomNouvelleMachine, MACNouvelleMachine, typeNouvelleMachine):
adh = cherrypy.session['LDAP'].search('uid=' + cherrypy.session['uid'])['adherent'][0]
adh = cherrypy.session['LDAP'].getProprio(cherrypy.session['uid'])
if typeNouvelleMachine=='fixe' and adh.droits() == [] and adh.machines_fixes() != []:
return {'error':'Vous avez deja une machine fixe. Vous ne pouvez ajouter que des machines WiFi.'}
try: