示例#1
0
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 对路径进行安全处理 */
if (strpos(PHP_SELF, '.php/') !== false) {
    hhs_header("Location:" . substr(PHP_SELF, 0, strpos(PHP_SELF, '.php/') + 4) . "\n");
    exit;
}
/* 创建 昊海电商 对象 */
$hhs = new HHS($db_name, $prefix);
define('DATA_DIR', $hhs->data_dir());
define('IMAGE_DIR', $hhs->image_dir());
/* 初始化数据库类 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 创建错误处理对象 */
$err = new hhs_error('message.htm');
/* 初始化session */
require ROOT_PATH . 'includes/cls_session.php';
$sess = new cls_session($db, $hhs->table('sessions'), $hhs->table('sessions_data'), 'HHSCP_ID');
/* 初始化 action */
if (!isset($_REQUEST['act'])) {
    $_REQUEST['act'] = '';
} elseif (($_REQUEST['act'] == 'login' || $_REQUEST['act'] == 'logout' || $_REQUEST['act'] == 'signin') && strpos(PHP_SELF, '/privilege.php') === false) {
示例#2
0
if (!defined('EC_CHARSET')) {
    define('EC_CHARSET', 'utf-8');
}
/* 初始化JSON对象 */
$json = new JSON();
/* 分析JSON数据 */
parse_json($json, $_POST['Json']);
/* 初始化包含文件 */
require ROOT_PATH . 'includes/inc_constant.php';
require ROOT_PATH . 'includes/cls_hhshop.php';
require ROOT_PATH . 'includes/lib_time.php';
require ROOT_PATH . 'includes/lib_main.php';
require ROOT_PATH . 'includes/lib_insert.php';
require ROOT_PATH . 'includes/lib_goods.php';
/* 创建 昊海电商 对象 */
$hhs = new HHS($db_name, $prefix);
/* 初始化数据库类 */
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($hhs->table('sessions'), $hhs->table('sessions_data'), $hhs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 载入系统参数 */
$_CFG = load_config();
/* 载入语言包 */
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/common.php';
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/log_action.php';
/* 初始化session */
include ROOT_PATH . 'includes/cls_session.php';
$sess = new cls_session($db, $hhs->table('sessions'), $hhs->table('sessions_data'), 'CL_HHSCP_ID');
define('SESS_ID', $sess->get_session_id());
/* 判断是否登录了 */
if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) && $_POST['Action'] != 'UserLogin') {
示例#3
0
require ROOT_PATH . 'includes/lib_base.php';
require ROOT_PATH . 'includes/lib_common.php';
require ROOT_PATH . 'includes/lib_time.php';
/* 对用户传入的变量进行转义操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 创建 昊海电商 对象 */
$hhs = new HHS($db_name, $prefix);
$data_dir = $hhs->data_dir();
/* 初始化数据库类 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 初始化session */
require ROOT_PATH . 'includes/cls_session.php';
$sess_name = defined("SESS_NAME") ? SESS_NAME : 'HHS_ID';
$sess = new cls_session($db, $hhs->table('sessions'), $hhs->table('sessions_data'), $sess_name);
/* 载入系统参数 */
$_CFG = load_config();
/* 初始化用户插件 */
$user =& init_users();
if ((DEBUG_MODE & 1) == 1) {
    error_reporting(E_ALL);
示例#4
0
require ROOT_PATH . 'includes/lib_goods.php';
require ROOT_PATH . 'includes/lib_article.php';
require ROOT_PATH . 'includes/lib_wxf.php';
/* 对用户传入的变量进行转义操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 创建 昊海电商 对象 */
$hhs = new HHS($db_name, $prefix);
define('DATA_DIR', $hhs->data_dir());
define('IMAGE_DIR', $hhs->image_dir());
/* 初始化数据库类 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($hhs->table('sessions'), $hhs->table('sessions_data'), $hhs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 创建错误处理对象 */
$err = new hhs_error('message.dwt');
/* 载入系统参数 */
$_CFG = load_config();
/* 载入语言文件 */
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/common.php';
if ($_CFG['shop_closed'] == 1) {
    /* 商店关闭了,输出关闭的消息 */
示例#5
0
require ROOT_PATH . 'includes/lib_goods.php';
require ROOT_PATH . 'includes/lib_article.php';
require ROOT_PATH . 'includes/lib_wxf.php';
/* 对用户传入的变量进行转义操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 创建 昊海电商 对象 */
$hhs = new HHS($db_name, $prefix);
define('DATA_DIR', $hhs->data_dir());
define('IMAGE_DIR', $hhs->image_dir());
/* 初始化数据库类 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($hhs->table('sessions'), $hhs->table('sessions_data'), $hhs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 创建错误处理对象 */
$err = new hhs_error('message.dwt');
/* 载入系统参数 */
$_CFG = load_config();
/* 载入语言文件 */
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/common.php';
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
示例#6
0
define('IN_HHS', true);
define('ROOT_PATH', preg_replace('/includes(.*)/i', '', str_replace('\\', '/', __FILE__)));
if (isset($_SERVER['PHP_SELF'])) {
    define('PHP_SELF', $_SERVER['PHP_SELF']);
} else {
    define('PHP_SELF', $_SERVER['SCRIPT_NAME']);
}
$root_path = preg_replace('/includes(.*)/i', '', PHP_SELF);
require ROOT_PATH . 'data/config.php';
require ROOT_PATH . 'includes/lib_base.php';
require ROOT_PATH . 'includes/cls_mysql.php';
require ROOT_PATH . 'includes/cls_hhshop.php';
require ROOT_PATH . 'includes/cls_session.php';
require ROOT_PATH . 'includes/lib_common.php';
/* 创建 昊海电商 对象 */
$hhs = new HHS($db_name, $prefix);
define('DATA_DIR', $hhs->data_dir());
define('IMAGE_DIR', $hhs->image_dir());
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
/* init session */
$sess = new cls_session($db, $hhs->table('sessions'), $hhs->table('sessions_data'), 'HHSCP_ID');
if (!empty($_SESSION['admin_id'])) {
    if ($_SESSION['action_list'] == 'all') {
        $enable = true;
    } else {
        if (strpos(',' . $_SESSION['action_list'] . ',', ',goods_manage,') === false && strpos(',' . $_SESSION['action_list'] . ',', ',virualcard,') === false && strpos(',' . $_SESSION['action_list'] . ',', ',article_manage,') === false) {
            $enable = false;
        } else {
            $enable = true;
        }
    }