Correction canonicalAlias, ajout cransAccount, esthtisme.
darcs-hash:20060321012153-68412-185e90e71297e14e330197c2cf365e9495893b31.gz
This commit is contained in:
parent
62d23e9bde
commit
5bf2e284f9
1 changed files with 90 additions and 90 deletions
|
@ -256,7 +256,7 @@ class crans_ldap:
|
||||||
|
|
||||||
auto_search_champs = { \
|
auto_search_champs = { \
|
||||||
'adherent': \
|
'adherent': \
|
||||||
['nom', 'prenom', 'tel', 'mail', 'chbre', 'mailAlias', 'cannonicalAlias' ],
|
['nom', 'prenom', 'tel', 'mail', 'chbre', 'mailAlias', 'canonicalAlias' ],
|
||||||
'club': ['nom', 'chbre'],
|
'club': ['nom', 'chbre'],
|
||||||
'machineFixe': auto_search_machines_champs,
|
'machineFixe': auto_search_machines_champs,
|
||||||
'machineWifi': auto_search_machines_champs,
|
'machineWifi': auto_search_machines_champs,
|
||||||
|
@ -377,7 +377,7 @@ class crans_ldap:
|
||||||
Lock un item avec la valeur valeur, les items possibles
|
Lock un item avec la valeur valeur, les items possibles
|
||||||
peuvent être :
|
peuvent être :
|
||||||
|
|
||||||
aid $ chbre $ mail $ mailAlias $ cannonicalAlias $
|
aid $ chbre $ mail $ mailAlias $ canonicalAlias $
|
||||||
mid $ macAddress $ host $ hostAlias $ ipHostNumber
|
mid $ macAddress $ host $ hostAlias $ ipHostNumber
|
||||||
|
|
||||||
Retourne le dn du lock
|
Retourne le dn du lock
|
||||||
|
@ -1782,7 +1782,7 @@ class adherent(base_proprietaire):
|
||||||
self._set('mail', [''])
|
self._set('mail', [''])
|
||||||
self._data['objectClass'] = [ 'adherent' ]
|
self._data['objectClass'] = [ 'adherent' ]
|
||||||
|
|
||||||
for c in [ 'uid', 'cn', 'shadowLastChange', 'shadowMax', 'shadowWarning', 'loginShell', 'userPassword', 'uidNumber', 'gidNumber', 'homeDirectory', 'gecos', 'droits', 'mailAlias', 'cannonicalAlias' ]:
|
for c in [ 'uid', 'cn', 'shadowLastChange', 'shadowMax', 'shadowWarning', 'loginShell', 'userPassword', 'uidNumber', 'gidNumber', 'homeDirectory', 'gecos', 'droits', 'mailAlias', 'canonicalAlias' ]:
|
||||||
try: self._data.pop(c)
|
try: self._data.pop(c)
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
|
@ -1890,12 +1890,12 @@ class adherent(base_proprietaire):
|
||||||
if not 'compte' in self.modifs:
|
if not 'compte' in self.modifs:
|
||||||
self.modifs.setdefault('compte', None)
|
self.modifs.setdefault('compte', None)
|
||||||
|
|
||||||
# Création de l'alias cannonique
|
# Création de l'alias canonique
|
||||||
if self.nom() and self.prenom():
|
if self.nom() and self.prenom():
|
||||||
a = '%s.%s' % (self.prenom().capitalize(), self.nom().capitalize())
|
a = '%s.%s' % (self.prenom().capitalize(), self.nom().capitalize())
|
||||||
self.cannonical_alias(a)
|
self.canonical_alias(a)
|
||||||
|
|
||||||
self._data['objectClass'] = ['adherent', 'posixAccount', 'shadowAccount']
|
self._data['objectClass'] = ['adherent', 'cransAccount', 'posixAccount', 'shadowAccount']
|
||||||
self._data['uid'] = [login]
|
self._data['uid'] = [login]
|
||||||
self._data['cn'] = [preattr(self.Nom())[1]]
|
self._data['cn'] = [preattr(self.Nom())[1]]
|
||||||
#self._data['shadowLastChange'] = [ '12632' ]
|
#self._data['shadowLastChange'] = [ '12632' ]
|
||||||
|
@ -1935,10 +1935,10 @@ class adherent(base_proprietaire):
|
||||||
|
|
||||||
return decode(login)
|
return decode(login)
|
||||||
|
|
||||||
def cannonical_alias(self, new=None):
|
def canonical_alias(self, new=None):
|
||||||
""" Retourne ou défini l'alias canonique"""
|
""" Retourne ou défini l'alias canonique"""
|
||||||
if new == None:
|
if new == None:
|
||||||
try: return decode(self._data['cannonicalAlias'][0])
|
try: return decode(self._data['canonicalAlias'][0])
|
||||||
except: return ''
|
except: return ''
|
||||||
else :
|
else :
|
||||||
a = strip_accents(new)
|
a = strip_accents(new)
|
||||||
|
@ -1947,11 +1947,11 @@ class adherent(base_proprietaire):
|
||||||
if not mailexist(a):
|
if not mailexist(a):
|
||||||
# Attribution de l'alias, sinon on passe
|
# Attribution de l'alias, sinon on passe
|
||||||
|
|
||||||
# Lock de cannonicalAlias
|
# Lock de canonicalAlias
|
||||||
self.lock('cannonicalAlias', a)
|
self.lock('canonicalAlias', a)
|
||||||
|
|
||||||
# Attribution
|
# Attribution
|
||||||
self._set('cannonicalAlias', [a])
|
self._set('canonicalAlias', [a])
|
||||||
return a
|
return a
|
||||||
|
|
||||||
def droits(self, droits=None):
|
def droits(self, droits=None):
|
||||||
|
@ -2101,7 +2101,7 @@ class club(base_proprietaire):
|
||||||
if not 'compte' in self.modifs:
|
if not 'compte' in self.modifs:
|
||||||
self.modifs.setdefault('compte', None)
|
self.modifs.setdefault('compte', None)
|
||||||
|
|
||||||
self._data['objectClass'] = [ 'club', 'posixAccount', 'shadowAccount' ]
|
self._data['objectClass'] = ['club', 'cransAccount', 'posixAccount', 'shadowAccount']
|
||||||
self._data['uid'] = [ login ]
|
self._data['uid'] = [ login ]
|
||||||
self._data['cn'] = [ preattr(self.Nom())[1] ]
|
self._data['cn'] = [ preattr(self.Nom())[1] ]
|
||||||
self._data['loginShell' ] = [ config.club_login_shell ]
|
self._data['loginShell' ] = [ config.club_login_shell ]
|
||||||
|
@ -2836,7 +2836,7 @@ class BorneWifi(Machine):
|
||||||
|
|
||||||
if champ == None:
|
if champ == None:
|
||||||
if type(new) is list:
|
if type(new) is list:
|
||||||
self.set('nvram', new)
|
self._set('nvram', new)
|
||||||
return new
|
return new
|
||||||
else:
|
else:
|
||||||
return current
|
return current
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue