當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonAction::_initialize方法代碼示例

本文整理匯總了PHP中CommonAction::_initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonAction::_initialize方法的具體用法?PHP CommonAction::_initialize怎麽用?PHP CommonAction::_initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonAction的用法示例。


在下文中一共展示了CommonAction::_initialize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function _initialize()
 {
     //預處理
     $this->permissions = array("1" => "Article", "2" => "Gropus", "3" => "Albums", "4" => "Events", "5" => "Cityguide");
     if (!$this->_is_login()) {
         $arr = array('/cid/3', '/cid/2', '/cid/1', '/cid/4', '/cid/0', '/1.html', '/0.html', '/2.html', '/3.html', '/4.html', '.html', '/index.php?s=', '/Public/select_city');
         $url = str_replace($arr, '', $_SERVER["REQUEST_URI"]);
         $url = $url == '/' ? '/Index/index' : $url;
         $url = myencode($url);
         redirect("/Public/login/to/{$url}");
     }
     parent::_initialize();
     $rudao = D("RoleUser");
     $condition = array("user_id" => $this->user['uid']);
     $data = array();
     $data = $rudao->where($condition)->find();
     //dump($rudao->getlastsql());
     if (count($data) > 0) {
         $data['per'] = unserialize($data['permissions']);
         $this->user_per = $data;
         $this->assign("permissions", $this->permissions);
         $this->assign("per", $data);
     }
     import("ORG.Util.Page");
     $this->assign('pmnum', $this->ckh_pm());
 }
開發者ID:putera99,項目名稱:iic-classified,代碼行數:26,代碼來源:CpAction.class.php

示例2: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $model = D('FlowType');
     $where['is_del'] = 0;
     //$this -> _flow_type = $model -> where($where) -> getField('id,name');
 }
開發者ID:yunsite,項目名稱:smeoa,代碼行數:7,代碼來源:FlowAction.class.php

示例3: dirname

 function _initialize()
 {
     parent::_initialize();
     $this->url_path = dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
     $this->theme = isset($_REQUEST['theme']) && $_REQUEST['theme'] != '' ? trim($_REQUEST['theme']) : 'default';
     cookie('think_template', $this->theme);
 }
開發者ID:babyhuangshiming,項目名稱:webserver,代碼行數:7,代碼來源:BuildAction.class.php

示例4:

 function _initialize()
 {
     //預處理
     /*if (!$this->_is_login()){
     			$this->redirect("/Public/login");
     		}*/
     parent::_initialize();
 }
開發者ID:putera99,項目名稱:iic-classified,代碼行數:8,代碼來源:MemberAction.class.php

示例5: _initialize

 public function _initialize()
 {
     if (!isset($_COOKIE[$this->session_name])) {
         session_id($_REQUEST[$this->session_name]);
         session_start();
     }
     parent::_initialize();
 }
開發者ID:baowzh,項目名稱:adminrightlist,代碼行數:8,代碼來源:uploadifyAction.class.php

示例6: _initialize

 protected function _initialize()
 {
     $search_hot_list = D("Search_hot")->get_list(12, 1);
     //add
     $this->assign("search_hot_list", $search_hot_list);
     //add
     parent::_initialize();
 }
開發者ID:belerweb,項目名稱:pigcms,代碼行數:8,代碼來源:BaseAction.class.php

示例7: C

 /**
  * 初始化方法
  * (non-PHPdoc)
  * @see CommonAction::_initialize()
  */
 function _initialize()
 {
     // 先調用父類的初始化方法
     parent::_initialize();
     // 初始化數據庫句柄
     //$this->AdPlan =
     //$this->actionName = $this->getActionName();
     $this->table_pre = C('DB_PREFIX');
 }
開發者ID:qiuai,項目名稱:Ads,代碼行數:14,代碼來源:PlanWebAction.class.php

示例8: _initialize

 public function _initialize()
 {
     parent::_initialize();
     if (session('IS_LOGIN') != 1) {
         $this->message2('請先登錄!', __APP__ . '/Index');
     }
     if (session('isvalid') != 1) {
         $this->message2('賬號需等待管理員審核!', __APP__ . '/Index');
     }
 }
開發者ID:kwdwkiss,項目名稱:kongbao,代碼行數:10,代碼來源:OrderAction.class.php

示例9: _initialize

 public function _initialize()
 {
     parent::_initialize();
     import('@.ORG.QQHelper');
     $this->qqHelper = new QQHelper();
     $config = M('config')->where('id=1')->find();
     $this->qq_setting = json_decode($config['qq_setting'], true);
     $this->reg_setting = json_decode($config['reg_setting'], true);
     $this->callback = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/Qlogin/login';
 }
開發者ID:kwdwkiss,項目名稱:kongbao8,代碼行數:10,代碼來源:QloginAction.class.php

示例10: _initialize

 public function _initialize()
 {
     parent::_initialize();
     if (!$GLOBALS['islogin'] || !in_array($GLOBALS['i']['uid'], array(20133, 20033, 124, 82, 20046))) {
         header("HTTP/1.0 404 Not Found");
         //echo $GLOBALS['i']['username'];
         exit;
     }
     $GLOBALS['s']['urladmin'] = $GLOBALS['s']['urlsite'] . '/' . strtolower(MODULE_NAME);
     $this->assign('urladmin', $GLOBALS['s']['urladmin']);
 }
開發者ID:laiello,項目名稱:qinhan,代碼行數:11,代碼來源:Admin2qinhan2orgAction.class.php

示例11: intval

 /**
  *預處理
  *@date 2010-4-30
  *@time 上午10:08:20
  */
 function _initialize()
 {
     //預處理
     parent::_initialize();
     if (intval($_GET['cid'])) {
         $this->pcid = intval($_GET['cid']);
     } else {
         //$this->_set_cid();
         //$this->cid=empty($this->user['usercid'])?$_SESSION['cid']:$this->user['usercid'];
         $this->cid = empty($this->cid) ? cookie('cid') : $this->cid;
         $this->pcid = empty($this->cid) ? '0' : $this->cid;
     }
 }
開發者ID:putera99,項目名稱:iic-classified,代碼行數:18,代碼來源:IndexAction.class.php

示例12: header

 function _initialize()
 {
     parent::_initialize();
     header("Content-type: text/html;charset=utf-8");
     set_time_limit(0);
     //不超時
     ini_set('memory_limit', '500M');
     $this->config = array('path' => C('DB_BACKUP'), 'isCompress' => 0, 'isDownload' => 0);
     $this->dbName = C('DB_NAME');
     //當前數據庫名稱
     $this->model = new Model();
     //$sql = 'set interactive_timeout=24*3600';                             //空閑多少秒後 斷開鏈接
     //$this->model>execute($sql);
 }
開發者ID:zhezhisama,項目名稱:zz,代碼行數:14,代碼來源:DatarecoverAction.class+(2).php

示例13: _initialize

 public function _initialize()
 {
     parent::_initialize();
     C("layout_name", "user_layout");
     if (isset($_SESSION["user_id"])) {
         //用戶信息
         $this->user_info = M("UserInfo")->where("user_id=" . $_SESSION["user_id"])->find();
         //用戶頭像
         $avatar_path = $this->user_info ? $this->user_info['avatar_path'] : APP_TMPL_PATH . "Public/img/members/user.jpg";
         $this->assign("avatar_path", $avatar_path);
     } else {
         $this->redirect('login/index');
     }
 }
開發者ID:baowzh,項目名稱:adminrightlist,代碼行數:14,代碼來源:usercommonAction.class.php

示例14: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $model = new Model('gonggao');
     $gonggao = $model->order('time desc')->limit(8)->select();
     $this->assign('gonggao_list', $gonggao);
     $model = new Model('help');
     $help = $model->order('time desc')->limit(8)->select();
     $this->assign('help_list', $help);
     $model = new Model('article');
     $article = $model->order('article_time desc')->limit(8)->select();
     $this->assign('article_list', $article);
     $model = new Model('about');
     $about = $model->order('time desc')->limit(8)->select();
     $this->assign('about_list', $about);
 }
開發者ID:kwdwkiss,項目名稱:kongbao8,代碼行數:16,代碼來源:HelpAction.class.php

示例15: _initialize

 protected function _initialize()
 {
     parent::_initialize();
     $m_name = MODULE_NAME;
     $a_name = ACTION_NAME;
     //禁止通過URL訪問的操作
     if (in_array($m_name . '.' . strtolower($a_name), C('APP_ACTION_DENY_LIST'))) {
         die('Hacking attempt.');
     }
     //無需驗證的模塊
     $not_auth_modules = C('NOT_AUTH_MODULES');
     //無需驗證的操作
     $not_auth_actions = C('NOT_AUTH_ACTIONS');
     if (!in_array($m_name . '.' . $a_name, C('NOT_LOGIN_ACTIONS'))) {
         $this->_checkLogin();
     }
     //權限驗證
     if (!$_SESSION[C('SESSION_PREFIX') . 'is_super'] && $a_name != 'editField' && $a_name != 'toggleStatus' && !in_array($m_name, $not_auth_modules) && !in_array($m_name . '.' . $a_name, $not_auth_actions)) {
         //需要超級管理員權限的模塊
         $super_prive_modules = array('Admin', 'Cache', 'City', 'Priv', 'Role', 'SearchIndex', 'SysConf', 'TempFile', 'VerifyCode');
         //驗證權限
         if (in_array($m_name, $super_prive_modules) || !AdminPriv::checkPrive($m_name, strtolower($a_name))) {
             if (!$this->isAjax()) {
                 if (isset($_REQUEST['is_iframe']) && $_REQUEST['is_iframe']) {
                     exit('<center><strong>您沒有權限進行此操作</strong></center>');
                 } else {
                     $this->assign('jumpUrl', $this->_refererUrl);
                     $this->error('您沒有權限進行此操作.');
                 }
             } else {
                 $this->ajaxReturn('', '您沒有權限進行此操作', 0);
             }
             exit;
         }
     }
     if (!isset($_SESSION[C('SESSION_PREFIX') . 'user_id'])) {
         $_SESSION[C('SESSION_PREFIX') . 'user_id'] = 0;
         $_SESSION[C('SESSION_PREFIX') . 'user_name'] = '';
         $_SESSION[C('SESSION_PREFIX') . 'name'] = '';
         $_SESSION[C('SESSION_PREFIX') . 'is_super'] = false;
         $_SESSION[C('SESSION_PREFIX') . 'user_roles'] = array();
     }
     if (!$this->isAjax() && !$this->isPost()) {
         $this->assign('copyright', sprintf('%s 版權所有 &copy; 2012-%s  係統版本 <span id="version_tip">v%s</span><span id="office_forum"><a href="http://www.tp-coupon.com" target="_blank">官方論壇</a></span>', 'TP-COUPON', date('Y'), APP_VERSION));
     }
 }
開發者ID:yunsite,項目名稱:tp-coupon,代碼行數:46,代碼來源:AdminCommonAction.class.php


注:本文中的CommonAction::_initialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。