本文整理汇总了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());
}
示例2: _initialize
public function _initialize()
{
parent::_initialize();
$model = D('FlowType');
$where['is_del'] = 0;
//$this -> _flow_type = $model -> where($where) -> getField('id,name');
}
示例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);
}
示例4:
function _initialize()
{
//预处理
/*if (!$this->_is_login()){
$this->redirect("/Public/login");
}*/
parent::_initialize();
}
示例5: _initialize
public function _initialize()
{
if (!isset($_COOKIE[$this->session_name])) {
session_id($_REQUEST[$this->session_name]);
session_start();
}
parent::_initialize();
}
示例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();
}
示例7: C
/**
* 初始化方法
* (non-PHPdoc)
* @see CommonAction::_initialize()
*/
function _initialize()
{
// 先调用父类的初始化方法
parent::_initialize();
// 初始化数据库句柄
//$this->AdPlan =
//$this->actionName = $this->getActionName();
$this->table_pre = C('DB_PREFIX');
}
示例8: _initialize
public function _initialize()
{
parent::_initialize();
if (session('IS_LOGIN') != 1) {
$this->message2('请先登录!', __APP__ . '/Index');
}
if (session('isvalid') != 1) {
$this->message2('账号需等待管理员审核!', __APP__ . '/Index');
}
}
示例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';
}
示例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']);
}
示例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;
}
}
示例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);
}
示例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');
}
}
示例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);
}
示例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 版权所有 © 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));
}
}