function _initialize() { $this->pre = C('DB_PREFIX'); $query_string = explode("/", $_SERVER['REQUEST_URI']); $code = strtolower(MODULE_NAME); !isset($this->justlogin) ? $this->justlogin = false : ($this->justlogin = $this->justlogin); if (session('admin')) { //dump(session('adminname'));exit; $this->admin_id = session("admin"); $this->assign('adminname', session('adminname')); } elseif (strtolower(ACTION_NAME) != 'verify' && strtolower(ACTION_NAME) != 'login' && strtolower(ACTION_NAME) != 'logincheck') { // redirect(__ROOT__."/index.php/admin/index/logincheck?code=".$query_string[2]); redirect(__ROOT__ . "/index.php/admin/index/logincheck?code=" . $code); exit; } if (!get_user_acl(session('admin')) && !$this->justlogin) { $this->error('对不起,权限不足'); exit; } if (method_exists($this, '_MyInit')) { $this->_MyInit(); } $datag = get_global_setting(); $this->glo = $datag; //供PHP里面使用 $this->assign("glo", $datag); $bconf = get_bconf_setting(); $this->gloconf = $bconf; //供PHP里面使用 $this->assign("gloconf", $bconf); }
function _initialize() { forceHttp(); $this->pre = C('DB_PREFIX'); !isset($this->justlogin) ? $this->justlogin = false : ($this->justlogin = $this->justlogin); $this->saveRule = date("YmdHis", time()) . rand(0, 1000); if (strtolower(MODULE_NAME) == 'index' && (strtolower(ACTION_NAME) == 'login' || strtolower(ACTION_NAME) == 'index' && !session('admin')) && $_SERVER['PATH_INFO'] != '/' . SAFE_ADMIN) { echo 'The page can\'t been found'; header('HTTP/1.0 404 Not Found'); exit; } if (session('admin')) { $this->admin_id = session("admin_id"); $this->assign('adminname', session('adminname')); } elseif (strtolower(ACTION_NAME) != 'verify' && strtolower(ACTION_NAME) != 'login' && strtolower(ACTION_NAME) != 'getsmscode') { if ($_SERVER['PATH_INFO'] != '/' . SAFE_ADMIN) { echo 'The page can\'t been found.'; header('HTTP/1.0 404 Not Found'); } else { redirect(__ROOT__ . '/' . SAFE_ADMIN); } exit; } if (!get_user_acl(session('admin')) && !$this->justlogin) { $this->error('对不起,权限不足'); exit; } if (method_exists($this, '_MyInit')) { $this->_MyInit(); } $this->logOpType = C("LOG_OPERATION_TYPE"); $this->assign("logOpType", $this->logOpType); $this->logUserType = C("LOG_USER_TYPE"); $datag = get_global_setting(); $this->glo = $datag; //供PHP里面使用 $this->assign("glo", $datag); }