mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-10 05:29:13 -04:00
Consolidate all the random code into a random helper that offers:
random::hash() random::string() random::percent() random::int() So that we don't have lots of different ways to get random values all over the code. Follow-on to #1527.
This commit is contained in:
@@ -51,7 +51,7 @@ class Password_Controller extends Controller {
|
||||
$user_name = $form->reset->inputs["name"]->value;
|
||||
$user = user::lookup_by_name($user_name);
|
||||
if ($user && !empty($user->email)) {
|
||||
$user->hash = md5(uniqid(mt_rand(), true));
|
||||
$user->hash = random::hash();
|
||||
$user->save();
|
||||
$message = new View("reset_password.html");
|
||||
$message->confirm_url = url::abs_site("password/do_reset?key=$user->hash");
|
||||
|
||||
Reference in New Issue
Block a user