[annuaire] On passe sur ula base de données PgSQL
darcs-hash:20100831065041-ffbb2-c44e28237d99ba472e0465ad88f1cd7149e3081d.gz
This commit is contained in:
parent
337905013d
commit
a1427076b5
15 changed files with 32 additions and 35 deletions
|
@ -13,7 +13,8 @@ from socket import gethostname
|
|||
import smtplib, re, os, random, string, time, sys, pwd
|
||||
import ldap, ldap.modlist, ldap_passwd
|
||||
|
||||
import config, annuaires, iptools, cPickle, config_mail
|
||||
import annuaires_pg as annuaires
|
||||
import config, iptools, cPickle, config_mail
|
||||
from chgpass import chgpass
|
||||
from affich_tools import coul, prompt, cprint
|
||||
from email_tools import send_email
|
||||
|
@ -875,7 +876,7 @@ class CransLdap:
|
|||
"""
|
||||
Renvoie un proprietaire ou un adherent correspondant au
|
||||
login/ mot de passe (mot de passe facultatif)
|
||||
"""
|
||||
"""
|
||||
recherche = self.search(("uid=%s" % uid), mode)
|
||||
proprio = None
|
||||
|
||||
|
@ -1949,9 +1950,9 @@ class Adherent(BaseProprietaire):
|
|||
new = new.capitalize()
|
||||
bat = new[0].lower()
|
||||
|
||||
if bat in annuaires.chbre_prises.keys():
|
||||
if bat in annuaires.bat_switchs:
|
||||
# On a la liste des chambres
|
||||
chbres = annuaires.chbre_prises[bat].keys()
|
||||
chbres = annuaires.chbre_prises(bat).keys()
|
||||
if new[1:] not in chbres or len(new)<4 or not new[1:4].isdigit():
|
||||
chbres.sort()
|
||||
aide = u"Chambre inconnue dans le batiment, les chambres valides sont :"
|
||||
|
@ -1965,7 +1966,6 @@ class Adherent(BaseProprietaire):
|
|||
aide += c.ljust(5)
|
||||
a = a+1
|
||||
aide += u'\n'
|
||||
aide += u" " + annuaires.aide.get(bat, '')
|
||||
raise ValueError(aide)
|
||||
|
||||
else:
|
||||
|
@ -2781,9 +2781,9 @@ Contactez nounou si la MAC est bien celle d'une carte.""", 3)
|
|||
return decode(self._data.get('prise', ['N/A'])[0])
|
||||
else:
|
||||
chbre = self.proprietaire().chbre()
|
||||
if chbre and chbre[0].lower() in annuaires.chbre_prises.keys():
|
||||
if chbre and chbre[0].lower() in annuaires.bat_switchs:
|
||||
try:
|
||||
return annuaires.chbre_prises[chbre[0].lower()][chbre[1:]]
|
||||
return annuaires.chbre_prises(chbre[0], chbre[1:])
|
||||
except:
|
||||
return 'N/A'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue