[objets] Compte crans et initialisation du solde
This commit is contained in:
parent
12e8103df7
commit
1b47e03725
1 changed files with 6 additions and 3 deletions
|
@ -915,6 +915,7 @@ class proprio(CransLdapObject):
|
||||||
if os.path.exists("/var/mail/" + login):
|
if os.path.exists("/var/mail/" + login):
|
||||||
raise ValueError('Création du compte impossible : /var/mail/%s existant' % str(login))
|
raise ValueError('Création du compte impossible : /var/mail/%s existant' % str(login))
|
||||||
|
|
||||||
|
self._modifs['objectClass'] = [u'adherent', u'cransAccount', u'posixAccount', u'shadowAccount']
|
||||||
self['uid' ] = [login]
|
self['uid' ] = [login]
|
||||||
self['homeDirectory'] = [home]
|
self['homeDirectory'] = [home]
|
||||||
self['mail'] = [login + u"@crans.org"]
|
self['mail'] = [login + u"@crans.org"]
|
||||||
|
@ -922,10 +923,10 @@ class proprio(CransLdapObject):
|
||||||
if crans_utils.mailexist(calias):
|
if crans_utils.mailexist(calias):
|
||||||
calias = login
|
calias = login
|
||||||
self['canonicalAlias'] = [calias]
|
self['canonicalAlias'] = [calias]
|
||||||
self._modifs['objectClass'] = [u'adherent', u'cransAccount', u'posixAccount', u'shadowAccount']
|
|
||||||
self['cn'] = [ fn + u' ' + ln ]
|
self['cn'] = [ fn + u' ' + ln ]
|
||||||
self['loginShell'] = [unicode(shell)]
|
self['loginShell'] = [unicode(shell)]
|
||||||
self['userPassword'] = [unicode(hash_pass)]
|
self['userPassword'] = [unicode(hash_pass)]
|
||||||
|
self["solde"] = 0.0
|
||||||
|
|
||||||
if uidNumber:
|
if uidNumber:
|
||||||
if self.conn.search(u'(uidNumber=%s)' % uidNumber):
|
if self.conn.search(u'(uidNumber=%s)' % uidNumber):
|
||||||
|
@ -950,8 +951,10 @@ class proprio(CransLdapObject):
|
||||||
|
|
||||||
def solde(self, operation, comment):
|
def solde(self, operation, comment):
|
||||||
self['historique'].append(comment)
|
self['historique'].append(comment)
|
||||||
raise EnvironmentError("Il faut implémenter des locks sur le solde avant d'écrire la fonction solde dans la classe proprio de lc_ldap")
|
if self['solde']:
|
||||||
|
self['solde'][0]+=float(operation)
|
||||||
|
else:
|
||||||
|
self['solde']=float(operation)
|
||||||
|
|
||||||
def may_be(self, what, liste=None):
|
def may_be(self, what, liste=None):
|
||||||
"""Teste si liste peut faire ce qui est dans what, pour
|
"""Teste si liste peut faire ce qui est dans what, pour
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue