diff --git a/intranet/modules/mesMachines/main.py b/intranet/modules/mesMachines/main.py index a98f8b9b..8fc9730b 100755 --- a/intranet/modules/mesMachines/main.py +++ b/intranet/modules/mesMachines/main.py @@ -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: