Made user class work with abstract classes

This commit is contained in:
2019-05-17 13:14:39 +02:00
parent 17e737b64c
commit 03df8c8f1a
4 changed files with 47 additions and 22 deletions

View File

@@ -233,16 +233,20 @@ class ClubsUser extends AbstractClubsModel
if($this->id === 'new')
return;
if(password_needs_rehash($this->password, PASSWORD_DEFAULT))
if(password_needs_rehash($this->password, PASSWORD_DEFAULT) || true)
{
$this->password = password_hash($password, PASSWORD_DEFAULT);
$copy = ClubsUser::loadUser($this->id);
$copy->password = password_hash($password, PASSWORD_DEFAULT);
$copy->save();
$dbo = Factory::getDbo();
// $this->password = password_hash($password, PASSWORD_DEFAULT);
$q = $dbo->getQuery(true);
$q->update(self::tableName)->set('password=' . $q->q($this->password))->where('id=' . (int) $this->id);
$dbo->setQuery($q);
$dbo->execute();
// $dbo = Factory::getDbo();
// $q = $dbo->getQuery(true);
// $q->update(self::tableName)->set('password=' . $q->q($this->password))->where('id=' . (int) $this->id);
// $dbo->setQuery($q);
// $dbo->execute();
}
}