mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-16 07:18:22 +00:00
perf: modify user login ACL msg
This commit is contained in:
@@ -142,11 +142,11 @@ class ACLError(AuthFailedNeedLogMixin, AuthFailedError):
|
||||
}
|
||||
|
||||
|
||||
class LoginACLIPAndTimePeriodNotAllowed(ACLError):
|
||||
class LoginACLNotAllowed(ACLError):
|
||||
def __init__(self, username, request, **kwargs):
|
||||
self.username = username
|
||||
self.request = request
|
||||
super().__init__(_("Current IP and Time period is not allowed"), **kwargs)
|
||||
super().__init__(_("Current login is prohibited by ACL rules"), **kwargs)
|
||||
|
||||
|
||||
class MFACodeRequiredError(AuthFailedError):
|
||||
|
@@ -353,7 +353,7 @@ class AuthACLMixin:
|
||||
return
|
||||
|
||||
if acl.is_action(LoginACL.ActionChoices.reject):
|
||||
raise errors.LoginACLIPAndTimePeriodNotAllowed(user.username, request=self.request)
|
||||
raise errors.LoginACLNotAllowed(user.username, request=self.request)
|
||||
|
||||
if acl.is_action(acl.ActionChoices.review):
|
||||
self.request.session['auth_confirm_required'] = '1'
|
||||
|
@@ -2997,7 +2997,7 @@ msgid "Login confirm ticket was {}"
|
||||
msgstr ""
|
||||
|
||||
#: authentication/errors/failed.py:149
|
||||
msgid "Current IP and Time period is not allowed"
|
||||
msgid "Current login is prohibited by ACL rules"
|
||||
msgstr ""
|
||||
|
||||
#: authentication/errors/failed.py:154
|
||||
|
@@ -3073,8 +3073,8 @@ msgid "Login confirm ticket was {}"
|
||||
msgstr "ログイン確認チケットは {} でした"
|
||||
|
||||
#: authentication/errors/failed.py:149
|
||||
msgid "Current IP and Time period is not allowed"
|
||||
msgstr "現在の IP と期間はログインを許可されていません"
|
||||
msgid "Current login is prohibited by ACL rules"
|
||||
msgstr "現在のログインはACLルールによって禁止されています"
|
||||
|
||||
#: authentication/errors/failed.py:154
|
||||
msgid "Please enter MFA code"
|
||||
|
@@ -3026,8 +3026,8 @@ msgid "Login confirm ticket was {}"
|
||||
msgstr "登录复核: {}"
|
||||
|
||||
#: authentication/errors/failed.py:149
|
||||
msgid "Current IP and Time period is not allowed"
|
||||
msgstr "当前 IP 和时间段不被允许登录"
|
||||
msgid "Current login is prohibited by ACL rules"
|
||||
msgstr "当前登录ACL规则禁止登录"
|
||||
|
||||
#: authentication/errors/failed.py:154
|
||||
msgid "Please enter MFA code"
|
||||
|
Reference in New Issue
Block a user