Typos in API code fixed
This commit is contained in:
@@ -15,16 +15,16 @@ $API_resetpassword = new API_resetpassword();
|
||||
if ($API_resetpassword->request_method === 'GET') {
|
||||
|
||||
} elseif ($API_resetpassword->request_method === 'POST') {
|
||||
# Reset a users password and send a email to the user to set a new password
|
||||
# Reset a users password and send a mail to the user to set a new password
|
||||
|
||||
$API_resetpassword->checkPermissions('admin-access-admins-resetpassword', 'RW');
|
||||
|
||||
# The user will need to verify their email, the password field cannot be NULL so set an random password for now till the user resets it on when verifing there email
|
||||
# The user will need to verify their email, the password field cannot be NULL so set a random password for now till the user resets it on when verifying there email
|
||||
$random_string = substr(str_shuffle(str_repeat('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01', 64)), 0, rand(50, 64));
|
||||
$user_password = password_hash($random_string, PASSWORD_BCRYPT, ["cost" => 12]);
|
||||
$API_resetpassword->postedData['user_password'] = $user_password;
|
||||
|
||||
# Password reset token that will be send to the user
|
||||
# Password reset token that will be sent to the user
|
||||
$API_resetpassword->postedData['user_password_reset_token'] = bin2hex(random_bytes(32));
|
||||
$API_resetpassword->postedData['user_password_reset_expires'] = time() + 86400;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user