public static function saveAnonymousUser($salt, $em, $token) { $userModel = new User(); $userModel->setSalt($salt); $userModel->setToken($token); $userModel->setLogin('Anonymous'); $em->persist($userModel); $em->flush(); return $userModel; }
public function authenticateUser(\Uppu3\Entity\User $user) { $this->responseCookies->set('id', $user->getId(), time() + 3600 * 24 * 7); $this->responseCookies->set('hash', $user->getHash(), time() + 3600 * 24 * 7); }
public function validateUser(\Uppu3\Entity\User $user, $data) { $this->checkLogin($user->getLogin()); $this->checkPassword($data['password'], $data['confirmation']); $this->checkEmail($user->getEmail()); }