From f8bace5b4eea1ef288b5bd3cc38a4f5312ff2059 Mon Sep 17 00:00:00 2001 From: rainzm Date: Wed, 13 Jan 2021 19:35:54 +0800 Subject: [PATCH] feat(notify): add template about topic USER_LOGIN_EXCEPTION --- .../yunion/share/template/content@cn/USER_LOGIN_EXCEPTION | 5 +++++ .../yunion/share/template/content@en/USER_LOGIN_EXCEPTION | 5 +++++ .../opt/yunion/share/template/title@cn/USER_LOGIN_EXCEPTION | 1 + .../opt/yunion/share/template/title@en/USER_LOGIN_EXCEPTION | 1 + pkg/cloudcommon/notifyclient/events.go | 2 ++ 5 files changed, 14 insertions(+) create mode 100644 build/notify/root/opt/yunion/share/template/content@cn/USER_LOGIN_EXCEPTION create mode 100644 build/notify/root/opt/yunion/share/template/content@en/USER_LOGIN_EXCEPTION create mode 100644 build/notify/root/opt/yunion/share/template/title@cn/USER_LOGIN_EXCEPTION create mode 100644 build/notify/root/opt/yunion/share/template/title@en/USER_LOGIN_EXCEPTION diff --git a/build/notify/root/opt/yunion/share/template/content@cn/USER_LOGIN_EXCEPTION b/build/notify/root/opt/yunion/share/template/content@cn/USER_LOGIN_EXCEPTION new file mode 100644 index 0000000000..dcae36ca25 --- /dev/null +++ b/build/notify/root/opt/yunion/share/template/content@cn/USER_LOGIN_EXCEPTION @@ -0,0 +1,5 @@ +{{- if .admin -}} +域{{ .domain }}下的账号{{ .user }}由于异常登录已被锁定,请您核实用户使用情况。如果需要为用户解锁,请到用户列表启用该用户。 +{{- else -}} +您的账号{{ .user }}由于异常登录已被锁定,请联系管理员解锁账号。 +{{- end -}} diff --git a/build/notify/root/opt/yunion/share/template/content@en/USER_LOGIN_EXCEPTION b/build/notify/root/opt/yunion/share/template/content@en/USER_LOGIN_EXCEPTION new file mode 100644 index 0000000000..29a0a1b51c --- /dev/null +++ b/build/notify/root/opt/yunion/share/template/content@en/USER_LOGIN_EXCEPTION @@ -0,0 +1,5 @@ +{{- if .admin -}} +The account {{ .user }} in domain {{ .domain }} has been locked due to abnormal login. Please verify the situation and, if you need to unlock this account, enable it in the user list. +{{- else -}} +The account {{ .user }} has been locked due to abnormal login. Please contact the administrator to unlock your account. +{{- end -}} diff --git a/build/notify/root/opt/yunion/share/template/title@cn/USER_LOGIN_EXCEPTION b/build/notify/root/opt/yunion/share/template/title@cn/USER_LOGIN_EXCEPTION new file mode 100644 index 0000000000..55a1746fe5 --- /dev/null +++ b/build/notify/root/opt/yunion/share/template/title@cn/USER_LOGIN_EXCEPTION @@ -0,0 +1 @@ +安全告警 diff --git a/build/notify/root/opt/yunion/share/template/title@en/USER_LOGIN_EXCEPTION b/build/notify/root/opt/yunion/share/template/title@en/USER_LOGIN_EXCEPTION new file mode 100644 index 0000000000..ce81af334e --- /dev/null +++ b/build/notify/root/opt/yunion/share/template/title@en/USER_LOGIN_EXCEPTION @@ -0,0 +1 @@ +Security Alerts diff --git a/pkg/cloudcommon/notifyclient/events.go b/pkg/cloudcommon/notifyclient/events.go index 3f321dc9c3..159e167190 100644 --- a/pkg/cloudcommon/notifyclient/events.go +++ b/pkg/cloudcommon/notifyclient/events.go @@ -34,6 +34,8 @@ const ( SERVER_PANICKED = "SERVER_PANICKED" IMAGE_ACTIVED = "IMAGE_ACTIVED" + + USER_LOGIN_EXCEPTION = "USER_LOGIN_EXCEPTION" ) type SAction string