コード例 #1
0
ファイル: image.php プロジェクト: saintho/phpdisk
 /**
  * 参数说明 全部由URL 接入参数值 目前提供参数为以下
  */
 public function run()
 {
     $is = $this->_context->get('I_S', '');
     $iw = 'YucMedia CopyRight ' . date('Y') . ' <Local>';
     $mass = $this->_context->get('mass', '');
     $apiParam = $this->getApiParamValue();
     if ($is != '' && $mass !== '') {
         $code = explode(',', YucCrypt::decrypt(base64_decode(urldecode($mass)), YucMath::erypt_key()));
         YucCaptcha::showComplexImage($code, 20, 5, 2, $apiParam['width'], $apiParam['height'], $apiParam['fontsize'], $iw);
     } else {
         YucCaptcha::showImgDesc('Access defined!', $iw, $apiParam['width'], $apiParam['height'], $apiParam['fontsize']);
     }
 }
コード例 #2
0
ファイル: YucCaptcha.php プロジェクト: saintho/phpdisk
 /**
  *  本地验证
  * @param type $ssid
  * @param type $result
  * @return type
  */
 public static function sendVerifyLocalRequest($ssid, $result)
 {
     $mass = self::context('yuc_mass', NULL, '');
     $code = YucCrypt::decrypt(base64_decode(urldecode($mass)), YucMath::erypt_key());
     $code = str_replace(",", "", $code);
     if ($code != '' && strtolower($code) === strtolower($result)) {
         self::$_result = 1;
         self::$_code = '';
         self::$_details = '验证码输入正确';
     } else {
         self::$_result = 0;
         self::$_code = 'E_LOCALVALID_001';
         self::$_details = '验证码验证失败';
     }
     YLog::Write('本地验证完成,输入结果为:' . $result . ';' . '', YLog::DEBUG);
 }