Beispiel #1
0
 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;
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 public function validateUser(\Uppu3\Entity\User $user, $data)
 {
     $this->checkLogin($user->getLogin());
     $this->checkPassword($data['password'], $data['confirmation']);
     $this->checkEmail($user->getEmail());
 }