mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 08:19:04 +00:00
serve active and user active
This commit is contained in:
@@ -210,11 +210,17 @@ def get_connect_item(username, ip):
|
||||
except ObjectDoesNotExist:
|
||||
raise ServerError("Host %s does not exist." % ip)
|
||||
|
||||
if not asset.is_active:
|
||||
raise ServerError('Host %s is not active.' % ip)
|
||||
|
||||
try:
|
||||
user = User.objects.get(username=username)
|
||||
except ObjectDoesNotExist:
|
||||
raise ServerError('User %s does not exist.' % username)
|
||||
|
||||
if not user.is_active:
|
||||
raise ServerError('User %s is not active.' % username)
|
||||
|
||||
if asset.login_type == 'L':
|
||||
try:
|
||||
ldap_pwd = cryptor.decrypt(user.ldap_pwd)
|
||||
|
Reference in New Issue
Block a user