Beispiel #1
0
 /**
  * 
  * 支付密码检测
  */
 function checkPayPwd()
 {
     $payPwd = get_post_value('payPwd');
     //echo 'payPwd=>'.$payPwd;
     $user_id = 1;
     //测试user_id
     $pay = new Pays();
     $checkPayPwd = $pay->checkPayPwd($payPwd, $user_id);
     if ($checkPayPwd) {
         //检验支付密码正确
         session_start();
         if (isset($_SESSION["countPayErrorTimes"])) {
             $_SESSION["countPayErrorTimes"] = 0;
             $errorTimes = $_SESSION["countPayErrorTimes"];
         }
         $this->assign('message', $errorTimes);
         $this->setReturnType('message');
     } else {
         session_start();
         if (isset($_SESSION["countPayErrorTimes"])) {
             $_SESSION["countPayErrorTimes"] = $_SESSION["countPayErrorTimes"] + 1;
             if ($_SESSION["countPayErrorTimes"] >= 5) {
                 //错误次数大于5次 修改支付状态
                 $this->lockPayStatus();
             }
             $errorTimes = $_SESSION["countPayErrorTimes"];
         } else {
             $_SESSION["countPayErrorTimes"] = 1;
             $errorTimes = $_SESSION["countPayErrorTimes"];
         }
         $this->assign('message', $errorTimes);
         $this->setReturnType('message');
     }
 }