public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION[C("USER_AUTH_ID")]) { echo '<script language="javascript"> self.location="index.php?mod=public&act=login"; </script>'; } elseif ($_SESSION[C("USER_AUTH_ID")]) { //$data = array('data'=>array('您尚未有此权限'), 'link'=>$_SERVER['HTTP_REFERER']); //goErrMsgPage($data);exit; echo '您尚未有此权限'; exit; } else { //$data = array('data'=>array('还未登陆!'), 'link'=>'index.php?mod=public&act=login'); //goErrMsgPage($data);exit; echo '还未登陆!'; exit; } exit; } } self::$_username = isset($_SESSION['userName']) ? $_SESSION['userName'] : ""; self::$_userid = isset($_SESSION[C("USER_AUTH_ID")]) ? $_SESSION[C("USER_AUTH_ID")] : 0; self::$_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; self::$_systemid = C('AUTH_SYSTEM_ID'); //初始化smarty require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/v1/'; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c/'; $this->smarty->config_dir = WEB_PATH . 'smarty/configs/'; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache/'; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', self::$_username); $this->smarty->assign('_userid', self::$_userid); //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); }
public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); #################### smarty初始化 start #################### require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/v1' . DIRECTORY_SEPARATOR; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c' . DIRECTORY_SEPARATOR; $this->smarty->config_dir = WEB_PATH . 'smarty/configs' . DIRECTORY_SEPARATOR; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache' . DIRECTORY_SEPARATOR; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; #################### smarty初始化 end #################### if (C('IS_AUTH_ON') === true) { if (AuthUser::checkLogin($mod, $act)) { //$this->error('请先登录', 'index.php?mod=public&act=login'); } } if (!in_array($act, array('login', 'logout', 'userLogin'))) { $now_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //记录当前页面url setcookie('now_url', $now_url, time() + 86400); } $this->_menul1 = isset($_SESSION['menul1']) ? $_SESSION['menul1'] : array(); $this->_menul2 = isset($_SESSION['menul2']) ? $_SESSION['menul2'] : array(); $this->_menul3 = isset($_SESSION['menul3']) ? $_SESSION['menul3'] : array(); $this->_username = isset($_SESSION['userCnName']) ? $_SESSION['userCnName'] : "xx"; $this->_userid = isset($_SESSION['userId']) ? $_SESSION['userId'] : 0; $this->_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; $this->_systemid = '12'; //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('curusername', $_SESSION['userName']); //设置当前用户名 $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', $this->_username); $this->smarty->assign('_userid', $this->_userid); $this->smarty->assign('menul1', $this->_menul1); $this->smarty->assign('menul2', $this->_menul2); $this->smarty->assign('menul3', $this->_menul3); //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); }
/** * OrderTranUpsAct::act_export_ups_xml_info() * 导出选中的UPS美国专线订单信息(XML格式) * @param string $ids 订单编号 * @return array */ public static function act_export_ups_xml_info() { // $ids = isset($_REQUEST["ids"]) ? $_REQUEST["ids"] : ""; // $ids = array(419835,419755); // if (empty($ids)) { // self::$errCode = 10000; // self::$errMsg = "订单参数有误"; // return false; // } $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10002; self::$errMsg = "对不起,您暂无权使用此功能!"; return false; } $res = OrderTranUpsModel::export_ups_xml_info($ids); self::$errCode = OrderTranUpsModel::$errCode; self::$errMsg = OrderTranUpsModel::$errMsg; return $res; }
public function __construct() { session_start(); $mod = trim($_GET['mod']); $act = trim($_GET['act']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION[C("USER_AUTH_ID")]) { echo '<script language="javascript"> self.location="index.php?mod=public&act=login"; </script>'; } elseif ($_SESSION[C("USER_AUTH_ID")]) { if (!empty($_GET['callback'])) { $callback = $_GET['callback']; exit($callback . '({"errCode":"176", "errMsg":"亲,您尚未有此权限"})'); return false; } echo '<script language="javascript"> alert("亲,您尚未有此权限!"); history.back(); </script>'; } else { if (!empty($_GET['callback'])) { $callback = $_GET['callback']; exit($callback . '({"errCode":"043", "errMsg":"亲,您还没有登录哦!"})'); return false; } echo '<script language="javascript"> alert("亲,您还没有登录哦!"); self.location="index.php?mod=public&act=login"; </script>'; } exit; } } }
/** * ApiCompetenceAct::act_delApiCompetence() * 删除API开放授权 * @param int $id 开放权限ID * @return bool */ public function act_delApiCompetence() { $gid = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 30001; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($gid) || !is_numeric($gid)) { self::$errCode = 30000; self::$errMsg = "开放用户权限ID有误!"; return false; } $res = ApiCompetenceModel::delApiCompetence($gid); self::$errCode = ApiCompetenceModel::$errCode; self::$errMsg = ApiCompetenceModel::$errMsg; return $res; }
public function __construct() { @session_start(); $mod = @trim($_GET['mod']); $act = @trim($_GET['act']); #################### smarty初始化 start #################### require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/v1' . DIRECTORY_SEPARATOR; //模板文件目录 $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c' . DIRECTORY_SEPARATOR; //编译后文件目录 $this->smarty->config_dir = WEB_PATH . 'smarty/configs' . DIRECTORY_SEPARATOR; //配置文件目录 $this->smarty->cache_dir = WEB_PATH . 'smarty/cache' . DIRECTORY_SEPARATOR; //缓存文件目录 $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; #################### smarty初始化 end #################### $hcAdmin = @json_decode(_authcode($_COOKIE['hcAdmin']), true); $hcUser = @json_decode(_authcode($_COOKIE['hcUser']), true); $loginName = ''; if (isset($_REQUEST["PHPSESSID"])) { session_id($_REQUEST["PHPSESSID"]); } else { if (C('IS_AUTH_ON') === true) { //权限控制 if (empty($hcAdmin) && empty($hcUser)) { include_once WEB_PATH . 'lib/class/authuser.class.php'; $_SESSION['loginStatus'] = "out"; //修改退出登录标志 //****判断登录 if (!AuthUser::checkLogin($mod, $act)) { if ($mod == "backstagesIndex") { redirect_to(WEB_URL . "index.php?mod=backstagesIndex&act=index"); } else { redirect_to(WEB_URL . "index.php?mod=index&act=index"); } } } if (empty($hcAdmin)) { include_once WEB_PATH . 'lib/class/authuser.class.php'; $_SESSION['loginStatus'] = "out"; //修改退出登录标志 //****判断登录 if (!AuthUser::checkLogin($mod, $act)) { redirect_to(WEB_URL . "index.php?mod=backstagesLogin&act=index"); } } if (!empty($hcAdmin)) { include_once WEB_PATH . 'lib/class/authuser.class.php'; //****判断登录 if (AuthUser::checkLogin($mod, $act)) { // redirect_to(WEB_URL."index.php?mod=index&act=index"); } //后台登陆信息 $loginName = $hcAdmin['userCnName']; } } else { $loginName = $hcAdmin['userCnName']; } $this->smarty->assign(array("loginName" => $loginName)); //重新登录时,页面跳转到之前的页面 if (!in_array($act, array('login', 'logout', 'userLogin'))) { $now_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //记录当前页面url setcookie('now_url', $now_url, time() + 86400); } //以下三个变量在登录成功的时候写入SESSION $this->_username = isset($hcUser['email']) ? $hcUser['email'] : (isset($hcAdmin['userCnName']) ? $hcAdmin['userCnName'] : "XX"); //登录的中文名字 $this->_userid = isset($hcUser['id']) ? $hcUser['id'] : (isset($hcAdmin['userId']) ? $hcAdmin['userId'] : 0); $this->_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; $this->_systemid = '12'; //初始化提交过来的变量(post and get) 用与搜索后条件不消失,或者表单信息不消失 if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('curusername', @$_SESSION['userName']); //设置当前用户名 $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', $this->_username); //中文名字 $this->smarty->assign('_userid', $this->_userid); //用户id $this->smarty->assign('loginStatus', @$_SESSION['loginStatus']); //用户登录状态 //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); } }
/** * TrackEmailAccountAct::act_delTrackEmailAccount() * 删除客服邮件帐号 * @param int $id 客服邮件帐号ID * @return bool */ public function act_delTrackEmailAccount() { $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 30001; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 30000; self::$errMsg = "客服邮件帐号ID有误!"; return false; } $res = TrackEmailAccountModel::delTrackEmailAccount($id); self::$errCode = TrackEmailAccountModel::$errCode; self::$errMsg = TrackEmailAccountModel::$errMsg; return $res; }
/** * CommonAct::ajaxAccess() * 同域ajax异步调用权限控制 * @return bool */ public static function ajaxAccess() { $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; return AuthUser::checkLogin($mod, $act); }
/** * CountriesShipAct::act_delCountriesShip() * 删除运输方式国家 * @param int $id 运输方式国家ID * @return bool */ public function act_delCountriesShip() { $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10001; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 10000; self::$errMsg = "运输方式国家ID有误!"; return false; } $res = CountriesShipModel::delCountriesShip($id); self::$errCode = CountriesShipModel::$errCode; self::$errMsg = CountriesShipModel::$errMsg; return $res; }
public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION[C("USER_AUTH_ID")]) { echo '<script language="javascript"> self.location="index.php?mod=public&act=login"; </script>'; } elseif ($_SESSION[C("USER_AUTH_ID")]) { if (!empty($_GET['callback'])) { $callback = $_GET['callback']; exit($callback . '({"errCode":"176", "errMsg":"亲,您尚未有此权限"})'); return false; } echo '<script language="javascript"> alert("亲,您尚未有此权限!"); history.back(); </script>'; } else { if (!empty($_GET['callback'])) { $callback = $_GET['callback']; exit($callback . '({"errCode":"043", "errMsg":"亲,您还没有登录哦!"})'); return false; } echo '<script language="javascript"> alert("亲,您还没有登录哦!"); self.location="index.php?mod=public&act=login"; </script>'; } exit; } } self::$_username = isset($_SESSION['userName']) ? $_SESSION['userName'] : ""; self::$_userid = isset($_SESSION[C("USER_AUTH_ID")]) ? $_SESSION[C("USER_AUTH_ID")] : 0; self::$_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; self::$_systemid = C('AUTH_SYSTEM_ID'); require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/'; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c/'; $this->smarty->config_dir = WEB_PATH . 'smarty/configs/'; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache/'; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', self::$_username); $this->smarty->assign('_userid', self::$_userid); //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); }
public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION['userId']) { echo '<script language="javascript"> self.location="index.php?mod=public&act=login"; </script>'; } elseif ($_SESSION['userId']) { $AccessList = AuthUser::getAccessList(); if (empty($AccessList)) { header('Location: index.php?mod=public&act=logout'); exit; } else { $slice_AccessList = array_slice($AccessList, 0, 1); foreach ($slice_AccessList as $akey => $aValue) { $relocation = 'index.php?mod=' . $akey . '&act=' . $aValue[0]; } echo '<script language="javascript"> alert("亲,您尚未有此权限!"); history.go(-1); </script>'; } } else { echo '<script language="javascript"> alert("亲,您还没有登录哦!"); self.location="index.php?mod=public&act=login"; </script>'; } exit; } } if (!in_array($act, array('login', 'logout', 'userLogin'))) { $now_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //记录当前页面url setcookie('now_url', $now_url, time() + 3600); //print_r($_COOKIE['now_url']);exit; } self::$_username = isset($_SESSION['userName']) ? $_SESSION['userName'] : ""; self::$_userCNname = isset($_SESSION['userCnName']) ? $_SESSION['userCnName'] : ""; self::$_userid = isset($_SESSION['userId']) ? $_SESSION['userId'] : 0; self::$_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; self::$_systemid = '10'; //初始化smarty require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/v1' . DIRECTORY_SEPARATOR; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c' . DIRECTORY_SEPARATOR; $this->smarty->config_dir = WEB_PATH . 'smarty/configs' . DIRECTORY_SEPARATOR; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache' . DIRECTORY_SEPARATOR; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', self::$_username); $this->smarty->assign('_userCNname', self::$_userCNname); $this->smarty->assign('_userid', self::$_userid); //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); }
/** * ChannelPriceAct::act_delChannelPrice() * 删除运费价目 * @param int $id 运费价目ID * @return bool */ public function act_delChannelPrice() { $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $chname = isset($_POST["chname"]) ? $_POST["chname"] : ""; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 30002; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 30000; self::$errMsg = "运费价目ID有误!"; return false; } if (!in_array($chname, self::$chnameArr)) { self::$errCode = 30001; self::$errMsg = "渠道运费参数有误!"; return false; } $res = ChannelPriceModel::delChannelPrice($chname, $id); self::$errCode = ChannelPriceModel::$errCode; self::$errMsg = ChannelPriceModel::$errMsg; if (empty(self::$errCode)) { $cacheFee = TransOpenApiModel::updateCacheTableFee($chname, $data); } return $res; }
/** * WedoApiAct::act_orderExport() * 导出运德物流订单跟踪号信息 * @param string $timeNode 时间节点 * @return json string */ public function act_orderExport() { $uid = intval($_SESSION[C('USER_AUTH_SYS_ID')]); if (empty($uid)) { self::$errCode = 10001; self::$errMsg = "对不起,您尚未登录!"; return false; } $timeNode = isset($_GET['timeNode']) ? post_check(trim($_GET['timeNode'])) : ''; $condition = "1"; $condition .= " AND add_user_id = '{$uid}'"; if (!empty($timeNode)) { if (!in_array($timeNode, array('scanTime', 'addTime'))) { redirect_to("index.php?mod=wedoApi&act=orderExport"); } $startTime = isset($_GET['startTime']) ? strtotime(trim($_GET['startTime']) . " 00:00:00") : strtotime(date("Y-m-d", time()) . " 00:00:00"); $endTime = isset($_GET['endTime']) ? strtotime(trim($_GET['endTime']) . " 23:59:59") : strtotime(date("Y-m-d", time()) . " 23:59:59"); if ($startTime && $endTime) { $condition .= ' AND ' . $timeNode . " BETWEEN '" . $startTime . "' AND " . "'" . $endTime . "'"; } } $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10000; self::$errMsg = "对不起,您无跟踪号数据导出权限!"; return false; } $res = WedoApiModel::orderWedoExport($condition); self::$errCode = WedoApiModel::$errCode; self::$errMsg = WedoApiModel::$errMsg; return $res; }
public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION[C("USER_AUTH_ID")]) { echo '<script language="javascript"> self.location="index.php?mod=public&act=login"; </script>'; } elseif ($_SESSION[C("USER_AUTH_ID")]) { $res = AuthUser::fetchAuth(); $user_mod = ""; $user_act = ""; //print_r($res); //exit; while (list($key, $val) = each($res)) { $user_mod = $key; $user_act = $val[0]; break; } /* if (empty($user_mod) || empty($user_act)) { echo '<script language="javascript"> alert("亲,您尚未分配权限,请联系系统管理员分配!"); self.location="index.php?mod=public&act=logout"; </script>'; } else { echo '<script language="javascript"> alert("亲,您尚未有此权限,系统自动跳转到您有权限的页面!"); self.location="index.php?"; </script>'; } */ } else { echo '<script language="javascript"> alert("亲,您还没有登录哦!"); self.location="index.php?mod=public&act=login"; </script>'; } } } self::$_username = isset($_SESSION['userName']) ? $_SESSION['userName'] : ""; self::$_userid = isset($_SESSION[C("USER_AUTH_ID")]) ? $_SESSION[C("USER_AUTH_ID")] : 0; self::$_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; self::$_systemid = C('AUTH_SYSTEM_ID'); //初始化smarty require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/'; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c/'; $this->smarty->config_dir = WEB_PATH . 'smarty/configs/'; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache/'; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', self::$_username); $this->smarty->assign('_userid', self::$_userid); if (isset($_SESSION["userCnName"])) { $this->smarty->assign('userCnName', $_SESSION["userCnName"]); } //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); }
/** * TrackWarnInfoAct::act_trackNumberInfo() * 实时获取某个跟踪号的跟踪信息 * @param integer $carrierId 运输方式ID * @param integer $lan 跟踪语言 * @param string $trackNumber 跟踪号 * @return json string */ public function act_trackNumberInfo() { $carrierId = isset($_POST["tid"]) ? intval($_POST["tid"]) : 0; $trackNumber = isset($_POST["trackNumber"]) ? post_check($_POST["trackNumber"]) : ""; $lan = isset($_POST["lan"]) ? intval($_POST["lan"]) : 10000; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10002; self::$errMsg = "对不起,您无实时跟踪号详细数据查看权限!"; return false; } if (empty($carrierId) || !is_numeric($carrierId)) { self::$errCode = "运输方式ID有误"; self::$errMsg = 10000; return false; } if (empty($trackNumber)) { self::$errCode = "跟踪号有误!"; self::$errMsg = 10001; return false; } $res['trackInfo'] = TrackWarnInfoModel::trackNumberInfo($carrierId, $trackNumber, $lan); $res['countryInfo'] = array(); self::$errCode = TrackWarnInfoModel::$errCode; self::$errMsg = TrackWarnInfoModel::$errMsg; return $res; }
/** * CarrierManageAct::act_delCarrierManage() * 删除运输方式 * @param int $id 运输方式ID * @return bool */ public function act_delCarrierManage() { $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $status = isset($_POST["status"]) ? trim($_POST["status"]) : ""; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10002; self::$errMsg = "对不起,您无数据(禁用或启用)权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 10000; self::$errMsg = "运输方式ID有误!"; return false; } if (!in_array($status, array(0, 1))) { self::$errCode = 10001; self::$errMsg = "状态参数有误!"; return false; } $res = CarrierManageModel::delCarrierManage($id, $status); self::$errCode = CarrierManageModel::$errCode; self::$errMsg = CarrierManageModel::$errMsg; return $res; }
public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION['userId']) { echo '<script language="javascript"> self.location="index.php?mod=public&act=login"; </script>'; } elseif ($_SESSION['userId']) { $AccessList = AuthUser::getAccessList(); if (empty($AccessList)) { header('Location: index.php?mod=public&act=logout'); exit; } else { /*header('Location: index.php?mod=public&act=logout'); exit;*/ $slice_AccessList = array_slice($AccessList, 0, 1); foreach ($slice_AccessList as $akey => $aValue) { $relocation = 'index.php?mod=' . $akey . '&act=' . $aValue[0]; } //echo $relocation; exit; $relocation = C('USER_GO_URL'); echo '<script language="javascript"> alert("亲,您尚未有此权限!"); self.location="' . $relocation . '"; </script>'; } } else { echo '<script language="javascript"> alert("亲,您还没有登录哦!"); self.location="index.php?mod=public&act=login"; </script>'; } exit; } } self::$_username = isset($_SESSION['userName']) ? $_SESSION['userName'] : ""; self::$_userid = isset($_SESSION['userId']) ? $_SESSION['userId'] : 0; self::$_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; self::$_systemid = '12'; //初始化smarty require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/v1' . DIRECTORY_SEPARATOR; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c' . DIRECTORY_SEPARATOR; $this->smarty->config_dir = WEB_PATH . 'smarty/configs' . DIRECTORY_SEPARATOR; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache' . DIRECTORY_SEPARATOR; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; $this->smarty->assign('curusername', $_SESSION['userName']); //设置当前用户名 //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', self::$_username); $this->smarty->assign('_userid', self::$_userid); //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1; $this->smarty->assign("page", $this->page); }
public function __construct() { $mod = trim($_GET['mod']); $act = trim($_GET['act']); $modObj = ucfirst($mod . "View"); $actObj = "view_" . $act; if (!method_exists($modObj, $actObj)) { header("Location: 404.html"); exit; } $ref = empty($_SERVER["HTTP_HOST"]) ? "" : rawurlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); if (C('IS_AUTH_ON') === true) { if (!AuthUser::checkLogin($mod, $act)) { if (!$_SESSION[C("USER_AUTH_ID")]) { $error = rawurlencode("亲,您还没有登录哦!"); redirect_to("index.php?mod=public&act=login&msg={$error}&ref={$ref}"); } elseif ($_SESSION[C("USER_AUTH_ID")]) { $res = AuthUser::fetchAuth(); $user_mod = ""; $user_act = ""; foreach ($res as $key => $v) { $user_mod = $key; foreach ($v as $val) { $user_act = $val; if ($user_act == 'index') { break; } } if ($user_act == 'index') { break; } } if (empty($user_mod) || empty($user_act)) { $error = rawurlencode("亲,您尚未分配权限!"); redirect_to("index.php?mod=public&act=logout&msg={$error}"); } else { redirect_to("index.php?mod={$user_mod}&act={$user_act}"); } } else { $error = rawurlencode("亲,您还没有登录哦!"); redirect_to("index.php?mod=public&act=login&msg={$error}"); } } } self::$_username = isset($_SESSION['userName']) ? $_SESSION['userName'] : ""; self::$_userid = isset($_SESSION[C("USER_AUTH_ID")]) ? $_SESSION[C("USER_AUTH_ID")] : 0; self::$_companyid = isset($_SESSION['companyId']) ? $_SESSION['companyId'] : 0; self::$_systemid = C('AUTH_SYSTEM_ID'); //初始化smarty require WEB_PATH . 'lib/template/smarty/Smarty.class.php'; $this->smarty = new Smarty(); $this->smarty->template_dir = WEB_PATH . 'html/template/'; $this->smarty->compile_dir = WEB_PATH . 'smarty/templates_c/'; $this->smarty->config_dir = WEB_PATH . 'smarty/configs/'; $this->smarty->cache_dir = WEB_PATH . 'smarty/cache/'; $this->smarty->debugging = false; $this->smarty->caching = false; $this->smarty->cache_lifetime = 120; //初始化提交过来的变量(post and get) if (isset($_GET)) { foreach ($_GET as $gk => $gv) { $this->smarty->assign('g_' . $gk, $gv); } } if (isset($_POST)) { foreach ($_POST as $pk => $pv) { $this->smarty->assign('p_' . $pk, $pv); } } $this->smarty->assign('mod', $mod); //模块权限 $this->smarty->assign('act', $act); //操作权限 $this->smarty->assign('_username', self::$_username); $this->smarty->assign('_userid', self::$_userid); //初始化当前页码 $this->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : ''; $this->smarty->assign("page", $this->page); }
/** * TrackWarnStatAct::act_viewPic() * 列出某个运输方式各渠道各节点的(处理、时效)效率 * @param integer $carrierId 运输方式ID * @param integer $channelId 渠道ID * @param string $timeNode 时间条件 * @param string $statType 统计类型 * @return json string */ public function act_viewPic() { $condition = "1"; $title = ""; $countryStr = ""; $carrierId = isset($_POST['carrierId']) ? abs(intval($_POST['carrierId'])) : 0; $channelId = isset($_POST['channelId']) ? abs(intval($_POST['channelId'])) : 0; $countryId = isset($_POST['countryId']) ? abs(intval($_POST['countryId'])) : 0; $timeNode = isset($_GET['timeNode']) ? post_check(trim($_GET['timeNode'])) : ''; $statType = isset($_POST['statType']) ? post_check(trim($_POST['statType'])) : ''; $is_warn = isset($_POST['is_warn']) ? post_check(trim($_POST['is_warn'])) : 0; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10000; self::$errMsg = "对不起,您无跟踪号统计查看权限!"; return false; } if (empty($carrierId)) { self::$errCode = 10001; self::$errMsg = "运输方式参数有误"; return false; } if (empty($timeNode) || !in_array($timeNode, array('scanTime'))) { self::$errCode = 10002; self::$errMsg = "时间条件参数有误"; return false; } if (empty($statType) || !in_array($statType, array('nodeEff', 'nodeEffPer', 'nodeTime', 'internalTime', 'todayWarnPer'))) { self::$errCode = 10003; self::$errMsg = "统计类型参数有误"; return false; } if (!in_array($is_warn, array(0, 1))) { self::$errCode = 10004; self::$errMsg = "预警天数参数有误"; return false; } if (!empty($timeNode)) { $startTime = isset($_GET['startTime']) ? strtotime(trim($_GET['startTime']) . " 00:00:00") : strtotime(date("Y-m-d", time()) . " 00:00:00"); $endTime = isset($_GET['endTime']) ? strtotime(trim($_GET['endTime']) . " 23:59:59") : strtotime(date("Y-m-d", time()) . " 23:59:59"); if ($startTime && $endTime) { $condition .= ' AND ' . $timeNode . " BETWEEN '" . $startTime . "' AND " . "'" . $endTime . "'"; } } if (empty($countryId)) { $countryStr = " 国家"; } else { $res = TransOpenApiModel::getCountriesStandardById($countryId); $countryStr = " ({$res['countryNameCn']})"; } switch ($statType) { case "nodeEff": $title = $_GET['startTime'] == $_GET['endTime'] ? "{$_GET['startTime']}{$countryStr}各运输渠道节点处理效率统计" : "{$_GET['startTime']}——{$_GET['endTime']}{$countryStr}各运输渠道节点处理效率统计"; break; case "nodeTime": $title = $_GET['startTime'] == $_GET['endTime'] ? "{$_GET['startTime']}{$countryStr}各运输渠道节点处理时效统计" : "{$_GET['startTime']}——{$_GET['endTime']}{$countryStr}各运输渠道节点处理时效统计"; break; case "nodeEffPer": $title = $_GET['startTime'] == $_GET['endTime'] ? "{$_GET['startTime']}{$countryStr}各运输渠道节点处理效率百分比" : "{$_GET['startTime']}——{$_GET['endTime']}{$countryStr}各运输渠道节点处理效率百分比"; break; case "internalTime": $title = $_GET['startTime'] == $_GET['endTime'] ? "{$_GET['startTime']}{$countryStr}各运输渠道处理时效" : "{$_GET['startTime']}——{$_GET['endTime']}{$countryStr}各运输渠道处理时效"; break; } if (in_array($statType, array('todayWarnPer'))) { $res = ""; $nodeArr = TransOpenApiModel::getRandTrackNodeList($carrierId); foreach ($nodeArr as $key => $nd) { $condition = array(1, $timeNode, $startTime, $endTime, $key, "container" . $key); $res .= TrackWarnStatModel::getViewTodayPic($carrierId, $channelId, $statType, $condition, "{$nd['nodeName']}节点--各渠道预警率信息一览表", $is_warn, $countryId); } } else { $res = TrackWarnStatModel::getViewPic($carrierId, $channelId, $statType, $condition, $title, $is_warn, $countryId); } self::$errCode = TrackWarnStatModel::$errCode; self::$errMsg = TrackWarnStatModel::$errMsg; return $res; }
/** * TrackWarnExportAct::act_exportTrackInfo() * 导出跟踪信息 * @param integer $carrierId 运输方式ID * @param string $status 跟踪号状态 * @return json string */ public function act_exportTrackInfo() { $countryId = isset($_GET['countryId']) ? intval($_GET['countryId']) : 0; $carrierId = isset($_GET['carrierId']) ? intval($_GET['carrierId']) : 0; $channelId = isset($_GET['channelId']) ? intval($_GET['channelId']) : 0; $type = isset($_GET['type']) ? trim($_GET['type']) : ''; $key = isset($_GET['key']) ? post_check(trim($_GET['key'])) : ''; $timeNode = isset($_GET['timeNode']) ? post_check(trim($_GET['timeNode'])) : ''; $warnLevel = isset($_GET['warnLevel']) ? intval($_GET['warnLevel']) : ''; $is_warn = isset($_GET['is_warn']) ? intval($_GET['is_warn']) : 1; $status = isset($_GET['status']) ? intval($_GET['status']) : -1; $condition = "1"; if (!empty($countryId)) { $condition .= " AND a.countryId = '{$countryId}'"; } if ($status >= 0) { $condition .= " AND a.status = '{$status}'"; } if (!empty($carrierId)) { $condition .= " AND a.carrierId = '{$carrierId}'"; } if (!empty($channelId)) { $condition .= " AND a.channelId = '{$channelId}'"; } if (!empty($timeNode)) { if (!in_array($timeNode, array('scanTime', 'lastTime', 'trackTime'))) { redirect_to("index.php?mod=trackWarnInfo&act=index"); } $startTime = isset($_GET['startTime']) ? strtotime(trim($_GET['startTime']) . " 00:00:00") : strtotime(date("Y-m-d", time()) . " 00:00:00"); $endTime = isset($_GET['endTime']) ? strtotime(trim($_GET['endTime']) . " 23:59:59") : strtotime(date("Y-m-d", time()) . " 23:59:59"); if ($startTime && $endTime) { $condition .= ' AND a.' . $timeNode . " BETWEEN '" . $startTime . "' AND " . "'" . $endTime . "'"; } } if ($type && $key) { if (!in_array($type, array('orderSn', 'trackNumber', 'recordId'))) { redirect_to("index.php?mod=trackWarnInfo&act=index"); } $condition .= ' AND a.' . $type . " = '" . $key . "'"; } if ($warnLevel === 0) { //全部节点预警 $condition .= " AND a.warnLevel > 0"; } elseif ($warnLevel === -1) { //没预警节点 $condition .= " AND a.warnLevel = 0"; } elseif (!empty($warnLevel)) { //某个预警节点 $warnStr = str_pad($warnStr, $warnLevel - 1, "_", STR_PAD_LEFT); switch ($is_warn) { case 1: $condition .= " AND a.warnLevel like '{$warnStr}1%'"; break; case 2: $condition .= " AND a.warnLevel like '{$warnStr}0%' AND a.nodeEff like '{$warnStr}1%'"; break; case 3: $condition .= " AND a.nodeEff like '{$warnStr}1%'"; break; default: $condition .= " AND a.warnLevel like '{$warnStr}1%'"; } } $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10000; self::$errMsg = "对不起,您无跟踪号数据导出权限!"; return "fail"; } $res = TrackWarnExportModel::exportTrackNumberInfo($condition); self::$errCode = TrackWarnExportModel::$errCode; self::$errMsg = TrackWarnExportModel::$errMsg; return $res; }