public function testLogin() { $api = new Login(); $api->exec(); $this->assertTrue(\UsersLogin::isLogined()); $this->assertEquals(\UsersLogin::getCurrentSession()->login->getValue(), self::Login); }
public static function getCurrentUser() { if (!UsersLogin::isLogined()) { return; } return array('currentUser' => UsersLogin::getCurrentSession()->getParseData()); }
public static function getCurrentUserGrants() { $result = self::loadGuestUserRights(); // if (UsersLogin::isLogined()) { $result = array_merge($result, self::extractUserGrants(UsersLogin::getCurrentSession())); } return $result; }
protected function autoLogin() { if (UsersLogin::isLogined()) { $user = UsersLogin::getCurrentSession(); if ($this->isAdmin($user)) { $this->user = $user; } EventController::callEvent(self::EventName, $this); } }
public function testForInjections() { if (\UsersLogin::isLogined()) { if (\CMSAuth::getInstance()->isAdmin(\UsersLogin::getCurrentSession())) { return; } } foreach ($this->data as $key => $value) { self::validateParameter($key, $value); } $this->validateParameter('Current page url', $this->uri()); }
public function __construct($urlInfo = array()) { parent::__construct($urlInfo); if (!UsersLogin::isLogined()) { /** * @todo Избавиться от этой зависимости */ $this->addAlert(\plugins\MessageDictionary\Plugin::getMessage('need_auth')); $this->jump('/'); throw new Exception('User not logined'); } $this->aProfile = UsersLogin::getCurrentSession(); }
public function __construct() { // $auth = CMSAuth::getInstance(); if (!$auth->isSuperAdmin(UsersLogin::getCurrentSession())) { $this->addError('Access denied'); $this->jump(\Extasy\CMS::getDashboardWWWRoot()); } parent::__construct(); // Вызов формы редактирования $this->addGet('id', 'showEdit'); // Вызов формы добавления $this->addGet('add', 'showAdd'); // Вызов функции редактирования $this->addPost('id,login,password,rights', 'postEdit'); $this->addPost('id,login,password', 'postEdit'); // Вызов функции добавления $this->addPost('login,password,rights', 'postAdd'); $this->addPost('login,password', 'postAdd'); // Удаление $this->addPost('id', 'delete'); }
protected function initUserParseData() { $user = \UsersLogin::getCurrentSession(); if (is_object($user)) { $userData = $user->getData(); $this->view->set('currentUser', $userData); } }