Esempio n. 1
0
 public function PreparationSearchArray()
 {
     $this->search_array['sort'] = $this->config['user_int_default_sort'];
     $this->search_array['subsort'] = $this->config['user_int_default_subsort'];
     // addition paran in search block
     if ($GLOBALS['action'] == 'auto' && !empty($_SERVER['HTTP_REFERER'])) {
         $this->search_array = array_merge($this->search_array, UrlParse(empty($_COOKIE['auto_settings']) ? '' : $_COOKIE['auto_settings']), array_intersect_key(UrlParse($_SERVER['HTTP_REFERER']), $this->search_array));
     } else {
         $this->search_array = array_merge($this->search_array, UrlParse(empty($_COOKIE['auto_settings']) ? '' : $_COOKIE['auto_settings']), array_intersect_key($_GET, $this->search_array));
     }
     if ($this->use_country && empty($this->search_array['country_id'])) {
         $this->search_array['region_id'] = 0;
         $this->search_array['city_id'] = 0;
     } elseif ($this->use_region && !$this->search_array['region_id']) {
         $this->search_array['city_id'] = 0;
     }
     if (empty($this->search_array['mark_id'])) {
         $this->search_array['model_id'] = 0;
     }
 }
Esempio n. 2
0
 public function run($prj = '')
 {
     $mod = '';
     $act = '';
     UrlParse($prj, $mod, $act);
     $isnologinerr = false;
     global $G_X;
     $noyz = @$G_X['allow_project'][$prj]['nologin'][$mod];
     if (!is_array($noyz)) {
         $noyz = array();
     }
     $actstr = $act == '' ? 'index' : $act;
     $actstr .= "Action";
     //echo $G_X['modstr']."<br />";
     $session = XSession::Get("TA_user");
     //开发阶段取消验证
     //if(!in_array($act, $noyz))
     if (!in_array($act, $noyz)) {
         //进行权限校验
         $session = XSession::Get("TA_user");
         if ($session) {
             $app_array = $session['app_array'];
             $session['app_array'] = $app_array == 'All' ? 'All' : eval("return {$app_array};");
             if ($session['app_array'] != 'All') {
                 $session['app_array'] = array_merge($session['app_array'], $G_X["allow_project"][$prj]["filter"]);
             }
         }
         if ($session == null) {
             if ($mod == 'admin') {
                 header("Location:" . PUC_BASE_URL . "admin/login");
                 return;
             }
             if ($prj == 'psys') {
                 header("Location:" . PSYS_BASE_URL . "index/login");
                 return;
             }
             if (empty($prj)) {
                 $prj = "pweb";
             }
             $mod = "index";
             $act = "index";
             $isnologinerr = true;
         } elseif (!ckAccess($session['app_array'], $prj, $mod, $act, $G_X['all_privilege']['url'])) {
             if (substr($actstr, 0, 4) == "ajax" || req("ajax")) {
                 exit(json_encode(array('result' => 'ERROR', 'msg' => MsgInfoConst::GetMsg(2004, 'en'), 'msgcode' => 2004)));
             }
             echo "<script>window.location.href='/jump/index?type=errors&message=privilege';</script>";
             return;
         }
     }
     $G_X['modstr'] = $mod;
     $G_X['actstr'] = $act;
     $G_X['prjstr'] = $prj;
     $actstr = $act . "Action";
     $modstr = $mod . "Controller";
     $file = constant(strtoupper($prj) . "_PATH") . "controller" . DIRECTORY_SEPARATOR . $modstr . ".php";
     if (file_exists($file)) {
         require_once $file;
     } else {
         header('HTTP/1.1 404 Not Found');
         //header("status: 404 Not Found");
         exit;
         //print_r($G_X);
         //exit("文件不存在---->".$file);
     }
     $modobj = new $modstr();
     if ($modobj->isajax) {
         //判断访问为ajax请求
         try {
             if ($isnologinerr) {
                 $return = array('result' => 'ERROR', 'msg' => MsgInfoConst::GetMsg(2005, $modobj->culture), 'msgcode' => 2005);
             } else {
                 $return = $modobj->{$actstr}();
             }
         } catch (Exception $e) {
             $return['result'] = 'ERROR';
             //SUCCESS表示成功
             $return['msg'] = $e->getMessage();
         }
         header('Content-type: application/json');
         exit(json_encode($return));
     } else {
         try {
             $modobj->{$actstr}();
         } catch (Exception $e) {
             exit($e->getMessage());
         }
     }
     if (in_array($modobj->forward, array("msg", "msg_nologin", "ajaxmsg"))) {
         $modobj->smarty->display($modobj->forward . ".html");
     } else {
         $html = $mod . DIRECTORY_SEPARATOR . $modobj->forward . ".html";
         $modobj->smarty->display($html);
     }
 }
Esempio n. 3
0
     }
     if (!auto_check_email($data['user_email']) || strlen($data['text']) < 10 || strlen($data['subj']) < 5) {
         $error = true;
     }
     if ($error) {
         die("Error");
     }
     $mail->send($data['user_email'], $data['subj'], $data['text']);
     if ($mail->send_error) {
         die("Error");
     }
     echo "ok";
     break;
 case "email_auto":
     $error = false;
     $data = array_map_recursive('urldecode', UrlParse($_REQUEST['data']));
     if (!$id) {
         $error = true;
     } else {
         $email = $base->SelectOne('auto_autos', array("email"), array("id" => $id));
     }
     if (empty($email['email'])) {
         $error = true;
     }
     include_once DLE_CLASSES . 'mail.class.php';
     $mail = new dle_mail($config);
     if (!$is_logged) {
         if (!auto_check_email($data['from_email'])) {
             $error = true;
         }
         if (!$data['from_name']) {
Esempio n. 4
0
 public function run($prj = '')
 {
     $mod = '';
     $act = '';
     UrlParse($prj, $mod, $act);
     $isnologinerr = false;
     $prj = strtolower($prj);
     $mod = strtolower($mod);
     $act = strtolower($act);
     global $G_X;
     $noyz = @$G_X['allow_project'][$prj]['nologin'];
     $noyz = isset($noyz[$mod]) ? $noyz[$mod] : array();
     $noyz = is_array($noyz) ? $noyz : array();
     $actstr = $act == '' ? 'index' : $act;
     $actstr .= "Action";
     //echo $G_X['modstr']."<br />";
     //$session=XSession::Get("Cur_X_User");
     //开发阶段取消验证
     //if(!in_array($act, $noyz))
     if (!in_array($act, $noyz)) {
         //进行权限校验
         $session = XSession::Get("TA_user") || XSession::Get("Cur_X_User");
         if ($session == null) {
             if ($prj == 'psys') {
                 $mod = "account";
                 $act = "login";
             } else {
                 if (empty($prj)) {
                     $prj = "pc";
                 }
                 $mod = "index";
                 $act = "index";
                 $isnologinerr = true;
             }
         } elseif (isset($session['qxlist']) && !ckAccess($session['qxlist'], $prj, $mod, $act, $G_X['all_privilege']['url'])) {
             //print_r($session['qxlist']);
             //exit;
             if (substr($actstr, 0, 4) == "ajax" || req("ajax")) {
                 exit(json_encode(array('result' => 'ERROR', 'msg' => '您没有权限', 'msgcode' => 2004)));
             }
             header("Location:/html/noaccess.html");
             return;
         }
     }
     $G_X['modstr'] = $mod;
     $G_X['actstr'] = $act;
     $G_X['prjstr'] = $prj;
     $actstr = $act . "Action";
     $modstr = $mod . "Controller";
     $file = constant(strtoupper($prj) . "_PATH") . "controller" . DIRECTORY_SEPARATOR . $modstr . ".php";
     if (file_exists($file)) {
         require_once $file;
     } else {
         header('HTTP/1.1 404 Not Found');
         //header("status: 404 Not Found");
         exit;
         //print_r($G_X);
         //exit("文件不存在---->".$file);
     }
     $modobj = new $modstr();
     if ($modobj->isajax) {
         //判断访问为ajax请求
         try {
             if ($isnologinerr) {
                 $return = array('result' => 'ERROR', 'msg' => '您没有登录', 'msgcode' => 2005);
             } else {
                 $return = $modobj->{$actstr}();
             }
         } catch (Exception $e) {
             $return['result'] = 'ERROR';
             //SUCCESS表示成功
             $return['msg'] = $e->getMessage();
         }
         header('Content-type: application/json');
         exit(json_encode($return));
     } else {
         try {
             $modobj->{$actstr}();
         } catch (Exception $e) {
             exit($e->getMessage());
         }
     }
     if (in_array($modobj->forward, array("msg", "msg_nologin", "ajaxmsg"))) {
         $html = 'shared' . DIRECTORY_SEPARATOR . $modobj->forward . ".html";
     } else {
         $html = $mod . DIRECTORY_SEPARATOR . $modobj->forward . ".html";
     }
     $modobj->smarty->display($html);
 }