mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-03 10:50:47 +01:00
disable login for suspended users
This commit is contained in:
@@ -79,6 +79,11 @@ def verifyLogin(request):
|
||||
|
||||
admin = Administrator.objects.get(userName=username)
|
||||
|
||||
if admin.state == 'SUSPENDED':
|
||||
data = {'userID': 0, 'loginStatus': 0, 'error_message': 'Account currently suspended.'}
|
||||
json_data = json.dumps(data)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
if hashPassword.check_password(admin.password, password):
|
||||
|
||||
request.session['userID'] = admin.pk
|
||||
|
||||
Reference in New Issue
Block a user