8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-30 08:32:26 +00:00

Reactive ldap sync

This commit is contained in:
Gabriel Detraz 2016-12-12 15:58:49 +01:00 committed by root
parent 76f9deafe2
commit b1d86cd550

View file

@ -44,8 +44,7 @@ def linux_user_validator(login):
def get_fresh_user_uid(): def get_fresh_user_uid():
uids = list(range(int(min(UID_RANGES['users'])),int(max(UID_RANGES['users'])))) uids = list(range(int(min(UID_RANGES['users'])),int(max(UID_RANGES['users']))))
#used_uids = [ user.uid_number for user in User.objects.all()] used_uids = [ user.uid_number for user in User.objects.all()]
used_uids = [10000]
free_uids = [ id for id in uids if id not in used_uids] free_uids = [ id for id in uids if id not in used_uids]
return min(free_uids) return min(free_uids)
@ -249,7 +248,6 @@ class User(AbstractBaseUser):
def ldap_sync(self, base=True, access_refresh=True, mac_refresh=True): def ldap_sync(self, base=True, access_refresh=True, mac_refresh=True):
self.refresh_from_db() self.refresh_from_db()
return
try: try:
user_ldap = LdapUser.objects.get(uidNumber=self.uid_number) user_ldap = LdapUser.objects.get(uidNumber=self.uid_number)
except LdapUser.DoesNotExist: except LdapUser.DoesNotExist:
@ -302,7 +300,6 @@ class ServiceUser(AbstractBaseUser):
objects = UserManager() objects = UserManager()
def ldap_sync(self): def ldap_sync(self):
return
try: try:
user_ldap = LdapServiceUser.objects.get(name=self.pseudo) user_ldap = LdapServiceUser.objects.get(name=self.pseudo)
except LdapServiceUser.DoesNotExist: except LdapServiceUser.DoesNotExist:
@ -372,7 +369,6 @@ class ListRight(models.Model):
return self.listright return self.listright
def ldap_sync(self): def ldap_sync(self):
return
try: try:
group_ldap = LdapUserGroup.objects.get(gid=self.gid) group_ldap = LdapUserGroup.objects.get(gid=self.gid)
except LdapUserGroup.DoesNotExist: except LdapUserGroup.DoesNotExist: