diff --git a/op/op.ChangePassword.php b/op/op.ChangePassword.php index 7f9c21f07..ef5d8167a 100644 --- a/op/op.ChangePassword.php +++ b/op/op.ChangePassword.php @@ -48,17 +48,18 @@ if (isset($_POST["newpasswordrepeat"])) { } if (empty($newpassword) || empty($newpasswordrepeat) || $newpassword != $newpasswordrepeat) { - _printMessage(getMLText("password_mismatch_error_title"), "

".getMLText("password_mismatch_error")."

\n"); - exit; + UI::exitError(getMLText("password_mismatch_error_title"),getMLText("password_mismatch_error")); } $user = $dms->checkPasswordRequest($hash); if($user) { $user->setPwd(md5($newpassword)); $dms->deletePasswordRequest($hash); + header('Location: ../out/out.Login.php'); + exit; } -_printMessage(getMLText("change_password"), "

".getMLText("change_password_message")."

"); -exit; +UI::exitError(getMLText("password_mismatch_error_title"),getMLText("password_mismatch_error")); + ?> diff --git a/op/op.PasswordForgotten.php b/op/op.PasswordForgotten.php index cf7538964..8fa646349 100644 --- a/op/op.PasswordForgotten.php +++ b/op/op.PasswordForgotten.php @@ -19,7 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. include("../inc/inc.Settings.php"); -include("../inc/inc.LogInit.php"); +include("../inc/inc.LogInit.php"); include("../inc/inc.Utils.php"); include("../inc/inc.Language.php"); include("../inc/inc.ClassSession.php"); @@ -27,6 +27,8 @@ include("../inc/inc.DBInit.php"); include("../inc/inc.ClassUI.php"); include("../inc/inc.ClassEmail.php"); +include $settings->_rootDir . "languages/" . $settings->_language . "/lang.inc"; + function _printMessage($heading, $message) { UI::htmlStartPage($heading, "password"); @@ -45,21 +47,21 @@ if (isset($_POST["login"])) { } if (empty($email) || empty($login)) { - _printMessage(getMLText("email_error_title"), "

".getMLText("email_not_given")."

\n". - "

".getMLText("back")."

\n"); + header('Location: ../out/out.PasswordForgotten.php'); exit; } $user = $dms->getUserByLogin($login, $email); if($user) { - $hash = $dms->createPasswordRequest($user); - $emailobj = new LetoDMS_Email(); - $subject = "###SITENAME###: ".getMLText("password_forgotten_email_subject"); - $message = str_replace('###HASH###', $hash, getMLText("password_forgotten_email_body")); - - $emailobj->sendPassword('', $user, $subject, $message); + if($hash = $dms->createPasswordRequest($user)) { + $emailobj = new LetoDMS_Email(); + $subject = "###SITENAME###: ".getMLText("password_forgotten_email_subject"); + $message = str_replace('###HASH###', $hash, getMLText("password_forgotten_email_body")); + + $emailobj->sendPassword('', $user, $subject, $message); + } } -_printMessage(getMLText("password_forgotten_title"), "

".getMLText("password_forgotten_send_hash")."

"); +header('Location: ../out/out.Login.php'); exit; ?>