Commit c0a9a726 authored by Christophe Maudoux's avatar Christophe Maudoux

WIP - Display form again when an error occures (#1508)

parent 8c468558
......@@ -166,7 +166,7 @@ sub _reset {
elsif ( $self->conf->{requireToken} ) {
unless ( $self->ott->getToken($token) ) {
$self->setSecurity($req);
$self->userLogger->warn('Reset try with expired/bas token');
$self->userLogger->warn('Reset try with expired/bad token');
return PE_TOKENEXPIRED;
}
}
......@@ -385,11 +385,12 @@ sub changePwd {
$self->userLogger->error('User tries to change password without token');
return PE_NOTOKEN;
}
unless ( delete $req->sessionInfo->{pwdAllowed} ) {
$self->userLogger->error(
'User tries to use another token to change a password');
return PE_NOTOKEN;
}
# unless ( delete $req->sessionInfo->{pwdAllowed} ) {
# $self->userLogger->error(
# 'User tries to use another token to change a password');
# return PE_NOTOKEN;
# }
# Check if user wants to generate the new password
if ( $req->param('reset') ) {
......@@ -490,7 +491,7 @@ sub display {
my ( $self, $req ) = @_;
$self->logger->debug( 'Display called with code: ' . $req->error );
my %tplPrm = (
SKIN_PATH => '/static',
SKIN_PATH => $self->conf->{staticPrefix},
SKIN => $self->p->getSkin($req),
SKIN_BG => $self->conf->{portalSkinBackground},
MAIN_LOGO => $self->conf->{portalMainLogo},
......@@ -573,6 +574,13 @@ sub display {
$tplPrm{DISPLAY_PASSWORD_FORM} = 1;
}
# Display password change form again if passwords mismatch
elsif ( $req->error == PE_PASSWORDFORMEMPTY )
{
$self->logger->debug('Display password form');
$tplPrm{DISPLAY_PASSWORD_FORM} = 1;
}
# Custom template parameters
if ( my $customParams = $self->p->customParameters ) {
foreach ( keys %$customParams ) {
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"اختر موفر الهوية الخاص بك",
"service":"Service",
"sendPwd":"أرسل لي كلمة مرور جديدة",
"sendPwd":"Send me a link",
"serverError":"يحدث خطأ في الخادم",
"serviceProvidedBy":"الخدمة المقدمة من قبل",
"sessionsDeleted":"الجلسات التالية تم غلقها",
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"Wähle deinen Identitätsanbieter aus",
"service":"Dienst",
"sendPwd":"Sende mir ein neues Passwort",
"sendPwd":"Send me a link",
"serverError":"Ein Fehler ist aufgetreten",
"serviceProvidedBy":"Dienst angeboten von",
"sessionsDeleted":"Die folgenden Sitzungen wurden geschlossen",
......
......@@ -200,7 +200,7 @@
"scope": "Scope",
"selectIdP":"Select your Identity Provider",
"service":"Service",
"sendPwd":"Send me a new password",
"sendPwd":"Send me a link",
"serverError":"Error occurs on the server",
"serviceProvidedBy":"Service provided by",
"sessionsDeleted":"The following sessions have been closed",
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"Select your Identity Provider",
"service":"Service",
"sendPwd":"Send me a new password",
"sendPwd":"Send me a link",
"serverError":"Error occurs on the server",
"serviceProvidedBy":"Service provided by",
"sessionsDeleted":"The following sessions have been closed",
......
......@@ -200,7 +200,7 @@
"scope": "Informations",
"selectIdP":"Choisissez votre fournisseur d'identité",
"service":"Service",
"sendPwd":"Envoyez-moi un nouveau mot de passe",
"sendPwd":"Envoyez-moi un lien",
"serverError":"Une erreur est survenue sur le serveur",
"serviceProvidedBy":"Ce service est fourni par",
"sessionsDeleted":"Les sessions suivantes ont été fermées",
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"Seleziona il tuo provider di identità",
"service":"Servizio",
"sendPwd":"Inviami una nuova password",
"sendPwd":"Send me a link",
"serverError":"Un, errore si verifica sul server",
"serviceProvidedBy":"Servizio offerto da",
"sessionsDeleted":"Le sessioni seguenti sono state chiuse",
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"Select your Identity Provider",
"service":"Service",
"sendPwd":"Send me a new password",
"sendPwd":"Send me a link",
"serverError":"Error occurs on the server",
"serviceProvidedBy":"Service provided by",
"sessionsDeleted":"The following sessions have been closed",
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"Select your Identity Provider",
"service":"Service",
"sendPwd":"Send me a new password",
"sendPwd":"Send me a link",
"serverError":"Error occurs on the server",
"serviceProvidedBy":"Service provided by",
"sessionsDeleted":"The following sessions have been closed",
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"Select your Identity Provider",
"service":"Service",
"sendPwd":"Send me a new password",
"sendPwd":"Send me a link",
"serverError":"Error occurs on the server",
"serviceProvidedBy":"Service provided by",
"sessionsDeleted":"The following sessions have been closed",
......
......@@ -200,7 +200,7 @@
"scope":"Scope",
"selectIdP":"Chọn bộ cung cấp danh tính của bạn",
"service":"Service",
"sendPwd":"Gửi cho tôi một mật khẩu mới",
"sendPwd":"Send me a link",
"serverError":"Lỗi xảy ra trên máy chủ",
"serviceProvidedBy":"Dịch vụ được cung cấp bởi",
"sessionsDeleted":"Các phiên làm việc sau đã được đóng lại",
......
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