1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 17:14:42 +02:00

Fixes for resend activation email. (frontend). Resend to all (backend). Fixes broken link to "resend activation" in login error messages.

This commit is contained in:
Cameron
2015-05-18 11:49:32 -07:00
parent f7eadfd588
commit 0a8e57863e
8 changed files with 354 additions and 202 deletions

View File

@@ -157,7 +157,7 @@ class UserHandler
*
* @return string|boolean - FALSE if invalid emcoding method, else encoded password to store in DB
*/
public function HashPassword($password, $login_name, $force='')
public function HashPassword($password, $login_name='', $force='')
{
if ($force == '') $force = $this->preferred;
switch ($force)
@@ -207,6 +207,42 @@ class UserHandler
}
/**
* Reset the user's password with an auto-generated string.
* @param $uid
* @param string $loginName (optional)
* @return bool|string rawPassword
*/
public function resetPassword($uid, $loginName='')
{
if(empty($uid))
{
return false;
}
$rawPassword = $this->generateRandomString('********');
// $sessKey = e_user_model::randomKey();
$updateQry = array(
'user_password' => $this->HashPassword($rawPassword, $loginName),
'WHERE' => 'user_id = '.intval($uid)." LIMIT 1"
);
if(e107::getDb()->update('user', $updateQry))
{
return $rawPassword;
}
else
{
return false;
}
}
/**
* Verifies a standard response to a CHAP challenge
*