forked from ungleich-public/dynamicweb
complete cms setup
This commit is contained in:
parent
f763cee2c6
commit
577fdd33c2
130 changed files with 245 additions and 178 deletions
|
|
@ -1,13 +1,22 @@
|
|||
|
||||
import logging
|
||||
|
||||
from django.conf import settings
|
||||
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:
|
||||
|
||||
def authenticate(self, request, username=None, password=None, **kwargs):
|
||||
user = super().authenticate(
|
||||
request=request,
|
||||
username=username,
|
||||
password=password,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
if user and not settings.DEBUG:
|
||||
user.create_ldap_account(password)
|
||||
return user
|
||||
|
||||
return user
|
||||
Loading…
Add table
Add a link
Reference in a new issue