mirror of https://github.com/jumpserver/jumpserver
serve active and user active
parent
3f4a7225b1
commit
89e2133341
|
@ -210,11 +210,17 @@ def get_connect_item(username, ip):
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
raise ServerError("Host %s does not exist." % ip)
|
raise ServerError("Host %s does not exist." % ip)
|
||||||
|
|
||||||
|
if not asset.is_active:
|
||||||
|
raise ServerError('Host %s is not active.' % ip)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
user = User.objects.get(username=username)
|
user = User.objects.get(username=username)
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
raise ServerError('User %s does not exist.' % username)
|
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':
|
if asset.login_type == 'L':
|
||||||
try:
|
try:
|
||||||
ldap_pwd = cryptor.decrypt(user.ldap_pwd)
|
ldap_pwd = cryptor.decrypt(user.ldap_pwd)
|
||||||
|
|
Loading…
Reference in New Issue