prparation pour les nouvelles fonctionnalits
darcs-hash:20050310000127-4ec08-59007061640fd403408cefd354f408ccb2dfe110.gz
This commit is contained in:
parent
f08ea04d3d
commit
e0a760034c
2 changed files with 40 additions and 8 deletions
|
@ -49,7 +49,7 @@ if action == 'valid-auth' :
|
|||
|
||||
if action != 'auth' :
|
||||
if users.has_key( sess.data['user'] + ':' + sess.data['password'] ) :
|
||||
bornes = users[ sess.data['user'] + ':' + sess.data['password'] ]
|
||||
bornes_modifiables = users[ sess.data['user'] + ':' + sess.data['password'] ][1:]
|
||||
else :
|
||||
log(sess.data['user'] + ' erreur d\'authentification' )
|
||||
page.add('<font color="red">Erreur d\'authentification !</font><br><br>')
|
||||
|
@ -76,7 +76,7 @@ if action == 'auth' :
|
|||
# désactivation d'un borne
|
||||
|
||||
if action == 'desactive' :
|
||||
if form.getvalue('borne','') in bornes :
|
||||
if form.getvalue('borne','') in bornes_modifiables :
|
||||
log(sess.data['user'] + ' a désactivé %s' % form.getvalue('borne','') )
|
||||
page.add('<font color="blue">La borne <b>%s</b> sera désactivée dans quelques instants</font><br><br>' % form.getvalue('borne','') )
|
||||
borne = db.search('host=%s.wifi.crans.org' % form.getvalue('borne',''), 'w' )['machine'][0]
|
||||
|
@ -92,7 +92,7 @@ if action == 'desactive' :
|
|||
# activation d'un borne
|
||||
|
||||
if action == 'active' :
|
||||
if form.getvalue('borne','') in bornes :
|
||||
if form.getvalue('borne','') in bornes_modifiables :
|
||||
log(sess.data['user'] + ' a activé %s' % form.getvalue('borne','') )
|
||||
page.add('<font color="blue">La borne <b>%s</b> sera réactivée dans quelques instants</font><br><br>' % form.getvalue('borne','') )
|
||||
borne = db.search('host=%s.wifi.crans.org' % form.getvalue('borne',''),'w' )['machine'][0]
|
||||
|
@ -110,8 +110,12 @@ if action == 'active' :
|
|||
if action == 'liste' :
|
||||
page.sous_titre('Liste des bornes')
|
||||
|
||||
for b in bornes :
|
||||
borne = db.search('host=%s.wifi.crans.org' % b)['machine'][0]
|
||||
for b in bornes_modifiables :
|
||||
try :
|
||||
borne = db.search('host=%s.wifi.crans.org' % b)['machine'][0]
|
||||
except :
|
||||
log('borne non existante : %s' % b)
|
||||
continue
|
||||
|
||||
# formulaire
|
||||
page.add('<form method=\"POST\">')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue