/** * Clear authorization token * * @param Facade $facade * @param bool $clearToken */ private function clearToken(Facade $facade, $clearToken) { if ($clearToken && $facade->isValid()) { $user = $facade->get(); $user->setToken(''); $user->save(); } }
/** * Get Cookies identification data * * @return array */ private function getCookie() { $auth = explode('::', $this->request->cookies->get($this->facade->domain)); if (empty($auth[0]) || empty($auth[1]) || !is_numeric($auth[0])) { $this->facade->logout(); return []; } return $auth; }
/** * @param array $arguments */ public function __construct(Request $request, Router $router, Facade $user, array $arguments) { if (!isset($arguments[0]) || empty($arguments[0])) { throw new \RuntimeException('Image not specified'); } $this->router = $router; $this->request = $request; $this->skin = $user->get()->config()->skin; $this->prepareAttributes($arguments); $this->isModule = isset($arguments[2]) && $arguments[2] === true ? true : false; $this->imgTag = isset($arguments[3]) && $arguments[3] === false ? false : true; $this->img = $arguments[0]; }
/** * Check identification token * * @param AbstractUser $user */ private function checkToken(AbstractUser $user) { $token = $user->offsetGet('token', true); if (empty($token)) { $user->setToken($this->facade->generateToken()); } }
/** * Check Nickname availability * * @param string $nickname * @return bool */ private function isNicknameAvailable($nickname) { try { $this->facade->findByLogin($nickname); throw new InvalidInputException(_g('This Nickname is already taken')); } catch (UserExceptionInterface $e) { return true; } }
public function __construct(Facade $facade, \PDO $pdo) { $this->db = $pdo; $this->validator = $facade->validate(); }
public function __construct(Request $request, Facade $user) { $this->request = $request; $this->userLocale = $user->get()->config()->lng; }