コード例 #1
0
ファイル: UserHelper.php プロジェクト: V3N0m21/Uppu3
 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;
 }
コード例 #2
0
ファイル: LoginHelper.php プロジェクト: V3N0m21/Uppu3
 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);
 }
コード例 #3
0
ファイル: DataValidator.php プロジェクト: V3N0m21/Uppu3
 public function validateUser(\Uppu3\Entity\User $user, $data)
 {
     $this->checkLogin($user->getLogin());
     $this->checkPassword($data['password'], $data['confirmation']);
     $this->checkEmail($user->getEmail());
 }