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\">')
|
||||
|
|
|
@ -4,8 +4,36 @@
|
|||
# les mots de passe sont cryptés avec la commande :
|
||||
# python -c "import sha ; print sha.new('***').hexdigest()"
|
||||
|
||||
# Répartitition des bornes dans les batiments
|
||||
#############################################
|
||||
|
||||
# batiment Léonard de Vinci
|
||||
bornes_vinci_dgm = ['astrild', 'nanna']
|
||||
bornes_vinci_fab = ['hel']
|
||||
bornes_vinci_dgc = ['frigg']
|
||||
bornes_vinci = bornes_vinci_dgm + bornes_vinci_fab + bornes_vinci_dgc
|
||||
|
||||
# batiment cournot
|
||||
bornes_cournot = ['aegir','snotra']
|
||||
|
||||
# batiment d'Alembert
|
||||
bornes_bibliotheque = ['sif']
|
||||
bornes_alembert_hall = ['vidar']
|
||||
bornes_alembert_cri = ['yggdrasil']
|
||||
bornes_alembert_curie = ['freyr']
|
||||
brones_alembert = bornes_bibliotheque + bornes_alembert_hall + bornes_alembert_cri + bornes_alembert_curie
|
||||
|
||||
# batiment pavillon des jardins
|
||||
bornes_pdj = ['magni']
|
||||
|
||||
# batiments de l'ens
|
||||
bornes_ens = bornes_vinci + bornes_cournot + brones_alembert + bornes_pdj
|
||||
|
||||
# Liste des utilisateurs
|
||||
########################
|
||||
|
||||
users = {
|
||||
'bilou:b6831110716ea7782b636469b31dc3a695b26386' : ['valhalla','aegir'],
|
||||
'vince||:7bc07c05eebf6726b48f557fcb60b434364034cd' : ['valhalla','heimdall','vidar'],
|
||||
'xabi:4f1da4cacfd69622c2123d83007a92f9e3de9722' : ['heimdall']
|
||||
'bilou:b6831110716ea7782b636469b31dc3a695b26386' : [True] + bornes_ens,
|
||||
'vince||:7bc07c05eebf6726b48f557fcb60b434364034cd' : [True, 'valhalla','heimdall','vidar'] + bornes_ens,
|
||||
'xabi:4f1da4cacfd69622c2123d83007a92f9e3de9722' : [True, 'heimdall']
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue