BUGFIX: fix password for password recovery (was not random enough)
[e-DoKo.git] / include / user.php
index 19b95440e32edfb4cb2f1e65c49d123873b34b63..f58293e888c63dda174ac90cb6f4d73b2aa8651b 100644 (file)
@@ -67,7 +67,8 @@ if(myisset('forgot'))
 
            /* create temporary password, use the fist 8 letters of a md5 hash */
            $TIME  = (string) time(); /* to avoid collisions */
-           $hash  = md5('Anewpassword'.$email.$TIME);
+           $rndstring = sha1(rand()); /* add some randomness */
+           $hash  = md5('Anewpassword'.$email.$TIME.$rndstring);
            $newpw = substr($hash,1,8);
 
            $message = sprintf( _("Someone (hopefully you) requested a new password.\n".