示例#1
0
 /**
  * @protected
  * Will set variables to all the views of a controller
  */
 public function render()
 {
     $session = Registry::get("session");
     if ($this->actionView) {
         $this->actionView->set("educator", $session->get("educator"))->set("scholar", $session->get("scholar"))->set("organization", $session->get("organization"));
     }
     if ($this->layoutView) {
         $this->layoutView->set("educator", $session->get("educator"))->set("scholar", $session->get("scholar"))->set("organization", $session->get("organization"));
     }
     parent::render();
 }
示例#2
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     $headers = getallheaders();
     if (isset($headers["X-Access-Token"])) {
         $type = strtolower($headers["X-App"]);
         $meta = Meta::first(array("property = ?" => "user", "meta_key = ?" => $type . "-app", "meta_value = ?" => $headers["X-Access-Token"]), array("property_id"));
         if ($meta) {
             $this->_appLogin($meta, $type);
         }
     }
 }
示例#3
0
文件: auth.php 项目: HLitmus/WebApp
 public function __construct($options = array())
 {
     parent::__construct($options);
     $headers = getallheaders();
     if (isset($headers["X-Access-Token"])) {
         $type = $headers["X-App"];
         $meta = Meta::first(array("property = ?" => $type . "-app", "value = ?" => $headers["X-Access-Token"]), array("user_id"));
         if ($meta) {
             $user = User::first(array("id = ?" => $meta->user_id));
             $this->setUser($user);
         }
     }
 }
示例#4
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     $this->noview();
 }
示例#5
0
文件: api.php 项目: vNative/vnative
 public function __construct($options = [])
 {
     parent::__construct($options);
     $this->JSONView();
 }