Ejemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $this->user = false;
     if (isset($_SESSION['username'])) {
         $this->user = $_SESSION['username'];
     }
 }
Ejemplo n.º 2
0
 public function onDispatch(MvcEvent $e)
 {
     $action = $this->getEvent()->getRouteMatch()->getParam('action');
     if ($action != 'login') {
         if ($this->userAuth()->hasIdentity()) {
             $this->user = $this->userAuth()->getIdentity();
         } else {
             return $this->redirect()->toRoute('App/admin', ['action' => 'login']);
         }
     }
     parent::onDispatch($e);
 }
Ejemplo n.º 3
0
 public function _initialize()
 {
     $this->weiboApi = new WeiboApi();
     $this->api = new Model\ApiModel();
     parent::_initialize();
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
 }