当前位置: 首页>>代码示例>>PHP>>正文


PHP controller::isRightVersion方法代码示例

本文整理汇总了PHP中controller::isRightVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP controller::isRightVersion方法的具体用法?PHP controller::isRightVersion怎么用?PHP controller::isRightVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在controller的用法示例。


在下文中一共展示了controller::isRightVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Class constructor, initialize the header content type.
  */
 protected function __construct()
 {
     $buffer = ob_get_contents();
     ob_get_clean();
     // ob_start("ob_gzhandler");        // compress page before sending //Not supported for json response on ajax calls
     header('Content-Type: application/json; charset=utf-8');
     if (!parent::isRightVersion()) {
         $output = INIT::$CONFIG_VERSION_ERR_MESSAGE;
         $this->result = array("errors" => array(array("code" => -1000, "message" => $output)), "data" => array());
         $this->api_output = array("errors" => array(array("code" => -1000, "message" => $output)), "data" => array());
         $this->finalize();
         exit;
     }
 }
开发者ID:indynagpal,项目名称:MateCat,代码行数:17,代码来源:ajaxController.php

示例2: __construct

 /**
  * Class constructor
  *
  * @param bool $isAuthRequired
  */
 public function __construct($isAuthRequired = false)
 {
     if (!parent::isRightVersion()) {
         header("Location: " . INIT::$HTTPHOST . INIT::$BASEURL . "badConfiguration", true, 303);
         exit;
     }
     //SESSION ENABLED
     parent::sessionStart();
     //load Template Engine
     require_once INIT::$ROOT . '/inc/PHPTAL/PHPTAL.php';
     $this->supportedBrowser = $this->isSupportedWebBrowser();
     //try to get user name from cookie if it is not present and put it in session
     if (empty($_SESSION['cid'])) {
         //log::doLog(get_class($this)." requires check for login");
         $username_from_cookie = AuthCookie::getCredentials();
         if ($username_from_cookie) {
             $_SESSION['cid'] = $username_from_cookie['username'];
             $_SESSION['uid'] = $username_from_cookie['uid'];
         }
     }
     //even if no login in required, if user data is present, pull it out
     if (!empty($_SESSION['cid'])) {
         $userSearch = new Users_UserStruct();
         $userSearch->email = $_SESSION['cid'];
         $userDao = new Users_UserDao(Database::obtain());
         $userObject = $userDao->read($userSearch);
         /**
          * @var $userObject Users_UserStruct
          */
         $userObject = $userObject[0];
         //            $this->logged_user = getUserData( $_SESSION[ 'cid' ] );
         $this->logged_user = $userObject;
     }
     if ($isAuthRequired) {
         //if auth is required, stat procedure
         $this->doAuth();
     }
 }
开发者ID:indynagpal,项目名称:MateCat,代码行数:43,代码来源:viewController.php


注:本文中的controller::isRightVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。