Save uidNumber used for the latest user created for future reference

This commit is contained in:
PCoder 2019-02-03 13:50:47 +01:00
parent a2550e4bff
commit 0fb34dc560

View file

@ -33,9 +33,9 @@ def create_user(user, password, firstname, lastname, email):
if results: if results:
logger.debug("{uid} exists. Trying next.".format(uid=uidNumber)) logger.debug("{uid} exists. Trying next.".format(uid=uidNumber))
uidNumber += 1 uidNumber += 1
else:
logger.debug("{uid} does not exist. Using it".format(uid=uidNumber))
logger.debug("{uid} does not exist. Using it".format(uid=uidNumber))
set_max_uid(uidNumber)
w = Writer(conn, obj_new_user) w = Writer(conn, obj_new_user)
dn = 'uid=%s,ou=users,dc=ungleich,dc=ch' % user dn = 'uid=%s,ou=users,dc=ungleich,dc=ch' % user
w.new(dn) w.new(dn)