Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Xavier Bachelot
lemonldap-ng
Commits
b486735d
Commit
b486735d
authored
Jan 16, 2019
by
Christophe Maudoux
🐛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP - Split mailReset plugin and SMTP parameters (#1616)
parent
86e88da4
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
307 additions
and
914 deletions
+307
-914
_example/conf/lmConf-1.json
_example/conf/lmConf-1.json
+1
-1
lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
...p-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
+1
-1
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm
+16
-16
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
...p-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
+223
-219
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm
+7
-7
lemonldap-ng-manager/site/htdocs/static/languages/ar.json
lemonldap-ng-manager/site/htdocs/static/languages/ar.json
+6
-6
lemonldap-ng-manager/site/htdocs/static/languages/de.json
lemonldap-ng-manager/site/htdocs/static/languages/de.json
+6
-6
lemonldap-ng-manager/site/htdocs/static/languages/en.json
lemonldap-ng-manager/site/htdocs/static/languages/en.json
+6
-6
lemonldap-ng-manager/site/htdocs/static/languages/fr.json
lemonldap-ng-manager/site/htdocs/static/languages/fr.json
+6
-6
lemonldap-ng-manager/site/htdocs/static/languages/it.json
lemonldap-ng-manager/site/htdocs/static/languages/it.json
+6
-6
lemonldap-ng-manager/site/htdocs/static/languages/vi.json
lemonldap-ng-manager/site/htdocs/static/languages/vi.json
+6
-6
lemonldap-ng-manager/site/htdocs/static/languages/zh.json
lemonldap-ng-manager/site/htdocs/static/languages/zh.json
+6
-6
lemonldap-ng-manager/site/htdocs/static/reverseTree.json
lemonldap-ng-manager/site/htdocs/static/reverseTree.json
+1
-1
lemonldap-ng-manager/site/htdocs/static/struct.json
lemonldap-ng-manager/site/htdocs/static/struct.json
+1
-1
lemonldap-ng-manager/t/jsonfiles/01-base-tree.json
lemonldap-ng-manager/t/jsonfiles/01-base-tree.json
+2
-2
lemonldap-ng-manager/t/jsonfiles/02-base-tree-all-nodes-opened.json
...ng-manager/t/jsonfiles/02-base-tree-all-nodes-opened.json
+2
-2
lemonldap-ng-manager/t/jsonfiles/11-modified-with-confirmation.json
...ng-manager/t/jsonfiles/11-modified-with-confirmation.json
+2
-2
lemonldap-ng-manager/t/jsonfiles/12-modified.json
lemonldap-ng-manager/t/jsonfiles/12-modified.json
+2
-2
lemonldap-ng-manager/t/jsonfiles/14-bad.json
lemonldap-ng-manager/t/jsonfiles/14-bad.json
+2
-2
lemonldap-ng-manager/t/jsonfiles/15-combination.json
lemonldap-ng-manager/t/jsonfiles/15-combination.json
+2
-2
lemonldap-ng-portal/MANIFEST
lemonldap-ng-portal/MANIFEST
+1
-1
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugins.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugins.pm
+2
-2
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm
...ap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm
+0
-611
No files found.
_example/conf/lmConf-1.json
View file @
b486735d
...
...
@@ -86,7 +86,7 @@
"authentication"
:
"Demo"
,
"cfgAuthor"
:
"The LemonLDAP::NG team"
,
"cfgNum"
:
1
,
"cfgVersion"
:
"2.0.
2
"
,
"cfgVersion"
:
"2.0.
1
"
,
"cookieName"
:
"lemonldap"
,
"demoExportedVars"
:
{
"cn"
:
"cn"
,
...
...
lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/DefaultValues.pm
View file @
b486735d
...
...
@@ -121,9 +121,9 @@ sub defaultValues {
'
macros
'
=>
{},
'
mailCharset
'
=>
'
utf-8
',
'
mailFrom
'
=>
'
noreply@example.com
',
'
mailPwdRstUrl
'
=>
'
http://auth.example.com/resetpwd
',
'
mailSessionKey
'
=>
'
mail
',
'
mailTimeout
'
=>
0
,
'
mailUrl
'
=>
'
http://auth.example.com/resetpwd
',
'
managerDn
'
=>
'',
'
managerPassword
'
=>
'',
'
max2FDevices
'
=>
10
,
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Attributes.pm
View file @
b486735d
...
...
@@ -1558,19 +1558,10 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
},
'
type
'
=>
'
keyTextContainer
'
},
'
mailBody
'
=>
{
'
type
'
=>
'
longtext
'
},
'
mailCharset
'
=>
{
'
default
'
=>
'
utf-8
',
'
type
'
=>
'
text
'
},
'
mailConfirmBody
'
=>
{
'
type
'
=>
'
longtext
'
},
'
mailConfirmSubject
'
=>
{
'
type
'
=>
'
text
'
},
'
mailFrom
'
=>
{
'
default
'
=>
'
noreply@example.com
',
'
type
'
=>
'
text
'
...
...
@@ -1582,6 +1573,22 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'
default
'
=>
0
,
'
type
'
=>
'
bool
'
},
'
mailPwdRstBody
'
=>
{
'
type
'
=>
'
longtext
'
},
'
mailPwdRstConfirmBody
'
=>
{
'
type
'
=>
'
longtext
'
},
'
mailPwdRstConfirmSubject
'
=>
{
'
type
'
=>
'
text
'
},
'
mailPwdRstSubject
'
=>
{
'
type
'
=>
'
text
'
},
'
mailPwdRstUrl
'
=>
{
'
default
'
=>
'
http://auth.example.com/resetpwd
',
'
type
'
=>
'
url
'
},
'
mailReplyTo
'
=>
{
'
type
'
=>
'
text
'
},
...
...
@@ -1589,17 +1596,10 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'
default
'
=>
'
mail
',
'
type
'
=>
'
text
'
},
'
mailSubject
'
=>
{
'
type
'
=>
'
text
'
},
'
mailTimeout
'
=>
{
'
default
'
=>
0
,
'
type
'
=>
'
int
'
},
'
mailUrl
'
=>
{
'
default
'
=>
'
http://auth.example.com/resetpwd
',
'
type
'
=>
'
url
'
},
'
maintenance
'
=>
{
'
default
'
=>
0
,
'
type
'
=>
'
bool
'
...
...
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm
View file @
b486735d
This diff is collapsed.
Click to expand it.
lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Tree.pm
View file @
b486735d
...
...
@@ -17,7 +17,7 @@
package
Lemonldap::NG::Manager::Build::
Tree
;
our
$VERSION
=
'
2.0.
0
';
our
$VERSION
=
'
2.0.
2
';
# TODO: Missing:
# * activeTimer
...
...
@@ -551,19 +551,19 @@ sub tree {
'
mailCharset
'
]
},
{
title
=>
'
mailContent
',
{
title
=>
'
mail
PwdRst
Content
',
form
=>
'
simpleInputContainer
',
nodes
=>
[
'
mailSubject
',
'
mailBody
',
'
mailConfirmSubject
',
'
mailConfirmBody
'
'
mail
PwdRst
Subject
',
'
mail
PwdRst
Body
',
'
mail
PwdRst
ConfirmSubject
',
'
mail
PwdRst
ConfirmBody
'
]
},
{
title
=>
'
mailOther
',
form
=>
'
simpleInputContainer
',
nodes
=>
[
'
mailUrl
',
'
mail
PwdRst
Url
',
'
randomPasswordRegexp
',
'
mailTimeout
',
'
mailSessionKey
'
...
...
lemonldap-ng-manager/site/htdocs/static/languages/ar.json
View file @
b486735d
...
...
@@ -379,11 +379,11 @@
"lwpOpts"
:
"خيارات لطلبات الخادم"
,
"lwpSslOpts"
:
"خيارات سسل لطلبات الخادم"
,
"macros"
:
"ماكرو"
,
"mailBody"
:
"محتوى البريد الناجح"
,
"mail
PwdRst
Body"
:
"محتوى البريد الناجح"
,
"mailCharset"
:
"charset"
,
"mailConfirmBody"
:
"تأكيد محتوى البريد"
,
"mailConfirmSubject"
:
"تأكيد عنوان بريد"
,
"mailContent"
:
"
محتوى البريد
"
,
"mail
PwdRst
ConfirmBody"
:
"تأكيد محتوى البريد"
,
"mail
PwdRst
ConfirmSubject"
:
"تأكيد عنوان بريد"
,
"mail
PwdRst
Content"
:
"
Password reset mail content
"
,
"mailFrom"
:
"مرسل البريد"
,
"mailHeaders"
:
"هيدر البريد"
,
"mailLDAPFilter"
:
"فلتر البريد"
,
...
...
@@ -391,9 +391,9 @@
"mailOther"
:
"آخر"
,
"mailReplyTo"
:
"عنوان الجواب"
,
"mailSessionKey"
:
"مفتاح الجلسة الذي يحتوي على عنوان البريد الإلكتروني"
,
"mailSubject"
:
"نجاح عنوان البريد"
,
"mail
PwdRst
Subject"
:
"نجاح عنوان البريد"
,
"mailTimeout"
:
"عدم تطابق كلمت المرور"
,
"mail
Url"
:
"صفحة اليو آر إل
"
,
"mail
PwdRstUrl"
:
"Password reset page URL
"
,
"maintenance"
:
"وضع الصيانة"
,
"malformedValue"
:
"قيمة سيئة التصميم"
,
"managerDn"
:
"حساب"
,
...
...
lemonldap-ng-manager/site/htdocs/static/languages/de.json
View file @
b486735d
...
...
@@ -379,11 +379,11 @@
"lwpOpts"
:
"Options for server requests"
,
"lwpSslOpts"
:
"SSL options for server requests"
,
"macros"
:
"Macros"
,
"mailBody"
:
"Success mail content"
,
"mail
PwdRst
Body"
:
"Success mail content"
,
"mailCharset"
:
"Charset"
,
"mailConfirmBody"
:
"Confirmation mail content"
,
"mailConfirmSubject"
:
"Confirmation mail subject"
,
"mailContent"
:
"
M
ail content"
,
"mail
PwdRst
ConfirmBody"
:
"Confirmation mail content"
,
"mail
PwdRst
ConfirmSubject"
:
"Confirmation mail subject"
,
"mail
PwdRst
Content"
:
"
Password reset m
ail content"
,
"mailFrom"
:
"Mail sender"
,
"mailHeaders"
:
"Mail headers"
,
"mailLDAPFilter"
:
"Mail filter"
,
...
...
@@ -391,9 +391,9 @@
"mailOther"
:
"Other"
,
"mailReplyTo"
:
"Reply address"
,
"mailSessionKey"
:
"Session key containing mail address"
,
"mailSubject"
:
"Success mail subject"
,
"mail
PwdRst
Subject"
:
"Success mail subject"
,
"mailTimeout"
:
"Validity time of a password reset request"
,
"mailUrl"
:
"Page URL"
,
"mail
PwdRst
Url"
:
"Pa
ssword reset pa
ge URL"
,
"maintenance"
:
"Maintenance mode"
,
"malformedValue"
:
"Malformed value"
,
"managerDn"
:
"Account"
,
...
...
lemonldap-ng-manager/site/htdocs/static/languages/en.json
View file @
b486735d
...
...
@@ -379,11 +379,11 @@
"lwpOpts"
:
"Options for server requests"
,
"lwpSslOpts"
:
"SSL options for server requests"
,
"macros"
:
"Macros"
,
"mailBody"
:
"Success mail content"
,
"mail
PwdRst
Body"
:
"Success mail content"
,
"mailCharset"
:
"Charset"
,
"mailConfirmBody"
:
"Confirmation mail content"
,
"mailConfirmSubject"
:
"Confirmation mail subject"
,
"mailContent"
:
"
M
ail content"
,
"mail
PwdRst
ConfirmBody"
:
"Confirmation mail content"
,
"mail
PwdRst
ConfirmSubject"
:
"Confirmation mail subject"
,
"mail
PwdRst
Content"
:
"
Password reset m
ail content"
,
"mailFrom"
:
"Mail sender"
,
"mailHeaders"
:
"Mail headers"
,
"mailLDAPFilter"
:
"Mail filter"
,
...
...
@@ -391,9 +391,9 @@
"mailOther"
:
"Other"
,
"mailReplyTo"
:
"Reply address"
,
"mailSessionKey"
:
"Session key containing mail address"
,
"mailSubject"
:
"Success mail subject"
,
"mail
PwdRst
Subject"
:
"Success mail subject"
,
"mailTimeout"
:
"Validity time of a password reset request"
,
"mailUrl"
:
"Page URL"
,
"mail
PwdRst
Url"
:
"Pa
ssword reset pa
ge URL"
,
"maintenance"
:
"Maintenance mode"
,
"malformedValue"
:
"Malformed value"
,
"managerDn"
:
"Account"
,
...
...
lemonldap-ng-manager/site/htdocs/static/languages/fr.json
View file @
b486735d
...
...
@@ -379,11 +379,11 @@
"lwpOpts"
:
"Options pour les requêtes serveur"
,
"lwpSslOpts"
:
"Options SSL pour les requêtes serveur"
,
"macros"
:
"Macros"
,
"mailBody"
:
"Contenu du message de succès"
,
"mail
PwdRst
Body"
:
"Contenu du message de succès"
,
"mailCharset"
:
"Charset"
,
"mailConfirmBody"
:
"Contenu du message de confirmation"
,
"mailConfirmSubject"
:
"Sujet du message de confirmation"
,
"mailContent"
:
"Contenu du mail"
,
"mail
PwdRst
ConfirmBody"
:
"Contenu du message de confirmation"
,
"mail
PwdRst
ConfirmSubject"
:
"Sujet du message de confirmation"
,
"mail
PwdRst
Content"
:
"Contenu du mail
de réinitialisation du mot de passe
"
,
"mailFrom"
:
"Expéditeur du message"
,
"mailHeaders"
:
"En-têtes du mail"
,
"mailLDAPFilter"
:
"Filtre mail"
,
...
...
@@ -391,9 +391,9 @@
"mailOther"
:
"Autres"
,
"mailReplyTo"
:
"Adresse de réponse"
,
"mailSessionKey"
:
"Clef de session contenant l'adresse email"
,
"mailSubject"
:
"Sujet du message de succès"
,
"mail
PwdRst
Subject"
:
"Sujet du message de succès"
,
"mailTimeout"
:
"Durée de validité d'une demande de réinitialisation"
,
"mailUrl"
:
"URL de la page"
,
"mail
PwdRst
Url"
:
"URL de la page
de réinitialisation du mot de passe
"
,
"maintenance"
:
"Mode maintenance"
,
"malformedValue"
:
"Valeur mal formée"
,
"managerDn"
:
"Compte de connexion LDAP"
,
...
...
lemonldap-ng-manager/site/htdocs/static/languages/it.json
View file @
b486735d
...
...
@@ -379,11 +379,11 @@
"lwpOpts"
:
"Opzioni per le richieste del server"
,
"lwpSslOpts"
:
"Opzioni SSL per le richieste del server"
,
"macros"
:
"Macro"
,
"mailBody"
:
"Successo contenuto di posta"
,
"mail
PwdRst
Body"
:
"Successo contenuto di posta"
,
"mailCharset"
:
"Charset"
,
"mailConfirmBody"
:
"Contenuto della mail di conferma"
,
"mailConfirmSubject"
:
"Soggetto della mail di conferma"
,
"mailContent"
:
"Contenuto della mail"
,
"mail
PwdRst
ConfirmBody"
:
"Contenuto della mail di conferma"
,
"mail
PwdRst
ConfirmSubject"
:
"Soggetto della mail di conferma"
,
"mail
PwdRst
Content"
:
"Contenuto della mail
di ripristino della password
"
,
"mailFrom"
:
"Mittente"
,
"mailHeaders"
:
"Intestazioni di posta"
,
"mailLDAPFilter"
:
"Filtro mail"
,
...
...
@@ -391,9 +391,9 @@
"mailOther"
:
"Altro"
,
"mailReplyTo"
:
"Indirizzo di risposta"
,
"mailSessionKey"
:
"Chiave di sessione contenente l'indirizzo di posta"
,
"mailSubject"
:
"Successo del soggetto della mail"
,
"mail
PwdRst
Subject"
:
"Successo del soggetto della mail"
,
"mailTimeout"
:
"Tempo di validità di una richiesta di ripristino della password"
,
"mailUrl"
:
"URL della pagina"
,
"mail
PwdRst
Url"
:
"URL della pagina
di ripristino della password
"
,
"maintenance"
:
"Modalità di manutenzione"
,
"malformedValue"
:
"Valore malformato"
,
"managerDn"
:
"Account"
,
...
...
lemonldap-ng-manager/site/htdocs/static/languages/vi.json
View file @
b486735d
...
...
@@ -379,11 +379,11 @@
"lwpOpts"
:
"Tùy chọn cho yêu cầu máy chủ"
,
"lwpSslOpts"
:
"Tùy chọn SSL cho yêu cầu máy chủ"
,
"macros"
:
"Macros"
,
"mailBody"
:
"Nội dung thư thành công"
,
"mail
PwdRst
Body"
:
"Nội dung thư thành công"
,
"mailCharset"
:
"Charset"
,
"mailConfirmBody"
:
"Xác nhận nội dung thư"
,
"mailConfirmSubject"
:
"Xác nhận chủ đề thư"
,
"mailContent"
:
"
Nội dung thư
"
,
"mail
PwdRst
ConfirmBody"
:
"Xác nhận nội dung thư"
,
"mail
PwdRst
ConfirmSubject"
:
"Xác nhận chủ đề thư"
,
"mail
PwdRst
Content"
:
"
Password reset mail content
"
,
"mailFrom"
:
"Người gửi thư"
,
"mailHeaders"
:
"Tiêu đề thư"
,
"mailLDAPFilter"
:
"Bộ lọc thư"
,
...
...
@@ -391,9 +391,9 @@
"mailOther"
:
"Khác"
,
"mailReplyTo"
:
"Địa chỉ trả lời"
,
"mailSessionKey"
:
"Khóa phiên chứa địa chỉ thư"
,
"mailSubject"
:
"Chủ đề thư thành công"
,
"mail
PwdRst
Subject"
:
"Chủ đề thư thành công"
,
"mailTimeout"
:
"Thời hạn hợp lệ của yêu cầu đặt lại mật khẩu"
,
"mail
Url"
:
"URL trang
"
,
"mail
PwdRstUrl"
:
"Password reset page URL
"
,
"maintenance"
:
"Chế độ bảo trì"
,
"malformedValue"
:
"Giá trị không hợp lệ"
,
"managerDn"
:
"Tài khoản"
,
...
...
lemonldap-ng-manager/site/htdocs/static/languages/zh.json
View file @
b486735d
...
...
@@ -379,11 +379,11 @@
"lwpOpts"
:
"Options for server requests"
,
"lwpSslOpts"
:
"SSL options for server requests"
,
"macros"
:
"Macros"
,
"mailBody"
:
"Success mail content"
,
"mail
PwdRst
Body"
:
"Success mail content"
,
"mailCharset"
:
"Charset"
,
"mailConfirmBody"
:
"Confirmation mail content"
,
"mailConfirmSubject"
:
"Confirmation mail subject"
,
"mailContent"
:
"
邮件内容
"
,
"mail
PwdRst
ConfirmBody"
:
"Confirmation mail content"
,
"mail
PwdRst
ConfirmSubject"
:
"Confirmation mail subject"
,
"mail
PwdRst
Content"
:
"
Password reset mail content
"
,
"mailFrom"
:
"邮件发送者"
,
"mailHeaders"
:
"邮件头"
,
"mailLDAPFilter"
:
"邮件过滤器"
,
...
...
@@ -391,9 +391,9 @@
"mailOther"
:
"Other"
,
"mailReplyTo"
:
"Reply address"
,
"mailSessionKey"
:
"Session key containing mail address"
,
"mailSubject"
:
"Success mail subject"
,
"mail
PwdRst
Subject"
:
"Success mail subject"
,
"mailTimeout"
:
"Validity time of a password reset request"
,
"mailUrl"
:
"Page URL"
,
"mail
PwdRst
Url"
:
"Pa
ssword reset pa
ge URL"
,
"maintenance"
:
"Maintenance mode"
,
"malformedValue"
:
"Malformed value"
,
"managerDn"
:
"账户"
,
...
...
lemonldap-ng-manager/site/htdocs/static/reverseTree.json
View file @
b486735d
This diff is collapsed.
Click to expand it.
lemonldap-ng-manager/site/htdocs/static/struct.json
View file @
b486735d
This diff is collapsed.
Click to expand it.
lemonldap-ng-manager/t/jsonfiles/01-base-tree.json
View file @
b486735d
...
...
@@ -1330,8 +1330,8 @@
},
{
"_nodes"
:
[{
"default"
:
"http://auth.example.com/resetpwd"
,
"id"
:
"mailUrl"
,
"title"
:
"mailUrl"
"id"
:
"mail
PwdRst
Url"
,
"title"
:
"mail
PwdRst
Url"
},
{
"default"
:
"[A-Z]{3}[a-z]{5}.
\\
d{2}"
,
"id"
:
"randomPasswordRegexp"
,
...
...
lemonldap-ng-manager/t/jsonfiles/02-base-tree-all-nodes-opened.json
View file @
b486735d
...
...
@@ -1502,8 +1502,8 @@
"type"
:
"simpleInputContainer"
,
"nodes"
:
[{
"default"
:
"http://auth.example.com/resetpwd"
,
"id"
:
"mailUrl"
,
"title"
:
"mailUrl"
,
"id"
:
"mail
PwdRst
Url"
,
"title"
:
"mail
PwdRst
Url"
,
"data"
:
"http://auth.example.com/resetpwd"
},
{
"default"
:
"[A-Z]{3}[a-z]{5}.
\\
d{2}"
,
...
...
lemonldap-ng-manager/t/jsonfiles/11-modified-with-confirmation.json
View file @
b486735d
...
...
@@ -1513,8 +1513,8 @@
"type"
:
"simpleInputContainer"
,
"nodes"
:
[{
"default"
:
"http://auth.example.com/resetpwd"
,
"id"
:
"mailUrl"
,
"title"
:
"mailUrl"
,
"id"
:
"mail
PwdRst
Url"
,
"title"
:
"mail
PwdRst
Url"
,
"data"
:
"http://auth.example.com/resetpwd"
},
{
"default"
:
"[A-Z]{3}[a-z]{5}.
\\
d{2}"
,
...
...
lemonldap-ng-manager/t/jsonfiles/12-modified.json
View file @
b486735d
...
...
@@ -1513,8 +1513,8 @@
"type"
:
"simpleInputContainer"
,
"nodes"
:
[{
"default"
:
"http://auth.example.com/resetpwd"
,
"id"
:
"mailUrl"
,
"title"
:
"mailUrl"
,
"id"
:
"mail
PwdRst
Url"
,
"title"
:
"mail
PwdRst
Url"
,
"data"
:
"http://auth.example.com/resetpwd"
},
{
"default"
:
"[A-Z]{3}[a-z]{5}.
\\
d{2}"
,
...
...
lemonldap-ng-manager/t/jsonfiles/14-bad.json
View file @
b486735d
...
...
@@ -1492,8 +1492,8 @@
"type"
:
"simpleInputContainer"
,
"nodes"
:
[{
"default"
:
"http://auth.example.com/resetpwd"
,
"id"
:
"mailUrl"
,
"title"
:
"mailUrl"
,
"id"
:
"mail
PwdRst
Url"
,
"title"
:
"mail
PwdRst
Url"
,
"data"
:
"http://auth.example.com/resetpwd"
},
{
"default"
:
"[A-Z]{3}[a-z]{5}.
\\
d{2}"
,
...
...
lemonldap-ng-manager/t/jsonfiles/15-combination.json
View file @
b486735d
...
...
@@ -2067,8 +2067,8 @@
{
"_nodes"
:
[{
"default"
:
"http://auth.example.com/resetpwd"
,
"id"
:
"mailUrl"
,
"title"
:
"mailUrl"
"id"
:
"mail
PwdRst
Url"
,
"title"
:
"mail
PwdRst
Url"
},
{
"default"
:
"[A-Z]{3}[a-z]{5}.
\\
d{2}"
,
...
...
lemonldap-ng-portal/MANIFEST
View file @
b486735d
...
...
@@ -102,7 +102,7 @@ lib/Lemonldap/NG/Portal/Plugins/CheckState.pm
lib/Lemonldap/NG/Portal/Plugins/ForceAuthn.pm
lib/Lemonldap/NG/Portal/Plugins/GrantSession.pm
lib/Lemonldap/NG/Portal/Plugins/History.pm
lib/Lemonldap/NG/Portal/Plugins/MailReset.pm
lib/Lemonldap/NG/Portal/Plugins/Mail
Password
Reset.pm
lib/Lemonldap/NG/Portal/Plugins/Notifications.pm
lib/Lemonldap/NG/Portal/Plugins/PublicPages.pm
lib/Lemonldap/NG/Portal/Plugins/Register.pm
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Plugins.pm
View file @
b486735d
...
...
@@ -2,7 +2,7 @@
# into "plugins" list in lemonldap-ng.ini, section "portal"
package
Lemonldap::NG::Portal::Main::
Plugins
;
our
$VERSION
=
'
2.0.
0
';
our
$VERSION
=
'
2.0.
2
';
package
Lemonldap::NG::Portal::
Main
;
...
...
@@ -13,7 +13,7 @@ use Mouse;
#
# Developers: 2FA must be loaded before Notifications
our
@pList
=
(
portalDisplayResetPassword
=>
'
::Plugins::MailReset
',
portalDisplayResetPassword
=>
'
::Plugins::Mail
Password
Reset
',
portalStatus
=>
'
::Plugins::Status
',
cda
=>
'
::Plugins::CDA
',
notification
=>
'
::Plugins::Notifications
',
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm
deleted
100644 → 0
View file @
86e88da4
package
Lemonldap::NG::Portal::Plugins::
MailReset
;
use
strict
;
use
Encode
;
use
Mouse
;
use
POSIX
qw(strftime)
;
use
Lemonldap::NG::Common::
FormEncode
;
use
Lemonldap::NG::Portal::Main::
Constants
qw(
PE_BADCREDENTIALS
PE_BADMAILTOKEN
PE_CAPTCHAEMPTY
PE_CAPTCHAERROR
PE_MAILCONFIRMATION_ALREADY_SENT
PE_MAILCONFIRMOK
PE_MAILERROR
PE_MAILFIRSTACCESS
PE_MAILFORMEMPTY
PE_MAILNOTFOUND
PE_MAILOK
PE_MALFORMEDUSER
PE_NOTOKEN
PE_OK
PE_PASSWORDFIRSTACCESS
PE_PASSWORDFORMEMPTY
PE_PASSWORD_MISMATCH
PE_PASSWORD_OK
PE_TOKENEXPIRED
PE_USERNOTFOUND
)
;
our
$VERSION
=
'
2.0.1
';
extends
'
Lemonldap::NG::Portal::Main::Plugin
',
'
Lemonldap::NG::Portal::Lib::SMTP
';
# PROPERTIES
# Mail timeout token generator
# Form timout token generator (used even if requireToken is not set)
has
ott
=>
(
is
=>
'
rw
',
lazy
=>
1
,
default
=>
sub
{
my
$ott
=
$_
[
0
]
->
{
p
}
->
loadModule
('
Lemonldap::NG::Portal::Lib::OneTimeToken
');
$ott
->
timeout
(
$_
[
0
]
->
conf
->
{
formTimeout
}
);
return
$ott
;
}
);
# Captcha generator
has
captcha
=>
(
is
=>
'
rw
'
);
# INITIALIZATION
sub
init
{
my
(
$self
)
=
@_
;
# Declare REST route
$self
->
addUnauthRoute
(
resetpwd
=>
'
resetPwd
',
[
'
POST
',
'
GET
'
]
);
# Initialize Captcha if needed
if
(
$self
->
conf
->
{
captcha_mail_enabled
}
)
{
$self
->
captcha
(
$self
->
p
->
loadModule
('
::Lib::Captcha
')
)
or
return
0
;
}
return
1
;
}
# RUNNIG METHODS
# Handle reset requests
sub
resetPwd
{
my
(
$self
,
$req
)
=
@_
;
$self
->
p
->
controlUrl
(
$req
);
# Check parameters
$req
->
error
(
$self
->
_reset
(
$req
)
);
# Display form
my
(
$tpl
,
$prms
)
=
$self
->
display
(
$req
);
return
$self
->
p
->
sendHtml
(
$req
,
$tpl
,
params
=>
$prms
);
}
sub
_reset
{
my
(
$self
,
$req
)
=
@_
;
my
(
$mailToken
,
$newPwd
,
$confirmPwd
,
%tplPrms
);
# PASSWORD CHANGE FORM => changePwd()
if
(
$req
->
method
=~
/^POST$/i
and
(
$req
->
param
('
newpassword
')
or
$req
->
param
('
confirmpassword
')
or
$req
->
param
('
reset
')
)
)
{
return
$self
->
changePwd
(
$req
);
}
# FIRST FORM
$mailToken
=
$req
->
data
->
{
mailToken
}
=
$req
->
param
('
mail_token
');
unless
(
$req
->
param
('
mail
')
||
$mailToken
)
{
$self
->
setSecurity
(
$req
);
return
PE_MAILFIRSTACCESS
if
(
$req
->
method
eq
'
GET
'
);
return
PE_MAILFORMEMPTY
;
}
my
$searchByMail
=
1
;
# OTHER FORMS
if
(
$mailToken
)
{
$self
->
logger
->
debug
(
"
Token given for password reset:
"
.
$mailToken
);
# Check if token is valid
my
$mailSession
=
$self
->
p
->
getApacheSession
(
$mailToken
);
unless
(
$mailSession
)
{
$self
->
userLogger
->
warn
('
Bad reset token
');
return
PE_BADMAILTOKEN
;
}
$req
->
{
user
}
=
$mailSession
->
data
->
{
user
};
$req
->
data
->
{
mailAddress
}
=
$mailSession
->
data
->
{
$self
->
conf
->
{
mailSessionKey
}
};
$self
->
logger
->
debug
(
'
User associated to:
'
.
$req
->
{
user
}
);
# Restore pdata if any
$req
->
pdata
(
$mailSession
->
data
->
{
_pdata
}
||
{}
);
$mailSession
->
remove
;
$searchByMail
=
0
unless
(
$req
->
{
user
}
=~
/\@/
);
}
# Check for values posted
else
{
# Use submitted value
$req
->
{
user
}
=
$req
->
param
('
mail
');
# Check if token exists
my
$token
;
if
(
$self
->
conf
->
{
requireToken
}
or
$self
->
captcha
)
{
$token
=
$req
->
param
('
token
');
unless
(
$token
)
{
$self
->
setSecurity
(
$req
);
$self
->
userLogger
->
warn
('
Reset try without token
');
return
PE_NOTOKEN
;
}
}
# Captcha for register form
if
(
$self
->
captcha
)
{
my
$captcha
=
$req
->
param
('
captcha
');
unless
(
$captcha
)
{
$self
->
userLogger
->
notice
('
Reset try with captcha not filled
');
# Set captcha or token
$self
->
setSecurity
(
$req
);
return
PE_CAPTCHAEMPTY
;
}
# Check captcha