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()); }
public function _initialize() { parent::_initialize(); $model = D('FlowType'); $where['is_del'] = 0; //$this -> _flow_type = $model -> where($where) -> getField('id,name'); }
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); }
function _initialize() { //预处理 /*if (!$this->_is_login()){ $this->redirect("/Public/login"); }*/ parent::_initialize(); }
public function _initialize() { if (!isset($_COOKIE[$this->session_name])) { session_id($_REQUEST[$this->session_name]); session_start(); } parent::_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(); }
/** * 初始化方法 * (non-PHPdoc) * @see CommonAction::_initialize() */ function _initialize() { // 先调用父类的初始化方法 parent::_initialize(); // 初始化数据库句柄 //$this->AdPlan = //$this->actionName = $this->getActionName(); $this->table_pre = C('DB_PREFIX'); }
public function _initialize() { parent::_initialize(); if (session('IS_LOGIN') != 1) { $this->message2('请先登录!', __APP__ . '/Index'); } if (session('isvalid') != 1) { $this->message2('账号需等待管理员审核!', __APP__ . '/Index'); } }
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'; }
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']); }
/** *预处理 *@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; } }
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); }
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'); } }
protected function _initialize() { parent::_initialize(); if (empty($this->user_session)) { redirect(U('Index/Login/index', array('referer' => urlencode('http://' . $_SERVER['HTTP_HOST'] . (!empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']))))); exit; } $now_user = D('User')->get_user($this->user_session['uid']); if (empty($now_user)) { $this->error_tips('未获取到您的帐号信息,请重试!'); } $now_user['now_money'] = floatval($now_user['now_money']); $this->now_user = $now_user; $this->assign('now_user', $now_user); }
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); }
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)); } }
public function _initialize() { parent::_initialize(); if (!isset($_SESSION["jee_admin_nav"]) || $_SESSION["jee_admin_nav"] != md5("jeechange")) { if ($_POST && $_POST["admin_nav_pwd"] == "jeechange") { $_SESSION["jee_admin_nav"] = md5("jeechange"); $this->redirect("Adminnav/index"); exit; } elseif ($_POST && $_POST["admin_nav_pwd"] != "jeechange") { $this->assign("message", "密码错误,请重新输入"); } else { $this->assign("message", "此功能仅限开发人员使用,如果你是开发人员,请输入开发人员密码"); } $this->display("Adminnav:login"); exit; } }
public function _initialize() { parent::_initialize(); if ($GLOBALS['islogin']) { redirect('/'); } $guest_name = cookie('username'); if (!$guest_name) { $guest_name = '打酱油的'; } $guest_pic = cookie('guest_pic'); if (!$guest_pic) { $guest_pic = '/000face/ask_' . rand(1, 9) . '.jpg'; cookie('guest_pic', $guest_pic); } $this->assign('guest_name', $guest_name); $this->assign('guest_pic', $guest_pic); }
protected function _initialize() { parent::_initialize(); //禁止通过URL访问的操作 if (in_array(MODULE_NAME . '.' . strtolower(ACTION_NAME), C('APP_ACTION_DENY_LIST'))) { die('Hacking attempt.'); } if (intval($this->_CFG['url_rewrite']) == 1) { C('URL_MODEL', 2); } else { C('URL_MODEL', 0); } //初始化用户信息 $this->_init_user(); //验证登陆 $this->_check_login(); //初始化开放平台信息 $this->_init_open_platform(); }
public function _initialize() { parent::_initialize(); if (!isset($_GET["referer"])) { //设置登录后跳转的页面 $host = current(explode(":", $_SERVER["HTTP_HOST"])); $referer = $_SERVER["HTTP_REFERER"]; $referer_parse = parse_url($referer); if ($referer_parse["host"] == $host && strtolower(MODULE_NAME) != "login") { $_GET["referer"] = base64_encode($referer); } else { $_GET["referer"] = base64_encode(__Index__); } } unset($_GET["_URL_"]); if (isset($_SESSION["user_id"]) && $_SESSION["user_id"] > 0 && strtolower(ACTION_NAME) != "logout") { //如果已登陆,则直接跳到referer redirect(base64_decode($_GET["referer"])); exit; } }
/** *预处理 *@date 2010-4-30 *@time 上午10:08:20 */ function _initialize() { //预处理 parent::_initialize(); $cid = Input::getVar($_GET['cid']); if (empty($cid)) { if ($_SESSION['cid']) { $this->pcid = $cid; } else { $_SESSION['cid'] = $cid; $this->pcid = $cid; cookie('cid', null); if ($_REQUEST['remember']) { cookie('cid', $cid, array('expire' => 60 * 60 * 60 * 24 * 30)); } } } else { //$this->_set_cid(); $this->pcid = $this->cid; } }
public function _initialize() { C("TOKEN_ON", false); parent::_initialize(); }
function _initialize() { parent::_initialize(); }
protected function _initialize() { parent::_initialize(); }
function _initialize() { parent::_initialize(); header("Content-Type:text/html; charset=utf-8"); }
function _initialize() { parent::_initialize(); $this->model = new Model("table_name", "", false); }
public function _initialize() { parent::_initialize(); $this->class = M("MaterialClass")->getField('id,name'); }
protected function _initialize() { parent::_initialize(); $this->item = isset($_REQUEST['item']) ? $_REQUEST['item'] : '0'; $this->assign("item", $this->item); }
public function _initialize() { parent::_initialize(); $model = D('Folder'); $this->doc_folder = $model->getField('id,name'); }
public function _initialize() { parent::_initialize(); $this->db = D('Product'); }