Пример #1
0
 public function record()
 {
     $operation = $this->controllerName . "/" . $this->actionName;
     $request = new \Phalcon\Http\Request();
     $ip = $request->getClientAddress();
     $members = new \Phalcon_wifi\Common\Models\Members();
     $mid = $members->checkLogin();
     $record = new \Phalcon_wifi\Common\Models\Record();
     $record->operation = $operation;
     $record->loginip = $ip;
     $record->mid = $mid;
     $record->log_time = date("Y-m-d H:i:s");
     $record->save();
 }
Пример #2
0
 public function beforeExecuteRoute($dispatcher)
 {
     $members = new \Phalcon_wifi\Common\Models\Members();
     $this->moduleName = $dispatcher->getModuleName();
     $this->controllerName = $dispatcher->getControllerName();
     $this->actionName = $dispatcher->getActionName();
     $currentRouter = $this->moduleName . '/' . $this->controllerName . '/' . $this->actionName;
     if (!$this->ifNotCheckUri($currentRouter)) {
         if (!$members->checkLogin()) {
             $this->redirect($this->createLocalUrl(array('for' => 'common', 'controller' => 'Members', 'action' => 'login')));
             return false;
         }
     }
 }