Add utils app
This commit is contained in:
parent
72c3149cc0
commit
6a74124adf
24 changed files with 4235 additions and 0 deletions
13
utils/backend.py
Executable file
13
utils/backend.py
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.contrib.auth.backends import ModelBackend
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MyLDAPBackend(ModelBackend):
|
||||
def authenticate(self, username=None, password=None, **kwargs):
|
||||
user = super().authenticate(username, password, **kwargs)
|
||||
if user:
|
||||
user.create_ldap_account(password)
|
||||
return user
|
||||
Loading…
Add table
Add a link
Reference in a new issue