$t->request('http://cloud.ecshop.com/api.php', $apiget); $db->query('UPDATE ' . $ecs->table('shop_config') . ' SET value = "' . $ent_id . '" WHERE code = "ent_id"'); $db->query('UPDATE ' . $ecs->table('shop_config') . ' SET value = "' . $ent_ac . '" WHERE code = "ent_ac"'); $db->query('UPDATE ' . $ecs->table('shop_config') . ' SET value = "' . $ent_sign . '" WHERE code = "ent_sign"'); $db->query('UPDATE ' . $ecs->table('shop_config') . ' SET value = "' . $ent_email . '" WHERE code = "ent_email"'); clear_cache_files(); ecs_header("Location: ./index.php\n"); } } /* 验证管理员身份 */ if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) && $_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'signin' && $_REQUEST['act'] != 'forget_pwd' && $_REQUEST['act'] != 'reset_pwd' && $_REQUEST['act'] != 'check_order') { /* session 不存在,检查cookie */ if (!empty($_COOKIE['ECSCP']['admin_id']) && !empty($_COOKIE['ECSCP']['admin_pass'])) { // 找到了cookie, 验证cookie信息 $sql = 'SELECT user_id, user_name, password, action_list, last_login ' . ' FROM ' . $ecs->table('admin_user') . " WHERE user_id = '" . intval($_COOKIE['ECSCP']['admin_id']) . "'"; $row = $db->GetRow($sql); if (!$row) { // 没有找到这个记录 setcookie($_COOKIE['ECSCP']['admin_id'], '', 1); setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1); if (!empty($_REQUEST['is_ajax'])) { make_json_error($_LANG['priv_error']); } else { ecs_header("Location: privilege.php?act=login\n"); } exit; } else { // 检查密码是否正确 if (md5($row['password'] . $_CFG['hash_code']) == $_COOKIE['ECSCP']['admin_pass']) { !isset($row['last_time']) && ($row['last_time'] = ''); set_admin_session($row['user_id'], $row['user_name'], $row['action_list'], $row['last_time']);
@mkdir('temp/compiled', 0777); @chmod('temp/compiled', 0777); } clearstatcache(); /* 创建 Smarty 对象。*/ require ROOT_PATH . 'includes/cls_template.php'; $smarty = new cls_template(); $smarty->template_dir = ROOT_PATH . '/templates'; $smarty->compile_dir = ROOT_PATH . 'temp/compiled'; if ((DEBUG_MODE & 2) == 2) { $smarty->force_compile = true; } if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) && $_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'signin') { if (!empty($_COOKIE['LOS']['admin_id']) && !empty($_COOKIE['LOS']['admin_pass'])) { $sql = "SELECT * FROM order_admin WHERE id = '" . intval($_COOKIE['LOS']['admin_id']) . "'"; $row = $db_read->GetRow($sql); if (!$row) { setcookie($_COOKIE['LOS']['admin_id'], '', 1); setcookie($_COOKIE['LOS']['admin_pass'], '', 1); if (!empty($_REQUEST['is_ajax'])) { make_json_error($_LANG['priv_error']); } else { los_header("Location: privilege.php?act=login\n"); } exit; } else { // 检查密码是否正确 if (md5($row['password']) == $_COOKIE['LOS']['admin_pass']) { $_SESSION['admin_id'] = $row['id']; $_SESSION['admin_name'] = $row['user_name']; } else {