From c5f6c564a7d6c1e0f223621c95f23b835703f3c6 Mon Sep 17 00:00:00 2001
From: feng626 <1304903146@qq.com>
Date: Thu, 21 Oct 2021 13:02:27 +0800
Subject: [PATCH 01/24] =?UTF-8?q?fix:=20=E7=B3=BB=E7=BB=9F=E5=90=AF?=
=?UTF-8?q?=E5=8A=A8bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/users/models/user.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/apps/users/models/user.py b/apps/users/models/user.py
index 90b6b1976..4c14f83cc 100644
--- a/apps/users/models/user.py
+++ b/apps/users/models/user.py
@@ -17,7 +17,6 @@ from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.shortcuts import reverse
-from acls.models import LoginACL
from orgs.utils import current_org
from orgs.models import OrganizationMember, Organization
from common.exceptions import JMSException
From 526928518de86f0b4e64c16dd3c6e6dbbeee6e6c Mon Sep 17 00:00:00 2001
From: feng626 <1304903146@qq.com>
Date: Thu, 21 Oct 2021 15:00:29 +0800
Subject: [PATCH 02/24] perf: acl filter
---
apps/acls/filters.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/acls/filters.py b/apps/acls/filters.py
index 23cd0bc61..f5d1c73b3 100644
--- a/apps/acls/filters.py
+++ b/apps/acls/filters.py
@@ -11,5 +11,5 @@ class LoginAclFilter(BaseFilterSet):
class Meta:
model = LoginACL
fields = (
- 'name', 'user', 'user_display'
+ 'name', 'user', 'user_display', 'action'
)
From 8c118b6f47f80821a6d61ad9425f9d2b234209a0 Mon Sep 17 00:00:00 2001
From: xinwen
- {{ command }} -+
+{{ command }} +
- {{ title}} + {{ title | safe }}
+ {{ ticket_info }} +
++
++ +
+ + {{ body | safe }} +- - {% trans 'If you suspect that the login behavior is abnormal, please modify the account password in time.' %} - + {% trans 'If you suspect that the login behavior is abnormal, please modify the account password in time.' %}
\ No newline at end of file diff --git a/apps/authentication/templates/authentication/_msg_reset_password.html b/apps/authentication/templates/authentication/_msg_reset_password.html index 9388f2388..036eea542 100644 --- a/apps/authentication/templates/authentication/_msg_reset_password.html +++ b/apps/authentication/templates/authentication/_msg_reset_password.html @@ -1,15 +1,17 @@ {% load i18n %} -{% trans 'Hello' %} {{ user.name }}, -+ {% trans 'Hello' %} {{ user.name }}, +
+
+ {% trans 'Please click the link below to reset your password, if not your request, concern your account security' %}
+
+
+ {% trans 'Click here reset password' %}
+
+ {% trans 'This link is valid for 1 hour. After it expires' %} + + {% trans 'request new one' %} + +
diff --git a/apps/authentication/templates/authentication/_msg_rest_password_success.html b/apps/authentication/templates/authentication/_msg_rest_password_success.html index 424396473..a12d611f7 100644 --- a/apps/authentication/templates/authentication/_msg_rest_password_success.html +++ b/apps/authentication/templates/authentication/_msg_rest_password_success.html @@ -1,18 +1,14 @@ {% load i18n %} - -{% trans 'Hello' %}: {{ name }},
+{% trans 'Hello' %} {{ name }},
- {% trans 'Your password has just been successfully updated.' %} + {% trans 'Your password has just been successfully updated' %}
- {% trans 'IP' %}: {{ ip_address }}
- {% trans 'Browser' %}: {{ browser }}
+ {% trans 'IP' %}: {{ ip_address }}
+ {% trans 'Browser' %}: {{ browser }}
---
-
- {% trans 'If the password update was not initiated by you, your account may have security issues.' %}
- {% trans 'If you have any questions, you can contact the administrator.' %}
-
+ {% trans 'If the password update was not initiated by you, your account may have security issues' %}
+ {% trans 'If you have any questions, you can contact the administrator' %}
Your account has been created successfully
\n" -"---
\n" -" Login direct\n" -"您的账户已创建成功
\n" -" \n" -"---
\n" -" 直接登录\n" -"Your account has been created successfully
\n" +#~ "---
\n" +#~ " Login direct\n" +#~ "您的账户已创建成功
\n" +#~ "---
\n" +#~ " 直接登录\n" +#~ "+ {} ++
- ---
-
- {% trans 'If you have any question, please contact the administrator' %}
-
+ {% trans 'If you have any question, please contact the administrator' %}
- {% trans 'Command' %}: {{ command }} -
-- {% trans 'Asset' %}: {{ hostname }}({{ host_ip }}) -
-- {% trans 'User' %}: {{ user }} -
-- {% trans 'Level' %}: {{ risk_level }} -
-- {% trans 'Session' %}: {% trans 'view' %} -
++{{ command }} ++
- {% trans 'User' %}: {{ user }} -
-- {% trans 'Level' %}: {{ risk_level }} -
+{% for item, value in items.items %} + + {{ item }}: {{ value }} + +
+{% endfor %} + {% trans 'Command' %}:
+{{ command }} -+
- {% trans 'If your password has expired, please click' %} + {% trans 'If your password has expired, please click the link below to' %} {% trans 'Reset password' %} - {% trans 'to apply for a password reset email.' %}
---- -
- {% trans 'Your MFA has been reset by site administrator.' %}
- {% trans 'Please login and reset your MFA.' %}
+ {% trans 'Your MFA has been reset by site administrator' %}
+ {% trans 'Please click the link below to set' %}
+
+
+ {% trans 'Click here set' %}
- {% trans 'Login direct' %} -
\ No newline at end of file diff --git a/apps/users/templates/users/_msg_reset_ssh_key.html b/apps/users/templates/users/_msg_reset_ssh_key.html index ab705aca7..58f97524a 100644 --- a/apps/users/templates/users/_msg_reset_ssh_key.html +++ b/apps/users/templates/users/_msg_reset_ssh_key.html @@ -4,9 +4,9 @@ {% trans 'Hello' %} {{ name }},
- {% trans 'Your ssh public key has been reset by site administrator.' %}
- {% trans 'Please login and reset your ssh public key.' %}
+ {% trans 'Your ssh public key has been reset by site administrator' %}
+ {% trans 'Please click the link below to set' %}
+
+
+ {% trans 'Click here set' %}
- {% trans 'Login direct' %} -
\ No newline at end of file diff --git a/apps/users/templates/users/_msg_user_created.html b/apps/users/templates/users/_msg_user_created.html new file mode 100644 index 000000000..c0515e9f6 --- /dev/null +++ b/apps/users/templates/users/_msg_user_created.html @@ -0,0 +1,20 @@ +{% load i18n %} + ++ {{ honorific }}: +
+ +{% trans 'Your account has been created successfully' %}
+
+ {% trans 'Username' %}: {{ username }}
+ {% trans 'Password' %}:
+
+ {% trans 'click here to set your password' %}
+
+
+ {% trans 'This link is valid for 1 hour. After it expires' %} + {% trans 'request new one' %} +
+Your account has been created successfully
----
- Login direct -' + settings.EMAIL_CUSTOM_USER_CREATED_BODY + '
' - else: - custom_body = '' - body = custom_body + default_body - return body - - def send_user_created_mail(user): + from .notifications import UserCreatedMsg + recipient_list = [user.email] - subject = _('Create account successfully') - if settings.EMAIL_CUSTOM_USER_CREATED_SUBJECT: - subject = settings.EMAIL_CUSTOM_USER_CREATED_SUBJECT + msg = UserCreatedMsg.html_msg + subject = msg['subject'] + message = msg['message'] - honorific = '' + _('Hello %(name)s') % {'name': user.name} + ':
' - if settings.EMAIL_CUSTOM_USER_CREATED_HONORIFIC: - honorific = '' + settings.EMAIL_CUSTOM_USER_CREATED_HONORIFIC + ':
' - - body = construct_user_created_email_body(user) - - signature = 'jumpserver
' - if settings.EMAIL_CUSTOM_USER_CREATED_SIGNATURE: - signature = '' + settings.EMAIL_CUSTOM_USER_CREATED_SIGNATURE + '
' - - message = honorific + body + signature if settings.DEBUG: try: print(message) From cd5094f10d90e00fac0afbb738efd4107945ec27 Mon Sep 17 00:00:00 2001 From: ibulerdiff --git a/apps/perms/templates/perms/_msg_item_permissions_expire.html b/apps/perms/templates/perms/_msg_item_permissions_expire.html index f96b5e61d..139f958b3 100644 --- a/apps/perms/templates/perms/_msg_item_permissions_expire.html +++ b/apps/perms/templates/perms/_msg_item_permissions_expire.html @@ -11,6 +11,6 @@
diff --git a/apps/terminal/templates/terminal/_msg_command_execute_alert.html b/apps/terminal/templates/terminal/_msg_command_execute_alert.html index 61022d156..ff59e0c4b 100644 --- a/apps/terminal/templates/terminal/_msg_command_execute_alert.html +++ b/apps/terminal/templates/terminal/_msg_command_execute_alert.html @@ -17,7 +17,7 @@