/** * @param string $token * @param string $newPassword * * @return bool */ public function resetPassword($token, $newPassword) { $resetPasswordEntity = $this->authQueryContainer->queryForActiveCode($token)->findOne(); if (empty($resetPasswordEntity)) { return false; } $userTransfer = $this->userFacade->getUserById($resetPasswordEntity->getFkUser()); $userTransfer->setPassword($newPassword); $this->userFacade->updateUser($userTransfer); $resetPasswordEntity->setStatus(SpyResetPasswordTableMap::COL_STATUS_USED); $affectedRows = $resetPasswordEntity->save(); return $affectedRows > 0; }
/** * @return bool */ public function hasCurrentUser() { return $this->userFacade->hasCurrentUser(); }