ArchiveBox/archivebox/core/auth_ldap.py
Nick Sweeting e8772513ca
Update archivebox/core/auth_ldap.py
add log line
2024-01-24 11:00:42 -08:00

12 lines
397 B
Python

from django.conf import settings
from ..config import (
LDAP_CREATE_SUPERUSER
)
def create_user(sender, user=None, ldap_user=None, **kwargs):
if not user.id and LDAP_CREATE_SUPERUSER:
user.is_superuser = True
user.is_staff = True
print(f'[!] WARNING: Creating new user {user} based on LDAP user {ldap_user} (is_staff={user.is_staff}, is_superuser={user.is_superuser})')