/** * Remove confirmation token if it's expiration date is over */ public function init() { if ($this->user->confirmation_token !== null and $this->getTokenTimeLeft() == 0) { $this->user->removeConfirmationToken(); $this->user->save(false); } }
/** * @param bool $performValidation * * @return bool */ public function changePassword($performValidation = true) { if ($performValidation and !$this->validate()) { return false; } $this->user->password = $this->password; $this->user->removeConfirmationToken(); return $this->user->save(); }