/** * process the class * * @since 3.0.0 * * @return string */ public function process() { $auth = new Auth($this->_request); $auth->init(); /* handle success */ if ($auth->logout()) { return $this->_success(); } return $this->_error(); }
/** * testInit * * @since 3.0.0 */ public function testInit() { /* setup */ $this->_request->setSession('auth', ['user' => ['test' => 'test'], 'permission' => ['test' => 'test']]); $auth = new Auth($this->_request); $auth->init(); /* compare */ $this->assertEquals('test', $auth->getUser('test')); $this->assertEquals('test', $auth->getPermission('test')); }
/** * adminPanelNotification * * @since 3.0.0 * * return array */ public static function adminPanelNotification() { $auth = new Auth(Request::getInstance()); $auth->init(); /* demo user */ if ($auth->getUser('user') === 'demo') { self::setNotification('success', Language::get('logged_in') . Language::get('point')); } return self::getNotification(); }