コード例 #1
0
ファイル: Verify.php プロジェクト: saintho/phpdisk
 /**
  *  获取校验结果
  * @return type
  */
 public static function getVerifyResult()
 {
     $context = new Context();
     $typhoon = new Typhoon();
     if ($typhoon->isValid()) {
         $ssid = $typhoon->_ssid;
         $name = $typhoon->_name;
         $value = $context->get($name, '');
         if ($value != '') {
             if ($typhoon->_request_type == 1) {
                 $ret = Valid::sendVerifyRemoteRequest($ssid, $value, $typhoon->_diff_time);
             } else {
                 $ret = Valid::sendVerifyLocalRequest($ssid, $value);
             }
             self::$_result = Valid::getResult();
             self::$_code = Valid::getCode();
             self::$_details = Valid::getDetails();
         } else {
             self::$_result = 0;
             self::$_code = 'E_VALUEEMPTY_001';
             self::$_details = '验证码不可以为空';
         }
     } else {
         self::$_result = 0;
         self::$_code = 'E_PARAM_001';
         self::$_details = '重要参数传递错误';
     }
     return self::$_result === 1 ? TRUE : FALSE;
 }