Pouvoir forcer à nouveau l’établissement dans le cas du changement
This commit is contained in:
@@ -298,7 +298,7 @@ index 45ec338..0ec3129 100644
|
|||||||
else:
|
else:
|
||||||
raise Exception('Unknown mode')
|
raise Exception('Unknown mode')
|
||||||
diff --git usr/lib/python3/dist-packages/scribe/eoleuser.py usr/lib/python3/dist-packages/scribe/eoleuser.py
|
diff --git usr/lib/python3/dist-packages/scribe/eoleuser.py usr/lib/python3/dist-packages/scribe/eoleuser.py
|
||||||
index 05569fd..b78c2e1 100644
|
index 05569fd..f8b4ab3 100644
|
||||||
--- usr/lib/python3/dist-packages/scribe/eoleuser.py
|
--- usr/lib/python3/dist-packages/scribe/eoleuser.py
|
||||||
+++ usr/lib/python3/dist-packages/scribe/eoleuser.py
|
+++ usr/lib/python3/dist-packages/scribe/eoleuser.py
|
||||||
@@ -361,25 +361,27 @@ class User(LdapEntry):
|
@@ -361,25 +361,27 @@ class User(LdapEntry):
|
||||||
@@ -394,7 +394,7 @@ index 05569fd..b78c2e1 100644
|
|||||||
self._set_attr(login, 'LastUpdate', tool.format_current_date())
|
self._set_attr(login, 'LastUpdate', tool.format_current_date())
|
||||||
|
|
||||||
def _get_ead_type(self, login):
|
def _get_ead_type(self, login):
|
||||||
@@ -850,20 +864,27 @@ class User(LdapEntry):
|
@@ -850,22 +864,27 @@ class User(LdapEntry):
|
||||||
return num_etab
|
return num_etab
|
||||||
|
|
||||||
def get_user_dn(self, login, force_etab=None):
|
def get_user_dn(self, login, force_etab=None):
|
||||||
@@ -405,23 +405,28 @@ index 05569fd..b78c2e1 100644
|
|||||||
"(&%s(uid=%s))" % (USER_FILTER, login), ['cn'])
|
"(&%s(uid=%s))" % (USER_FILTER, login), ['cn'])
|
||||||
if data[0][0]:
|
if data[0][0]:
|
||||||
return data[0][0]
|
return data[0][0]
|
||||||
|
- if force_etab is None:
|
||||||
|
- etab = self.get_etab(login)
|
||||||
|
- else:
|
||||||
|
- etab = force_etab
|
||||||
|
- return USER_DN % dict(uid=login, _type=self._type, etab=etab)
|
||||||
+ elif LDAP_MODE == 'openldap':
|
+ elif LDAP_MODE == 'openldap':
|
||||||
|
+ if force_etab is None:
|
||||||
+ if self.ldap_admin.connexion is None:
|
+ if self.ldap_admin.connexion is None:
|
||||||
+ self.ldap_admin.connect()
|
+ self.ldap_admin.connect()
|
||||||
+ data = self.ldap_admin.connexion.search_s(SUFFIX, SCOPE_SUBTREE,
|
+ data = self.ldap_admin.connexion.search_s(SUFFIX, SCOPE_SUBTREE,
|
||||||
+ "(&%s(uid=%s))" % (USER_FILTER, login), ['cn'])
|
+ "(&%s(uid=%s))" % (USER_FILTER, login), ['cn'])
|
||||||
+ if data[0][0]:
|
+ if data[0][0]:
|
||||||
+ return data[0][0]
|
+ return data[0][0]
|
||||||
if force_etab is None:
|
+ else:
|
||||||
etab = self.get_etab(login)
|
+ return USER_DN % dict(uid=login, _type=self._type, etab=force_etab)
|
||||||
else:
|
|
||||||
etab = force_etab
|
|
||||||
return USER_DN % dict(uid=login, _type=self._type, etab=etab)
|
|
||||||
|
|
||||||
class Machine(User):
|
class Machine(User):
|
||||||
"""
|
"""
|
||||||
classe pour les comptes machine
|
classe pour les comptes machine
|
||||||
"""
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
diff --git usr/lib/python3/dist-packages/scribe/importation/writer.py usr/lib/python3/dist-packages/scribe/importation/writer.py
|
diff --git usr/lib/python3/dist-packages/scribe/importation/writer.py usr/lib/python3/dist-packages/scribe/importation/writer.py
|
||||||
index 34ce0fb..c61f65b 100644
|
index 34ce0fb..c61f65b 100644
|
||||||
--- usr/lib/python3/dist-packages/scribe/importation/writer.py
|
--- usr/lib/python3/dist-packages/scribe/importation/writer.py
|
||||||
|
Reference in New Issue
Block a user