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