Plus de wifi prof dsormais
darcs-hash:20060714205033-c3cc4-7f9cdf341578d12bd720114dc5448e3230605910.gz
This commit is contained in:
parent
0b610a7135
commit
5130d4ad1b
3 changed files with 66 additions and 117 deletions
|
@ -335,8 +335,6 @@ NETs = { 'serveurs' : [ '138.231.136.0/28' ],
|
|||
'vlan-adm' : [ '138.231.144.0/24' ],
|
||||
'bornes' : [ '138.231.148.0/24' ],
|
||||
'wifi-adh' : [ '138.231.149.0/24', '138.231.150.0/24', '138.231.151.0/24' ],
|
||||
'wifi-ens' : [ ], #à supprimer prochainement Braice 14/07/06
|
||||
'wifi-invite' : [ ], # inutilisé #à supprimer prochainement Braice 14/07/06
|
||||
'fil' : [ '138.231.136.0/21' ],
|
||||
'wifi': [ '138.231.148.0/22' ],
|
||||
'all' : [ '138.231.136.0/21', '138.231.148.0/22' ]
|
||||
|
|
|
@ -209,7 +209,6 @@ def set_etudes(adher):
|
|||
arg += u'"5" "1ère année thèse" '
|
||||
arg += u'"6" "2ème année thèse" '
|
||||
arg += u'"7" "3ème année thèse" '
|
||||
arg += u'"Pers" "Personnel ENS (Wifi only)" '
|
||||
arg += u'"Autre" ""'
|
||||
annul, result = dialog(arg)
|
||||
if annul: return 1
|
||||
|
@ -242,20 +241,6 @@ def set_etudes(adher):
|
|||
dialog(arg)
|
||||
return __etudes_annee()
|
||||
|
||||
if result[0] == "Pers" and adher.chbre() != "EXT":
|
||||
# Un personnel ENS doit être renseigné en extérieur
|
||||
arg = u'--title "Etudes (2/3)" '
|
||||
arg += u'--msgbox "Réponse invalide\n\n' + \
|
||||
u'Un personnel ENS doit être localisé à l\'extérieur.\n\n\n" 0 0'
|
||||
dialog(arg)
|
||||
return __etudes_annee()
|
||||
|
||||
# On ajoute un avertissement pour le choix 8.
|
||||
if result[0] == "Pers":
|
||||
arg = u'--title "Etudes (2/3)" '
|
||||
arg += u'--msgbox "Personnel ENS\n\n' + \
|
||||
u'Attention, un personnel ENS est un cas bien particulier. Cela correspond à une personne n\'étant pas élève, étant prof dans un département ou un labo, disposant d\'une adresse @ens-cachan.fr. Cela ne donne accès qu\'au wifi, pour l\'année 2005 uniquement. Il ne pourra pas disposer d\'un compte crans et n\'aura pas accès au réseau interne.\n\n\n" 0 0'
|
||||
dialog(arg)
|
||||
etudes[1] = result[0]
|
||||
|
||||
def __etudes_section():
|
||||
|
@ -264,9 +249,7 @@ def set_etudes(adher):
|
|||
# Pour l'ENS
|
||||
if etudes[0] == 'ENS':
|
||||
arg += u'--default-item "%s" ' % adher.etudes(2)
|
||||
if etudes[1] == "Pers":
|
||||
arg += u'--menu "Choisissez le laboratoire ou le département :" 0 0 0 '
|
||||
elif etudes[1] in '1234':
|
||||
if etudes[1] in '1234':
|
||||
arg += u'--menu "Choisissez la section : " 0 0 0 '
|
||||
else:
|
||||
arg += u'--menu "Choisissez le laboratoire :" 0 0 0 '
|
||||
|
@ -282,7 +265,7 @@ def set_etudes(adher):
|
|||
arg += u'"PPSM" "Laboratoire de Photophysique et Photochimie Supramoléculaires et Macromoléculaires" '
|
||||
arg += u'"SATIE" "Systèmes et Applications des Technologies de l\'Information et de l\'Energie" '
|
||||
arg += u'"STEF" "Sciences Techniques Education Formation" '
|
||||
if etudes[1] in '1234' or etudes[1] == "Pers":
|
||||
if etudes[1] in '1234':
|
||||
arg += u'"A1" "Mathématiques" '
|
||||
arg += u'"A\'1" "Informatique" '
|
||||
arg += u'"A2" "Physique fondamentale" '
|
||||
|
@ -364,28 +347,23 @@ def set_mail(adher):
|
|||
return
|
||||
|
||||
while 1:
|
||||
if (adher.etudes(0) != "ENS" or adher.etudes(1) != "Pers"):
|
||||
arg = u'--title "Adresse mail de %s" ' % adher.Nom()
|
||||
arg += u'--menu "Adresse mail de l\'adhérent :" 0 0 0 '
|
||||
arg += u'"Adresse mail extérieure" "" '
|
||||
if adher.compte():
|
||||
arg += u'"Laisser le compte crans" "(login : %s)"' % adher.compte()
|
||||
else:
|
||||
arg += u'"Créer un compte crans" "(adresse @crans.org)"'
|
||||
|
||||
annul, result = dialog(arg)
|
||||
if annul: return 1
|
||||
|
||||
if result[0].split()[0] == 'Laisser':
|
||||
break
|
||||
elif result[0].split()[0] == 'Créer':
|
||||
if not set_compte(adher): break
|
||||
else:
|
||||
if not set_mail_ext(adher): break
|
||||
arg = u'--title "Adresse mail de %s" ' % adher.Nom()
|
||||
arg += u'--menu "Adresse mail de l\'adhérent :" 0 0 0 '
|
||||
arg += u'"Adresse mail extérieure" "" '
|
||||
if adher.compte():
|
||||
arg += u'"Laisser le compte crans" "(login : %s)"' % adher.compte()
|
||||
else:
|
||||
arg += u'"Créer un compte crans" "(adresse @crans.org)"'
|
||||
|
||||
annul, result = dialog(arg)
|
||||
if annul: return 1
|
||||
|
||||
if result[0].split()[0] == 'Laisser':
|
||||
break
|
||||
elif result[0].split()[0] == 'Créer':
|
||||
if not set_compte(adher): break
|
||||
else:
|
||||
# Pour un personnel ENS, adresse email extérieure obligatoire
|
||||
if not set_mail_ext(adher): break
|
||||
else: return 1
|
||||
|
||||
def set_mail_ext(adher):
|
||||
"""
|
||||
|
@ -401,14 +379,6 @@ def set_mail_ext(adher):
|
|||
annul, result = dialog(arg)
|
||||
if annul: return 1
|
||||
|
||||
if (adher.etudes(0) == "ENS" and adher.etudes(1) == "Pers"):
|
||||
# Adresse ens-cachan.fr obligatoire
|
||||
if not re.match("^.*@.*ens-cachan\.fr$", result[0]):
|
||||
arg = u'--title "Adresse mail extérieure de %s" ' % adher.Nom()
|
||||
arg += u'--msgbox "Pour un personnel ENS, l\'adresse en ens-cachan.fr est obligatoire.\n\n\n" 0 0'
|
||||
dialog(arg)
|
||||
return set_mail_ext(adher)
|
||||
|
||||
try: adher.mail(result[0])
|
||||
except ValueError, c:
|
||||
arg = u'--title "Adresse mail extérieure de %s" ' % adher.Nom()
|
||||
|
@ -939,9 +909,6 @@ def set_admin(proprio):
|
|||
Définition de l'état administratif : carte d'étudiant, paiement
|
||||
et caution.
|
||||
"""
|
||||
# Le propriétaire est-il un personnel de l'ENS ?
|
||||
is_personnel = proprio.etudes(0) == "ENS" and proprio.etudes(1) == "Pers"
|
||||
|
||||
# Le proprietaire a-t-il une section carte d'étudiant (pas les clubs) ?
|
||||
has_card = proprio.idn != 'cid'
|
||||
|
||||
|
@ -958,11 +925,8 @@ def set_admin(proprio):
|
|||
checklist = []
|
||||
|
||||
if carte_ok == 'off' or iscontroleur:
|
||||
if is_personnel:
|
||||
checklist.append(u'"1" "Preuve informelle d\'appartenance au personnel de l\'ENS" "%s"' % carte)
|
||||
else:
|
||||
checklist.append(u'"1" "Carte d\'étudiant %d/%d fournie" "%s"' %
|
||||
(ann_scol, ann_scol+1, carte))
|
||||
checklist.append(u'"1" "Carte d\'étudiant %d/%d fournie" "%s"' %
|
||||
(ann_scol, ann_scol+1, carte))
|
||||
else:
|
||||
texte.append(u'Carte vérifiée')
|
||||
|
||||
|
@ -977,7 +941,7 @@ def set_admin(proprio):
|
|||
checklist.append(u'"3" "Adhésion %d/%d réglée et charte signée (précâblage)" "%s"' %
|
||||
(ann_scol+1, ann_scol+2, precab))
|
||||
|
||||
if (caution == 'off' and not is_personnel) or iscontroleur:
|
||||
if caution == 'off' or iscontroleur:
|
||||
checklist.append(u'"C" "Caution payée" "%s"' % caution)
|
||||
else:
|
||||
texte.append(u'Caution payée')
|
||||
|
@ -1874,63 +1838,54 @@ def menu_principal():
|
|||
|
||||
if choix == 'aMc':
|
||||
# Ajout d'une machine à l'adhérent/au club courant
|
||||
if proprio.__class__ == Club or proprio.etudes(0) != "ENS" or \
|
||||
proprio.etudes(1) != "Pers":
|
||||
|
||||
# On ne peut avoir de machine fixe si on n'a pas payé
|
||||
# la caution
|
||||
caution_ok = 'k' in proprio.controle()
|
||||
# On ne peut avoir de machine fixe si on n'a pas payé
|
||||
# la caution
|
||||
caution_ok = 'k' in proprio.controle()
|
||||
|
||||
# On ne peut avoir une machine fixe que si on a pas
|
||||
# déjà une machine fixe, sauf si on est membre actif
|
||||
# (expérimental)
|
||||
# On ne peut avoir une machine fixe que si on a pas
|
||||
# déjà une machine fixe, sauf si on est membre actif
|
||||
# (expérimental)
|
||||
|
||||
# On récupère la liste des machines fixes
|
||||
if (proprio.__class__ == Club or (caution_ok and \
|
||||
(not proprio.machines_fixes() or proprio.droits()))):
|
||||
arg = u'--title "Nouvelle machine" '
|
||||
arg += u'--menu "Type de machine ?" 0 0 0 '
|
||||
arg += u'"Fixe" "Machine fixe" '
|
||||
arg += u'"Wifi" "Machine wireless" '
|
||||
annul, result = dialog(arg)
|
||||
if annul: continue
|
||||
choix= result[0]
|
||||
elif not caution_ok:
|
||||
arg = u'--title "Nouvelle machine" '
|
||||
arg += u'--menu " Caution non payée\n\n'
|
||||
arg += u'Pour pouvoir incrire une machine fixe, il faut avoir '
|
||||
arg += u'payé la caution." 0 0 0 '
|
||||
arg += u'"OK" "OK, on lui rajoute une machine wifi" '
|
||||
arg += u'"Annul" "Bon, on abandonne..." '
|
||||
annul, result = dialog(arg)
|
||||
if annul or result[0] == "Annul": continue
|
||||
if result[0] == "OK":
|
||||
choix = 'Wifi'
|
||||
else:
|
||||
continue
|
||||
else:
|
||||
# Plus de machine fixe possible...
|
||||
arg = u'--title "Nouvelle machine" '
|
||||
arg += u'--menu " Non membre actif\n\n'
|
||||
arg += u'Seuls les membres actifs peuvent posséder plusieurs\n'
|
||||
arg += u'machines fixes. L\'adhérent actuel n\'est pas membre\n'
|
||||
arg += u'actif, il n\'est donc possible que de lui ajouter une\n'
|
||||
arg += u'machine wifi..." 0 0 0 '
|
||||
arg += u'"OK" "OK, on lui rajoute une machine wifi" '
|
||||
arg += u'"Annul" "Bon, on abandonne..." '
|
||||
annul, result = dialog(arg)
|
||||
if annul or result[0] == "Annul": continue
|
||||
if result[0] == "OK":
|
||||
choix = 'Wifi'
|
||||
else:
|
||||
choix = 'Fixe'
|
||||
else:
|
||||
# Pour les personnels ENS, wifi uniquement
|
||||
# On récupère la liste des machines fixes
|
||||
if (proprio.__class__ == Club or (caution_ok and \
|
||||
(not proprio.machines_fixes() or proprio.droits()))):
|
||||
arg = u'--title "Nouvelle machine" '
|
||||
arg += u'--msgbox "Personnel ENS\n\n' + \
|
||||
u'Un personnel ENS ne peut accéder qu\'au wifi.\n\n\n" 0 0'
|
||||
dialog(arg)
|
||||
choix = 'Wifi'
|
||||
arg += u'--menu "Type de machine ?" 0 0 0 '
|
||||
arg += u'"Fixe" "Machine fixe" '
|
||||
arg += u'"Wifi" "Machine wireless" '
|
||||
annul, result = dialog(arg)
|
||||
if annul: continue
|
||||
choix= result[0]
|
||||
elif not caution_ok:
|
||||
arg = u'--title "Nouvelle machine" '
|
||||
arg += u'--menu " Caution non payée\n\n'
|
||||
arg += u'Pour pouvoir incrire une machine fixe, il faut avoir '
|
||||
arg += u'payé la caution." 0 0 0 '
|
||||
arg += u'"OK" "OK, on lui rajoute une machine wifi" '
|
||||
arg += u'"Annul" "Bon, on abandonne..." '
|
||||
annul, result = dialog(arg)
|
||||
if annul or result[0] == "Annul": continue
|
||||
if result[0] == "OK":
|
||||
choix = 'Wifi'
|
||||
else:
|
||||
continue
|
||||
else:
|
||||
# Plus de machine fixe possible...
|
||||
arg = u'--title "Nouvelle machine" '
|
||||
arg += u'--menu " Non membre actif\n\n'
|
||||
arg += u'Seuls les membres actifs peuvent posséder plusieurs\n'
|
||||
arg += u'machines fixes. L\'adhérent actuel n\'est pas membre\n'
|
||||
arg += u'actif, il n\'est donc possible que de lui ajouter une\n'
|
||||
arg += u'machine wifi..." 0 0 0 '
|
||||
arg += u'"OK" "OK, on lui rajoute une machine wifi" '
|
||||
arg += u'"Annul" "Bon, on abandonne..." '
|
||||
annul, result = dialog(arg)
|
||||
if annul or result[0] == "Annul": continue
|
||||
if result[0] == "OK":
|
||||
choix = 'Wifi'
|
||||
else:
|
||||
choix = 'Fixe'
|
||||
try:
|
||||
if choix == 'Fixe':
|
||||
becane = MachineFixe(proprio)
|
||||
|
|
|
@ -1622,7 +1622,7 @@ class BaseProprietaire(BaseClasseCrans):
|
|||
if nouveau:
|
||||
ret += coul(u"%s inscrit avec succès." % self.Nom(), 'vert')
|
||||
|
||||
if self.idn !='cid' and self.etudes(1) != "Pers":
|
||||
if self.idn !='cid':
|
||||
# Mail de bienvenue
|
||||
self.services_to_restart('mail_bienvenue', [self.mail().encode('iso-8859-15')])
|
||||
|
||||
|
@ -2566,11 +2566,7 @@ class Machine(BaseClasseCrans):
|
|||
|
||||
# Dans quel réseau la machine doit-elle être placée ?
|
||||
if isinstance(self, MachineWifi):
|
||||
if self.proprietaire().etudes(0) == "ENS" and self.proprietaire().etudes(1) == "Pers":
|
||||
# Personnel ENS
|
||||
net = config.NETs['wifi-ens']
|
||||
else:
|
||||
net = config.NETs['wifi-adh']
|
||||
net = config.NETs['wifi-adh']
|
||||
elif isinstance(self, BorneWifi):
|
||||
net = config.NETs['bornes']
|
||||
elif isinstance(self.proprietaire(), AssociationCrans):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue