Merge branch 'release/21.7.8' into release/22.0.alpha1
This commit is contained in:
@@ -452,7 +452,6 @@ class userModel extends model
|
||||
$user = $this->dao->select('*')->from(TABLE_USER)->where("`$field`")->eq($userID)->fetch();
|
||||
if(!$user) return false;
|
||||
|
||||
$user->last = date(DT_DATETIME1, $user->last);
|
||||
return $user;
|
||||
}
|
||||
|
||||
@@ -690,6 +689,7 @@ class userModel extends model
|
||||
}
|
||||
|
||||
if(dao::isError()) return $this->rollBack();
|
||||
if(!empty($user->password) && $user->password != $oldUser->password) $this->userTao->deleteImUserDevice($user->id);
|
||||
|
||||
$this->dao->commit();
|
||||
|
||||
@@ -838,6 +838,7 @@ class userModel extends model
|
||||
$this->dao->update(TABLE_USER)->set('password')->eq($user->password)->where('id')->eq($this->app->user->id)->exec();
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$this->userTao->deleteImUserDevice($this->app->user->id);
|
||||
$this->loadModel('score')->create('user', 'changePassword', $this->computePasswordStrength($user->password1));
|
||||
|
||||
$this->app->user->password = $user->password;
|
||||
@@ -892,12 +893,11 @@ class userModel extends model
|
||||
if(!$user) return false;
|
||||
|
||||
$ip = helper::getRemoteIp();
|
||||
$last = $this->server->request_time;
|
||||
$last = helper::now();
|
||||
$user = $this->checkNeedModifyPassword($user, $passwordStrength);
|
||||
|
||||
$user->lastTime = $user->last;
|
||||
$user->last = date(DT_DATETIME1, $last);
|
||||
$user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false;
|
||||
$user->last = $last;
|
||||
$user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false;
|
||||
|
||||
if($this->app->isServing())
|
||||
{
|
||||
@@ -941,7 +941,8 @@ class userModel extends model
|
||||
|
||||
if($passwordLength == 40)
|
||||
{
|
||||
$hash = sha1($user->account . $user->password . $user->last);
|
||||
$lastTimestamp = is_numeric($user->last) ? $user->last : strtotime($user->last);
|
||||
$hash = sha1($user->account . $user->password . $lastTimestamp);
|
||||
if($password == $hash) return $user;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user