コード例 #1
0
ファイル: authbackends.py プロジェクト: juju2013/modoboa
 def get_or_create_user(self, username, ldap_user):
     """
     This must return a (User, created) 2-tuple for the given LDAP user.
     username is the Django-friendly username of the user. ldap_user.dn is
     the user's DN and ldap_user.attrs contains all of their LDAP attributes.
     """
     user, created = User.objects.get_or_create(
         username__iexact=username,
         defaults={'username': username.lower()})
     if created:
         populate_callback(user)
     return user, created
コード例 #2
0
ファイル: authbackends.py プロジェクト: juju2013/modoboa
 def get_or_create_user(self, username, ldap_user):
     """
     This must return a (User, created) 2-tuple for the given LDAP user.
     username is the Django-friendly username of the user. ldap_user.dn is
     the user's DN and ldap_user.attrs contains all of their LDAP attributes.
     """
     user, created = User.objects.get_or_create(
         username__iexact=username, 
         defaults={'username': username.lower()}
     )
     if created:
         populate_callback(user)
     return user, created
コード例 #3
0
ファイル: authbackends.py プロジェクト: Tdey/modoboa
 def get_or_create_user(self, username, ldap_user):
     """
     This must return a (User, created) 2-tuple for the given LDAP user.
     username is the Django-friendly username of the user. ldap_user.dn is
     the user's DN and ldap_user.attrs contains all of their LDAP attributes.
     """
     lpart, domain = split_mailbox(username)
     if domain is None:
         return None
     user, created = User.objects.get_or_create(
         username__iexact=username, 
         defaults={'username': username.lower(), 'is_local': False}
     )
     if created:
         populate_callback(user)
     return user, created
コード例 #4
0
 def get_or_create_user(self, username, ldap_user):
     """
     This must return a (User, created) 2-tuple for the given LDAP user.
     username is the Django-friendly username of the user. ldap_user.dn is
     the user's DN and ldap_user.attrs contains all of their LDAP attributes.
     """
     lpart, domain = split_mailbox(username)
     if domain is None:
         return None
     user, created = User.objects.get_or_create(
         username__iexact=username,
         defaults={
             'username': username.lower(),
             'is_local': False
         })
     if created:
         populate_callback(user)
     return user, created