Commit 44ee4a7b authored by Christophe Maudoux's avatar Christophe Maudoux

Merge branch 'v2.0'

parents a9971c7c c292c222
......@@ -121,9 +121,9 @@ sub defaultValues {
'macros' => {},
'mailCharset' => 'utf-8',
'mailFrom' => 'noreply@example.com',
'mailPwdRstTimeout' => 0,
'mailPwdRstUrl' => 'http://auth.example.com/resetpwd',
'mailSessionKey' => 'mail',
'mailTimeout' => 0,
'managerDn' => '',
'managerPassword' => '',
'max2FDevices' => 10,
......
......@@ -1585,6 +1585,10 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'mailPwdRstSubject' => {
'type' => 'text'
},
'mailPwdRstTimeout' => {
'default' => 0,
'type' => 'int'
},
'mailPwdRstUrl' => {
'default' => 'http://auth.example.com/resetpwd',
'type' => 'url'
......@@ -1596,10 +1600,6 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'default' => 'mail',
'type' => 'text'
},
'mailTimeout' => {
'default' => 0,
'type' => 'int'
},
'maintenance' => {
'default' => 0,
'type' => 'bool'
......
......@@ -1137,19 +1137,19 @@ sub attributes {
},
mailReplyTo =>
{ type => 'text', documentation => 'Reply-To address' },
mailTimeout => {
mailPwdRstTimeout => {
type => 'int',
default => 0,
documentation => 'Mail session timeout',
documentation => 'Mail password reset session timeout',
},
# Password reset
mailPwdRstBody =>
{ type => 'longtext', documentation => 'Custom mail body', },
{ type => 'longtext', documentation => 'Custom password reset mail body', },
mailPwdRstConfirmBody => {
type => 'longtext',
documentation => 'Custom confirm mail body',
documentation => 'Custom confirm password reset mail body',
},
mailPwdRstConfirmSubject => {
type => 'text',
......
......@@ -513,25 +513,7 @@ sub tree {
'soapSessionServer',
'soapConfigServer',
'exportedAttr',
{ title => 'SMTP',
nodes => [
'SMTPServer',
'SMTPPort',
'SMTPAuthUser',
'SMTPAuthPass',
'SMTPTLS',
'SMTPTLSOpts',
'mailSessionKey',
{ title => 'mailHeaders',
form => 'simpleInputContainer',
nodes => [
'mailFrom',
'mailReplyTo',
'mailCharset'
]
},
]
},
]
},
{ title => 'loginHistory',
......@@ -571,7 +553,7 @@ sub tree {
form => 'simpleInputContainer',
nodes => [
'mailPwdRstUrl',
'mailTimeout',
'mailPwdRstTimeout',
'randomPasswordRegexp',
]
}
......@@ -679,6 +661,26 @@ sub tree {
nodes => [
'customFunctions',
'multiValuesSeparator',
{ title => 'SMTP',
help => 'smtp.html',
nodes => [
'mailSessionKey',
'SMTPServer',
'SMTPPort',
'SMTPAuthUser',
'SMTPAuthPass',
'SMTPTLS',
'SMTPTLSOpts',
{ title => 'mailHeaders',
form => 'simpleInputContainer',
nodes => [
'mailFrom',
'mailReplyTo',
'mailCharset'
]
},
]
},
{ title => 'security',
help =>
'security.html#configure_security_settings',
......
......@@ -392,7 +392,7 @@
"mailReplyTo":"عنوان الجواب",
"mailSessionKey":"مفتاح الجلسة الذي يحتوي على عنوان البريد الإلكتروني",
"mailPwdRstSubject":"نجاح عنوان البريد",
"mailTimeout":"عدم تطابق كلمت المرور",
"mailPwdRstTimeout":"عدم تطابق كلمت المرور",
"mailPwdRstUrl":"Page URL",
"maintenance":"وضع الصيانة",
"malformedValue":"قيمة سيئة التصميم",
......
......@@ -392,7 +392,7 @@
"mailReplyTo":"Reply address",
"mailSessionKey":"Session key containing mail address",
"mailPwdRstSubject":"Success mail subject",
"mailTimeout":"Validity time of a password reset request",
"mailPwdRstTimeout":"Validity time of a password reset request",
"mailPwdRstUrl":"Page URL",
"maintenance":"Maintenance mode",
"malformedValue":"Malformed value",
......
......@@ -392,8 +392,8 @@
"mailReplyTo":"Reply address",
"mailSessionKey":"Session key containing mail address",
"mailPwdRstSubject":"Success mail subject",
"mailTimeout":"Validity time of a password reset request",
"mailPwdRstUrl":"Page URL",
"mailPwdRstTimeout":"Validity time of a password reset request",
"mailPwdRstUrl":"Reset page URL",
"maintenance":"Maintenance mode",
"malformedValue":"Malformed value",
"managerDn":"Account",
......@@ -635,7 +635,7 @@
"registerDB":"Register module",
"registerDoneSubject":"Subject for done mail",
"registerTimeout":"Validity time of a register request",
"registerUrl":"Page URL",
"registerUrl":"Register page URL",
"reloadParams":"Configuration reload",
"reloadTimeout":"Reload timeout",
"reloadUrls":"Reload URLs",
......
......@@ -383,7 +383,7 @@
"mailCharset":"Charset",
"mailPwdRstConfirmBody":"Contenu du message de confirmation",
"mailPwdRstConfirmSubject":"Sujet du message de confirmation",
"mailPwdRstContent":"Contenu du mail de réinitialisation du mot de passe",
"mailPwdRstContent":"Contenu du mail de réinitialisation",
"mailFrom":"Expéditeur du message",
"mailHeaders":"En-têtes du mail",
"mailLDAPFilter":"Filtre mail",
......@@ -392,8 +392,8 @@
"mailReplyTo":"Adresse de réponse",
"mailSessionKey":"Clef de session contenant l'adresse email",
"mailPwdRstSubject":"Sujet du message de succès",
"mailTimeout":"Durée de validité d'une demande de réinitialisation",
"mailPwdRstUrl":"URL de la page",
"mailPwdRstTimeout":"Durée de validité d'une requête de réinitialisation",
"mailPwdRstUrl":"URL de la page de réinitialisation",
"maintenance":"Mode maintenance",
"malformedValue":"Valeur mal formée",
"managerDn":"Compte de connexion LDAP",
......@@ -634,8 +634,8 @@
"registerConfirmSubject":"Sujet du mail de confirmation",
"registerDB":"Module d'auto-enregistrement",
"registerDoneSubject":"Sujet du mail de prise en compte",
"registerTimeout":"Durée de validité de la requête",
"registerUrl":"URL de la page",
"registerTimeout":"Durée de validité d'une requête de création",
"registerUrl":"URL de la page de création",
"reloadParams":"Mise à jour de la configuration",
"reloadTimeout":"Délai de mise à jour",
"reloadUrls":"URLs de mise à jour",
......
......@@ -392,7 +392,7 @@
"mailReplyTo":"Indirizzo di risposta",
"mailSessionKey":"Chiave di sessione contenente l'indirizzo di posta",
"mailPwdRstSubject":"Successo del soggetto della mail",
"mailTimeout":"Tempo di validità di una richiesta di ripristino della password",
"mailPwdRstTimeout":"Tempo di validità di una richiesta di ripristino della password",
"mailPwdRstUrl":"URL della pagina",
"maintenance":"Modalità di manutenzione",
"malformedValue":"Valore malformato",
......@@ -632,10 +632,10 @@
"regexps":"Espressioni regolari",
"register":"Registra nuovo account",
"registerConfirmSubject":"Oggetto per la mail di conferma",
"registerDB":"Modulo di autoregistrazione",
"registerDB":"Modulo di autoregidi registrazionestrazione",
"registerDoneSubject":"Oggetto per la mail inviata",
"registerTimeout":"Tempo di validità di una richiesta di registrazione",
"registerUrl":"URL della pagina",
"registerUrl":"URL della pagina di registrazione",
"reloadParams":"Ricarica di configurazione",
"reloadTimeout":"Ricarica il timeout",
"reloadUrls":"Ricarica gli URL",
......
......@@ -392,8 +392,8 @@
"mailReplyTo":"Địa chỉ trả lời",
"mailSessionKey":"Khóa phiên chứa địa chỉ thư",
"mailPwdRstSubject":"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",
"mailPwdRstUrl":"Page URL",
"mailPwdRstTimeout":"Thời hạn hợp lệ của yêu cầu đặt lại mật khẩu",
"mailPwdRstUrl":"Reset page URL",
"maintenance":"Chế độ bảo trì",
"malformedValue":"Giá trị không hợp lệ",
"managerDn":"Tài khoản",
......@@ -635,7 +635,7 @@
"registerDB":"Register module",
"registerDoneSubject":"Tiêu đề cho thư đã hoàn tất",
"registerTimeout":"Thời hạn hiệu lực của yêu cầu đăng ký",
"registerUrl":"Page URL",
"registerUrl":"Register page URL",
"reloadParams":"Configuration reload",
"reloadTimeout":"Reload timeout",
"reloadUrls":"Reload URLs",
......
......@@ -392,8 +392,8 @@
"mailReplyTo":"Reply address",
"mailSessionKey":"Session key containing mail address",
"mailPwdRstSubject":"Success mail subject",
"mailTimeout":"Validity time of a password reset request",
"mailPwdRstUrl":"Page URL",
"mailPwdRstTimeout":"Validity time of a password reset request",
"mailPwdRstUrl":"Reset page URL",
"maintenance":"Maintenance mode",
"malformedValue":"Malformed value",
"managerDn":"账户",
......@@ -635,7 +635,7 @@
"registerDB":"Register module",
"registerDoneSubject":"Subject for done mail",
"registerTimeout":"Validity time of a register request",
"registerUrl":"Page URL",
"registerUrl":"Register page URL",
"reloadParams":"Configuration reload",
"reloadTimeout":"Reload timeout",
"reloadUrls":"Reload URLs",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1338,8 +1338,8 @@
"title": "randomPasswordRegexp"
}, {
"default": 0,
"id": "mailTimeout",
"title": "mailTimeout",
"id": "mailPwdRstTimeout",
"title": "mailPwdRstTimeout",
"type": "int"
}, {
"default": "mail",
......
......@@ -1512,8 +1512,8 @@
"data": "[A-Z]{3}[a-z]{5}.\\d{2}"
}, {
"default": 0,
"id": "mailTimeout",
"title": "mailTimeout",
"id": "mailPwdRstTimeout",
"title": "mailPwdRstTimeout",
"type": "int",
"data": 0
}, {
......
......@@ -1523,8 +1523,8 @@
"data": "[A-Z]{3}[a-z]{5}.\\d{2}"
}, {
"default": 0,
"id": "mailTimeout",
"title": "mailTimeout",
"id": "mailPwdRstTimeout",
"title": "mailPwdRstTimeout",
"type": "int",
"data": 0
}, {
......
......@@ -1523,8 +1523,8 @@
"data": "[A-Z]{3}[a-z]{5}.\\d{2}"
}, {
"default": 0,
"id": "mailTimeout",
"title": "mailTimeout",
"id": "mailPwdRstTimeout",
"title": "mailPwdRstTimeout",
"type": "int",
"data": 0
}, {
......
......@@ -1502,8 +1502,8 @@
"data": "[A-Z]{3}[a-z]{5}.\\d{2}"
}, {
"default": 0,
"id": "mailTimeout",
"title": "mailTimeout",
"id": "mailPwdRstTimeout",
"title": "mailPwdRstTimeout",
"type": "int",
"data": 0
}, {
......
......@@ -2077,8 +2077,8 @@
},
{
"default": 0,
"id": "mailTimeout",
"title": "mailTimeout",
"id": "mailPwdRstTimeout",
"title": "mailPwdRstTimeout",
"type": "int"
},
{
......
......@@ -203,9 +203,9 @@ sub _reset {
return PE_MAILNOTFOUND;
}
my $mailTimeout
= $self->conf->{mailTimeout} || $self->conf->{timeout};
my $expTimestamp = time() + $mailTimeout;
my $mailPwdRstTimeout
= $self->conf->{mailPwdRstTimeout} || $self->conf->{timeout};
my $expTimestamp = time() + $mailPwdRstTimeout;
$req->data->{expMailDate}
= strftime( "%d/%m/%Y", localtime $expTimestamp );
$req->data->{expMailTime}
......@@ -227,12 +227,12 @@ sub _reset {
# Use default session timeout and mail session timeout to compute it
my $time = time();
my $timeout = $self->conf->{timeout};
my $mailTimeout = $self->conf->{mailTimeout} || $timeout;
my $mailPwdRstTimeout = $self->conf->{mailPwdRstTimeout} || $timeout;
$infos->{_utime} = $time + ( $mailTimeout - $timeout );
$infos->{_utime} = $time + ( $mailPwdRstTimeout - $timeout );
# Store expiration timestamp for further use
$infos->{mailSessionTimeoutTimestamp} = $time + $mailTimeout;
$infos->{mailSessionTimeoutTimestamp} = $time + $mailPwdRstTimeout;
# Store start timestamp for further use
$infos->{mailSessionStartTimestamp} = $time;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment