代码拉取完成,页面将自动刷新
<?php
/**
* ECSHOP 账户安全
* ============================================================================
* * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: niqingyang $
* $Id: security.php 17217 2015-07-27 06:29:08Z niqingyang $
*/
define('IN_ECS', true);
require (dirname(__FILE__) . '/includes/init.php');
/* 载入语言文件 */
require_once (ROOT_PATH . 'languages/' . $_CFG['lang'] . '/user.php');
/* 登录密码 */
define('RECHARGE_PASSWORD', 'e10adc3949ba59abbe56e057f20f883e');
$ui_arr = array();
$ui_arr[] = 'default';
$affiliate = unserialize($GLOBALS['_CFG']['affiliate']);
$smarty->assign('affiliate', $affiliate);
$user_id = $_SESSION['user_id'];
$back_act = '';
$action = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : 'default';
// /* 未登录处理 */
// if(empty($_SESSION['user_id']))
// {
// $query_string = $_SERVER['QUERY_STRING'];
// if(! empty($query_string))
// {
// $back_act = 'user.php?' . strip_tags($query_string);
// }
// $action = 'login';
// header("Location: user.php?act=login");
// }
/* 如果是显示页面,对页面进行相应赋值 */
if(in_array($action, $ui_arr) || true)
{
assign_template();
$position = assign_ur_here(0, $_LANG['user_center']);
$smarty->assign('page_title', $position['title']); // 页面标题
$smarty->assign('ur_here', $position['ur_here']);
$sql = "SELECT value FROM " . $ecs->table('shop_config') . " WHERE id = 419";
$row = $db->getRow($sql);
$car_off = $row['value'];
$smarty->assign('car_off', $car_off);
/* 是否显示积分兑换 */
if(! empty($_CFG['points_rule']) && unserialize($_CFG['points_rule']))
{
$smarty->assign('show_transform_points', 1);
}
$smarty->assign('helps', get_shop_help()); // 网店帮助
$smarty->assign('data_dir', DATA_DIR); // 数据目录
$smarty->assign('action', $action);
$smarty->assign('lang', $_LANG);
}
/* 路由 */
// $smarty->assign('is_security', 'true');
$function_name = 'action_' . $action;
if(! function_exists($function_name))
{
$function_name = "action_default";
}
call_user_func($function_name);
return;
/* 路由 */
/**
* 账户安全中心
*/
function action_default ()
{
// 获取全局变量
$user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $GLOBALS['user_id'];
/* 验证登录 */
if ($_SESSION['recharge_password'] != RECHARGE_PASSWORD) {
header('Location: clerk_account.php?act=login');
}
$smarty->assign('action', 'default');
$smarty->display('clerk_account.dwt');
}
/**
* 登录界面
*/
function action_login ()
{
// 获取全局变量
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $GLOBALS['user_id'];
// // 获取验证方式
// $validate_types = get_validate_types($user_id);
// $smarty->assign('validate_types', $validate_types);
// $smarty->assign('step', 'step_1');
$smarty->display('clerk_account.dwt');
}
/**
* 登录处理
*/
function action_act_login ()
{
// 获取全局变量
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $GLOBALS['user_id'];
$password = md5(trim($_POST['password']));
if ($password == RECHARGE_PASSWORD) {
$_SESSION['recharge_password'] = $password;
show_message('登录成功', '进入充值中心', 'clerk_account.php', 'info');
// echo "OK";
}else{
show_message('登录失败', '返回上一页', 'clerk_account.php?act=login', 'info');
// echo "no";
}
}
/**
* 退出登录
*/
function action_logout ()
{
// 获取全局变量
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $GLOBALS['user_id'];
unset($_SESSION['recharge_password']);
show_message('成功退出', '重新登录', 'clerk_account.php?act=login', 'info');
}
/**
* 充值处理
*/
function action_act_account ()
{
// 获取全局变量
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $GLOBALS['user_id'];
/* 验证登录 */
if ($_SESSION['recharge_password'] != RECHARGE_PASSWORD)
{
show_message('非法操作!', '登录', 'clerk_account.php?act=login', 'info');
}
/* 调整金额 */
$user_name = !empty($_POST['user_name']) ? trim($_POST['user_name']) : '';
$user_money = floatval($_POST['add_sub_user_money']) * abs(floatval($_POST['user_money']));
if ($user_money == 0)
{
show_message('调整金额不能为“0”', '返回上一页', 'clerk_account.php', 'info');
}
$change_desc = '店员操作调整资金';
$user_id = $db->getOne("SELECT user_id FROM " . $GLOBALS['ecs']->table('users') . "WHERE user_name = '$user_name'");
if (!empty($user_id)) {
log_account_change($user_id, $user_money, '', '', '', $change_desc, ACT_ADJUSTING);
show_message('充值成功', '返回上一页', 'clerk_account.php', 'info');
}else{
show_message('输入的用户名不存在!', '返回上一页', 'clerk_account.php', 'info');
}
clear_cache_files();
$smarty->display('clerk_account.dwt');
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。