mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 18:31:04 +00:00
perf: Third-party user login settings default organization
This commit is contained in:
1
apps/authentication/backends/radius/__init__.py
Normal file
1
apps/authentication/backends/radius/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .backends import *
|
@@ -2,12 +2,12 @@
|
||||
#
|
||||
import traceback
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from radiusauth.backends import RADIUSBackend, RADIUSRealmBackend
|
||||
from django.conf import settings
|
||||
|
||||
from .base import JMSBaseAuthBackend
|
||||
|
||||
from authentication.backends.base import JMSBaseAuthBackend
|
||||
from .signals import radius_create_user
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
@@ -28,8 +28,8 @@ class CreateUserMixin:
|
||||
email = '{}@{}'.format(username, email_suffix)
|
||||
|
||||
user = User(username=username, name=username, email=email)
|
||||
user.source = user.Source.radius.value
|
||||
user.save()
|
||||
radius_create_user.send(sender=user.__class__, user=user)
|
||||
return user
|
||||
|
||||
def _perform_radius_auth(self, client, packet):
|
3
apps/authentication/backends/radius/signals.py
Normal file
3
apps/authentication/backends/radius/signals.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.dispatch import Signal
|
||||
|
||||
radius_create_user = Signal()
|
Reference in New Issue
Block a user