diff --git a/TODO-2.0.md b/TODO-2.0.md index 2f40e72ce..4665a793e 100644 --- a/TODO-2.0.md +++ b/TODO-2.0.md @@ -2,7 +2,6 @@ * write REST method to create session with an id * remove cache on handler init() * public\_page -* Uniq session plugins * Test ForceAuth * Calendar in notifications explorer * login history diff --git a/lemonldap-ng-portal/MANIFEST b/lemonldap-ng-portal/MANIFEST index b6a7251a6..53c58605e 100644 --- a/lemonldap-ng-portal/MANIFEST +++ b/lemonldap-ng-portal/MANIFEST @@ -49,6 +49,7 @@ lib/Lemonldap/NG/Portal/Lib/OneTimeToken.pm lib/Lemonldap/NG/Portal/Lib/OpenID/Server.pm lib/Lemonldap/NG/Portal/Lib/OpenID/SREG.pm lib/Lemonldap/NG/Portal/Lib/OpenIDConnect.pm +lib/Lemonldap/NG/Portal/Lib/OtherSessions.pm lib/Lemonldap/NG/Portal/Lib/Remote.pm lib/Lemonldap/NG/Portal/Lib/RESTProxy.pm lib/Lemonldap/NG/Portal/Lib/SAML.pm @@ -75,10 +76,13 @@ lib/Lemonldap/NG/Portal/Password/Demo.pm lib/Lemonldap/NG/Portal/Password/LDAP.pm lib/Lemonldap/NG/Portal/Plugins/CDA.pm lib/Lemonldap/NG/Portal/Plugins/ForceAuth.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/Notifications.pm lib/Lemonldap/NG/Portal/Plugins/Register.pm lib/Lemonldap/NG/Portal/Plugins/RESTServer.pm +lib/Lemonldap/NG/Portal/Plugins/SingleSession.pm lib/Lemonldap/NG/Portal/Plugins/SOAPServer.pm lib/Lemonldap/NG/Portal/Plugins/Status.pm lib/Lemonldap/NG/Portal/Plugins/U2F.pm @@ -275,6 +279,8 @@ site/templates/bootstrap/yubikeyform.tpl site/templates/common/background.tpl site/templates/common/bullet_go.png site/templates/common/key.png +site/templates/common/mail/en.json +site/templates/common/mail/fr.json site/templates/common/mail_confirm.tpl site/templates/common/mail_footer.tpl site/templates/common/mail_header.tpl @@ -396,6 +402,8 @@ t/43-MailReset-with-token.t t/43-MailReset.t t/50-IssuerGet.t t/60-status.t +t/61-grantSession.t +t/62-singleSession.t t/90-translations.t t/99-pod.t t/lmConf-1.js diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm index 04c30daa9..688ff7d19 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/SMTP.pm @@ -7,6 +7,7 @@ package Lemonldap::NG::Portal::Lib::SMTP; use strict; use Mouse; +use JSON qw(from_json); use String::Random; use MIME::Lite; use MIME::Base64; @@ -27,6 +28,24 @@ has charset => ( default => sub { return $_[0]->{conf}->{mailCharset} || 'utf-8' } ); +sub translate { + my ( $self, $req ) = @_; + + # Get language using llnglanguage cookie + my $lang = $req->cookies->{llnglanguage} || 'en'; + my $json = $self->conf->{templateDir} . "/common/mail/$lang.json"; + $json = $self->conf->{templateDir} . '/common/mail/en.json' + unless ( -f $json ); + open F, $json or die $!; + $json = join '', ; + close F; + $lang = from_json($json); + return sub { + ($_) = @_; + $$_ =~ s/\s+trspan="(\w+?)"(.*?)>.*?".($lang->{$1}||$1).'<'/gse; + }; +} + # Generate a complex password based on a regular expression # @param regexp regular expression sub gen_password { diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm index 4afad605b..5228493b9 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/MailReset.pm @@ -2,6 +2,7 @@ package Lemonldap::NG::Portal::Plugins::MailReset; use strict; use Encode; +use HTML::Template; use Mouse; use POSIX qw(strftime); use Lemonldap::NG::Portal::Main::Constants qw( @@ -306,7 +307,10 @@ sub _reset { . '/mail_confirm.tpl'; $tplfile = $self->conf->{templateDir} . '/common/mail_confirm.tpl' unless ( -e $tplfile ); - my $template = HTML::Template->new( filename => $tplfile, ); + my $template = HTML::Template->new( + filename => $tplfile, + filter => $self->translate($req), + ); $body = $template->output(); $html = 1; } @@ -428,7 +432,10 @@ sub changePwd { . '/mail_password.tpl'; $tplfile = $self->conf->{templateDir} . '/common/mail_password.tpl' unless ( -e $tplfile ); - my $template = HTML::Template->new( filename => $tplfile, ); + my $template = HTML::Template->new( + filename => $tplfile, + filter => $self->translate($req), + ); $body = $template->output(); $html = 1; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Register.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Register.pm index 2e468fccb..b0571c70a 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Register.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/Register.pm @@ -2,6 +2,7 @@ package Lemonldap::NG::Portal::Plugins::Register; use strict; use Encode; +use HTML::Template; use Mouse; use POSIX qw(strftime); use Lemonldap::NG::Portal::Main::Constants qw( @@ -191,7 +192,8 @@ sub _register { elsif ( $self->ott ) { unless ( $self->ott->getToken($token) ) { $self->setSecurity($req); - $self->userLogger->notice('Register try with expired/bad token'); + $self->userLogger->notice( + 'Register try with expired/bad token'); return PE_TOKENEXPIRED; } } @@ -296,7 +298,10 @@ sub _register { $tplfile = $self->conf->{templateDir} . '/common/mail_register_confirm.tpl' unless ( -e $tplfile ); - my $template = HTML::Template->new( filename => $tplfile, ); + my $template = HTML::Template->new( + filename => $tplfile, + filter => $self->translate($req), + ); $body = $template->output(); # Replace variables in body @@ -351,7 +356,10 @@ sub _register { . "/mail_register_done.tpl"; $tplfile = $self->conf->{templateDir} . "/common/mail_register_done.tpl" unless ( -e $tplfile ); - my $template = HTML::Template->new( filename => $tplfile, ); + my $template = HTML::Template->new( + filename => $tplfile, + filter => $self->translate($req), + ); $body = $template->output(); # Replace variables in body diff --git a/lemonldap-ng-portal/site/coffee/portal.coffee b/lemonldap-ng-portal/site/coffee/portal.coffee index 2e565acaf..518c7bca4 100644 --- a/lemonldap-ng-portal/site/coffee/portal.coffee +++ b/lemonldap-ng-portal/site/coffee/portal.coffee @@ -219,6 +219,7 @@ $(document).ready -> lang = if langs[0] then langs[0] else if langs2[0] then langs2[0] else 'en' else lang = 'en' + setCookie 'llnglanguage', lang translatePage(lang) # Build language icons diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js index 585d4f4fd..1438eec40 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.js @@ -231,6 +231,7 @@ LemonLDAP::NG Portal jQuery scripts lang = 'en'; } } + setCookie('llnglanguage', lang); translatePage(lang); langdiv = ''; ref1 = window.availableLanguages; diff --git a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js index 8c1c2c26b..e4121da4e 100644 --- a/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js +++ b/lemonldap-ng-portal/site/htdocs/static/common/js/portal.min.js @@ -1 +1 @@ -(function(){var e,g,j,d,a,k,i,m,f,b,l,c,h=[].indexOf||function(p){for(var o=0,n=this.length;o=0){A=y[n];o=$(f+".ui-sortable").children("#"+A);u=$(f+".ui-sortable").children("#"+n);o.remove();$(f+".ui-sortable").filter(":first").append(u)}}return 1};a=function(n){return $("#lmhidden_"+n).length};k=function(){return $.ajax({type:"POST",url:e.scriptname,data:{ping:1},dataType:"json",success:function(n){if(n.auth){return setTimeout(k,e.pingInterval)}else{return location.reload(true)}}})};window.ping=k;g=function(q){var t,o,r,n,p,s;p=q+"=";o=decodeURIComponent(document.cookie).split(";");s=new RegExp("^ *"+q+"=");for(r=0,n=o.length;r div.category",update:function(){return j()}});i();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-(new Date().getTimezoneOffset()/60));q=$("#menu").tabs({active:0});z=$('#menu a[href="#'+e.displaytab+'"]').parent().index();if(z<0){z=0}q.tabs("option","active",z);F=$("#authMenu").tabs({active:0});if(e.choicetab){F.tabs("option","active",$('#authMenu a[href="#'+e.choicetab+'"]').parent().index())}if(e.login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(e.newwindow){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){D=$("form.login").attr("action");p=$("form.login").attr("method");B="";if(D.indexOf("?")!==-1){D.substring(0,D.indexOf("?"))+"?"}else{B=D+"?"}$("form.login input[type=hidden]").each(function(J){return B+="&"+$(this).attr("name")+"="+$(this).val()});s=$("p.removeOther a").attr("href")+"&method="+p+"&url="+btoa(B);$("p.removeOther a").attr("href",s)}I=g("llnglanguage");if(!I){if(navigator){x=[];w=[];n=[navigator.language];if(navigator.languages){n=navigator.languages}r=window.availableLanguages;for(G=0,H=r.length;G ';for(E=0,u=n.length;E '}$("#languages").html(y);$(".langicon").on("click",function(){I=$(this).attr("title");m("llnglanguage",I);return l(I)});if(e.pingInterval&&e.pingInterval>0){window.setTimeout(k,e.pingInterval)}return $(".localeDate").each(function(){var J;J=new Date($(this).attr("val")*1000);return $(this).text(J.toLocaleString())})})}).call(this); \ No newline at end of file +(function(){var e,g,j,d,a,k,i,m,f,b,l,c,h=[].indexOf||function(p){for(var o=0,n=this.length;o=0){A=y[n];o=$(f+".ui-sortable").children("#"+A);u=$(f+".ui-sortable").children("#"+n);o.remove();$(f+".ui-sortable").filter(":first").append(u)}}return 1};a=function(n){return $("#lmhidden_"+n).length};k=function(){return $.ajax({type:"POST",url:e.scriptname,data:{ping:1},dataType:"json",success:function(n){if(n.auth){return setTimeout(k,e.pingInterval)}else{return location.reload(true)}}})};window.ping=k;g=function(q){var t,o,r,n,p,s;p=q+"=";o=decodeURIComponent(document.cookie).split(";");s=new RegExp("^ *"+q+"=");for(r=0,n=o.length;r div.category",update:function(){return j()}});i();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-(new Date().getTimezoneOffset()/60));q=$("#menu").tabs({active:0});z=$('#menu a[href="#'+e.displaytab+'"]').parent().index();if(z<0){z=0}q.tabs("option","active",z);F=$("#authMenu").tabs({active:0});if(e.choicetab){F.tabs("option","active",$('#authMenu a[href="#'+e.choicetab+'"]').parent().index())}if(e.login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(e.newwindow){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){D=$("form.login").attr("action");p=$("form.login").attr("method");B="";if(D.indexOf("?")!==-1){D.substring(0,D.indexOf("?"))+"?"}else{B=D+"?"}$("form.login input[type=hidden]").each(function(J){return B+="&"+$(this).attr("name")+"="+$(this).val()});s=$("p.removeOther a").attr("href")+"&method="+p+"&url="+btoa(B);$("p.removeOther a").attr("href",s)}I=g("llnglanguage");if(!I){if(navigator){x=[];w=[];n=[navigator.language];if(navigator.languages){n=navigator.languages}r=window.availableLanguages;for(G=0,H=r.length;G ';for(E=0,u=n.length;E '}$("#languages").html(y);$(".langicon").on("click",function(){I=$(this).attr("title");m("llnglanguage",I);return l(I)});if(e.pingInterval&&e.pingInterval>0){window.setTimeout(k,e.pingInterval)}return $(".localeDate").each(function(){var J;J=new Date($(this).attr("val")*1000);return $(this).text(J.toLocaleString())})})}).call(this); \ No newline at end of file diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/en.json b/lemonldap-ng-portal/site/htdocs/static/languages/en.json index 7bbc5c6ca..f3b02633a 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/en.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/en.json @@ -98,7 +98,6 @@ "authPortal":"Authentication portal", "authRemaining":"%s authentications remaining, change your password!", "autoAccept":"Automatically accept in 5 seconds", -"autoMail":"This mail was sent automatically", "back2CasUrl":"The application you just logged out of has provided a link it would like you to follow", "back2Portal":"Go back to portal", "cancel":"Cancel", @@ -106,8 +105,6 @@ "changePwd":"Change your password", "checkLastLogins":"Check my last logins", "chooseApp":"Choose an application your are allowed to access to", -"click2Register":"Click here to confirm your account registration", -"click2Reset":"Click here to reset your password", "clickHere":"Please click here", "closeSSO":"Close your SSO session", "confirmation":"Confirmation", @@ -129,7 +126,6 @@ "gotNewMessages":"You have some new messages", "goToPortal":"Go to portal", "gplSoft":"free software covered by the GPL license", -"hello":"Hello", "imSure":"I'm sure", "info":"Information", "ipAddr":"IP address", @@ -147,7 +143,6 @@ "maintenanceMode":"This application is in maintenance, please try to connect later", "newMessages":"New message(s)", "newPassword":"New password", -"newPwdIs":"Your new password is", "newPwdSentTo":"A confirmation has been sent to your mail address.", "oidcConsent":"The application %s would like to know:", "openidAp":"Do you agree to provide the following parameters?", @@ -160,9 +155,7 @@ "otherSessions":"Other active sessions", "password": "Password", "ppGrace": "authentications remaining, change your password!", -"pwdChanged":"Your password was changed.", "pwdChange":"Password change", -"pwdIs":"Your password is", "pwd":"Password", "pwdResetAlreadyIssued":"A password reset request was already issued on ", "pwdWillExpire":"%s days, %s hours, %s minutes and %s seconds before password expiration, change it!", @@ -175,7 +168,6 @@ "registerRequestAlreadyIssued":"A register request for this account was already issued on ", "rememberChoice":"Remember my choice", "removeOtherSessions":"Remove other sessions", -"requestIssuedFromIP":"The request was issued from IP", "resendConfirmMail":"Resend confirmation mail?", "resentConfirm":"Do you want the confirmation mail to be resent?", "resetPwd":"Reset my password", @@ -205,7 +197,6 @@ "yourEmail":"Your email", "yourIdentity":"Your identity", "yourIdentityIs":"Your identity is", -"yourLoginIs":"Your login is", "yourPhone":"Your phone number", "yourProfile":"Your profile" } diff --git a/lemonldap-ng-portal/site/htdocs/static/languages/fr.json b/lemonldap-ng-portal/site/htdocs/static/languages/fr.json index 3908aebee..237a6125e 100644 --- a/lemonldap-ng-portal/site/htdocs/static/languages/fr.json +++ b/lemonldap-ng-portal/site/htdocs/static/languages/fr.json @@ -98,7 +98,6 @@ "authPortal":"Portail d'authentification", "authRemaining":"%s authentifications restantes, changez votre mot de passe !", "autoAccept":"Acceptation automatique dans 5 secondes", -"autoMail":"Ceci est un message automatique", "back2CasUrl":"Le service duquel vous arrivez a fourni un lien que vous êtes invité à suivre", "back2Portal":"Retourner au portail", "cancel":"Annuler", @@ -106,8 +105,6 @@ "changePwd":"Changez votre mot de passe", "checkLastLogins":"Voir mes dernières connexions", "chooseApp":"Choisissez une application à laquelle vous êtes autorisé à accéder", -"click2Register":"Cliquez ici pour confirmer l'enregistrement de votre compte", -"click2Reset":"Cliquez ici pour réinitialiser votre mot de passe", "clickHere":"Cliquez ici", "closeSSO":"Fermer votre Session SSO", "confirmation":"Confirmation", @@ -129,7 +126,6 @@ "gotNewMessages":"Vous avez de nouveaux messages", "goToPortal":"Aller au portail", "gplSoft":"logiciel libre protégé par la licence GPL", -"hello":"Bonjour", "imSure":"Je suis sûr", "info":"Information", "ipAddr":"Adresse IP", @@ -147,7 +143,6 @@ "maintenanceMode":"Cette application est en maintenance, merci de réessayer plus tard", "newMessages":"Nouveaux messages", "newPassword":"Nouveau mot de passe", -"newPwdIs":"Votre nouveau mot de passe est", "newPwdSentTo":"Une confirmation a été envoyée à votre adresse mail.", "oidcConsent":"L'application %s voudrait connaître :", "openidAp":"Consentez-vous à communiquer les paramètres suivants ?", @@ -161,8 +156,6 @@ "password": "Mot-de-passe", "ppGrace": "authentifications restantes, changez votre mot de passe !", "pwdChange":"Changement de mot de passe", -"pwdChanged":"Votre mot de passe a été changé.", -"pwdIs":"Votre mot de passe est", "pwd":"Mot de passe", "pwdResetAlreadyIssued":"Une demande de réinitialisation de mot de passe a déjà été faite le ", "pwdWillExpire":"%s jours, %s heures, %s minutes et %s secondes avant expiration de votre mot de passe, pensez à le changer !", @@ -175,7 +168,6 @@ "registerRequestAlreadyIssued":"Une demande de création pour ce compte a déjà été faite le ", "rememberChoice":"Se souvenir de mon choix", "removeOtherSessions":"Fermer les autres sessions", -"requestIssuedFromIP":"La demande provient de l'IP", "resendConfirmMail":"Renvoyer le mail de confirmation ?", "resentConfirm":"Voulez-vous que le message de confirmation soit renvoyé ?", "resetPwd":"Réinitialiser mon mot de passe", @@ -205,7 +197,6 @@ "yourEmail":"Votre adresse électronique", "yourIdentity":"Votre identité", "yourIdentityIs":"Votre identité est ", -"yourLoginIs":"Votre identifiant est", "yourPhone":"Votre numéro de téléphone", "yourProfile":"Vos informations personnelles" } diff --git a/lemonldap-ng-portal/site/templates/common/mail/en.json b/lemonldap-ng-portal/site/templates/common/mail/en.json new file mode 100644 index 000000000..7d4a54fbc --- /dev/null +++ b/lemonldap-ng-portal/site/templates/common/mail/en.json @@ -0,0 +1,12 @@ +{ +"accountCreated":"Your account has been created, your temporary password has been sent to your mail address.", +"autoMail":"This mail was sent automatically", +"click2Register":"Click here to confirm your account registration", +"click2Reset":"Click here to reset your password", +"hello":"Hello", +"newPwdIs":"Your new password is", +"pwdChanged":"Your password was changed.", +"pwdIs":"Your password is", +"requestIssuedFromIP":"The request was issued from IP", +"yourLoginIs":"Your login is" +} diff --git a/lemonldap-ng-portal/site/templates/common/mail/fr.json b/lemonldap-ng-portal/site/templates/common/mail/fr.json new file mode 100644 index 000000000..340dfee91 --- /dev/null +++ b/lemonldap-ng-portal/site/templates/common/mail/fr.json @@ -0,0 +1,12 @@ +{ +"accountCreated":"Votre compte a été créé, un mot de passe temporaire a été envoyé à votre adresse mail.", +"autoMail":"Ceci est un message automatique", +"click2Register":"Cliquez ici pour confirmer l'enregistrement de votre compte", +"click2Reset":"Cliquez ici pour réinitialiser votre mot de passe", +"hello":"Bonjour", +"newPwdIs":"Votre nouveau mot de passe est", +"pwdChanged":"Votre mot de passe a été changé.", +"pwdIs":"Votre mot de passe est", +"requestIssuedFromIP":"La demande provient de l'IP", +"yourLoginIs":"Votre identifiant est" +} diff --git a/lemonldap-ng-portal/t/42-Register-Demo-with-captcha.t b/lemonldap-ng-portal/t/42-Register-Demo-with-captcha.t index 4d1c692c8..f81a92d38 100644 --- a/lemonldap-ng-portal/t/42-Register-Demo-with-captcha.t +++ b/lemonldap-ng-portal/t/42-Register-Demo-with-captcha.t @@ -122,7 +122,7 @@ sub MIME::Lite::send { $mailSend = 2; ok( $mail->body_as_string =~ - m#yourLoginIs.+?(\w+).*?pwdIs.+?(.*?)#s, + m#Your login is.+?(\w+).*?Your password is.+?(.*?)#s, 'Get login/pwd' ); ( $user, $pwd ) = ( $1, $2 ); diff --git a/lemonldap-ng-portal/t/42-Register-Demo-with-token.t b/lemonldap-ng-portal/t/42-Register-Demo-with-token.t index 884c9eec7..d9a4743fe 100644 --- a/lemonldap-ng-portal/t/42-Register-Demo-with-token.t +++ b/lemonldap-ng-portal/t/42-Register-Demo-with-token.t @@ -114,7 +114,7 @@ sub MIME::Lite::send { $mailSend = 2; ok( $mail->body_as_string =~ - m#yourLoginIs.+?(\w+).*?pwdIs.+?(.*?)#s, + m#Your login is.+?(\w+).*?Your password is.+?(.*?)#s, 'Get login/pwd' ); ( $user, $pwd ) = ( $1, $2 ); diff --git a/lemonldap-ng-portal/t/42-Register-Demo.t b/lemonldap-ng-portal/t/42-Register-Demo.t index 22a868170..032c10620 100644 --- a/lemonldap-ng-portal/t/42-Register-Demo.t +++ b/lemonldap-ng-portal/t/42-Register-Demo.t @@ -101,7 +101,7 @@ sub MIME::Lite::send { $mailSend = 2; ok( $mail->body_as_string =~ - m#yourLoginIs.+?(\w+).*?pwdIs.+?(.*?)#s, + m#Your login is.+?(\w+).*?Your password is.+?(.*?)#s, 'Get login/pwd' ); ( $user, $pwd ) = ( $1, $2 ); diff --git a/lemonldap-ng-portal/t/43-MailReset-with-captcha.t b/lemonldap-ng-portal/t/43-MailReset-with-captcha.t index 1144060ce..a721fd8bf 100644 --- a/lemonldap-ng-portal/t/43-MailReset-with-captcha.t +++ b/lemonldap-ng-portal/t/43-MailReset-with-captcha.t @@ -116,7 +116,7 @@ sub MIME::Lite::send { } else { $mailSend = 2; - ok( $mail->body_as_string =~ /pwdChanged/, ' Password was changed' ); + ok( $mail->body_as_string =~ /Your password was changed/, ' Password was changed' ); count(1); } pass('----- Mail sent -----'); diff --git a/lemonldap-ng-portal/t/43-MailReset-with-token.t b/lemonldap-ng-portal/t/43-MailReset-with-token.t index a611f5867..d8a511024 100644 --- a/lemonldap-ng-portal/t/43-MailReset-with-token.t +++ b/lemonldap-ng-portal/t/43-MailReset-with-token.t @@ -98,7 +98,7 @@ sub MIME::Lite::send { } else { $mailSend = 2; - ok( $mail->body_as_string =~ /pwdChanged/, ' Password was changed' ); + ok( $mail->body_as_string =~ /Your password was changed/, ' Password was changed' ); ( $user, $pwd ) = ( $1, $2 ); count(1); } diff --git a/lemonldap-ng-portal/t/43-MailReset.t b/lemonldap-ng-portal/t/43-MailReset.t index 3b8948854..37ebe567e 100644 --- a/lemonldap-ng-portal/t/43-MailReset.t +++ b/lemonldap-ng-portal/t/43-MailReset.t @@ -96,7 +96,7 @@ sub MIME::Lite::send { } else { $mailSend = 2; - ok( $mail->body_as_string =~ /pwdChanged/, ' Password was changed' ); + ok( $mail->body_as_string =~ /Your password was changed/, ' Password was changed' ); ( $user, $pwd ) = ( $1, $2 ); count(1); } diff --git a/lemonldap-ng-portal/t/90-translations.t b/lemonldap-ng-portal/t/90-translations.t index 3743e8c5a..fe9e4c1ee 100644 --- a/lemonldap-ng-portal/t/90-translations.t +++ b/lemonldap-ng-portal/t/90-translations.t @@ -66,7 +66,7 @@ my @unTr = (); find( sub { my $f = $File::Find::name; - return unless ( $_ =~ /tpl$/ and -f $_ ); + return unless ( $_ =~ /tpl$/ and -f $_ and $_ !~ m#mail_# ); open F, $_; while ( my $l = ) { push @trspan, ( $l =~ /trspan="(\w+)"/g );