Ejemplo n.º 1
0
<?php

defined('IN_BACKGROUND') or exit('No permission');
$session_storage = getSessionStorageType();
bpBase::loadSysClass($session_storage);
bpBase::loadSysFunc('back');
class manage
{
    public $userid;
    public $username;
    public $role_db;
    public $user_role_db;
    public static $isAdministrator;
    public $token;
    public $site;
    public $siteid;
    public function __construct()
    {
        bpBase::loadAppFunc('global', 'manage');
        //access
        //$_SESSION['token']='tokenvalue';
        if (!isset($_SESSION['token']) || !strlen($_SESSION['token'])) {
            header('Location:/index.php?g=User&m=Index&a=index');
        }
        $this->token = $_SESSION['token'];
        //
        $site_db = M('site');
        $this->site = $site_db->getSiteByToken($this->token);
        $this->siteid = intval($this->site['id']);
    }
    public static final function showManageTpl($file, $m = '')
Ejemplo n.º 2
0
<?php

$session_storage = getSessionStorageType();
bpBase::loadSysClass($session_storage);
bpBase::loadSysFunc('front');
class front
{
    public $uid;
    public $username;
    public $email;
    public $realname;
    public $mp;
    public $qq;
    public $credits;
    public $isAdmin;
    public static $user;
    //
    public static $smarty;
    public function __construct()
    {
        //smarty
        if (front::$smarty == '') {
            //smarty
            ini_set('include_path', ABS_PATH . 'library' . DIRECTORY_SEPARATOR . 'smarty' . PATH_SEPARATOR . ini_get('include_path'));
            require_once 'Smarty.class.php';
            //
            $smartyInstance = new smarty();
            if (!isset($_GET['preview']) || !intval($_GET['preview'])) {
                $smartyInstance->template_dir = ABS_PATH . 'smarty' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;
            } else {
                $smartyInstance->template_dir = ABS_PATH . 'templates' . DIRECTORY_SEPARATOR;
Ejemplo n.º 3
0
<?php

define('SYS_TIME', time());
define('BP_PATH', ABS_PATH . MANAGE_DIR . DIRECTORY_SEPARATOR);
//系统开始时间
define('SYS_START_TIME', microtime());
//缓存文件夹地址
if (!defined('CACHE_PATH')) {
    define('CACHE_PATH', ABS_PATH . 'cache' . DIRECTORY_SEPARATOR);
}
//加载公用函数库
bpBase::loadSysFunc('global');
bpBase::loadSysFunc('extention');
//系统配置
$systemConfig = loadConfig('system');
define('DEBUG', $systemConfig['debug']);
//
if (DEBUG) {
    ini_set('display_errors', '1');
    error_reporting(E_ALL ^ E_NOTICE);
} else {
    ini_set('display_errors', '0');
    error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE & ~E_STRICT);
}
//is post
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
    $isPost = 1;
} else {
    $isPost = 0;
}
define('IS_POST', $isPost);