Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit cb8d826

Browse files
committed
BUG: refs #226. Don't send our password prefix with a password reset email
1 parent 1fc0272 commit cb8d826

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/controllers/UserController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,26 @@ function make_seed_recoverpass()
9393

9494
$pass = "";
9595
$max = strlen($keychars) - 1;
96-
for($i = 0;$i <= $length;$i++)
96+
for($i = 0; $i <= $length; $i++)
9797
{
9898
$pass .= substr($keychars, rand(0, $max), 1);
9999
}
100100
$encrypted = md5($pass);
101101

102102
$passwordPrefix = Zend_Registry::get('configGlobal')->password->prefix;
103+
$salted = $pass;
103104
if(isset($passwordPrefix) && !empty($passwordPrefix))
104105
{
105-
$pass = $passwordPrefix.$pass;
106+
$salted = $passwordPrefix.$pass;
106107
}
107108

108-
$user->setPassword(md5($pass));
109+
$user->setPassword(md5($salted));
109110

110111
// Send the email
111112
$url = $this->getServerURL().$this->view->webroot;
112113

113114
$text = "Hello,<br><br> You have asked for a new password for MIDAS.<br>";
114-
$text .= "Please go to this page to login into MIDAS and change your password:<br>";
115+
$text .= "Please go to this page to log in to MIDAS and change your password:<br>";
115116
$text .= "<a href=\"".$url."\">".$url."</a><br>";
116117
$text .= "Your new password is: ".$pass."<br>";
117118
$text .= "<br><br>Generated by MIDAS";

0 commit comments

Comments
 (0)