init() публичный Метод

init the class
С версии: 3.0.0
public init ( )
Пример #1
0
 /**
  * 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();
 }
Пример #2
0
 /**
  * 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'));
 }
Пример #3
0
 /**
  * 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();
 }