Exemplo n.º 1
0
 public function run()
 {
     $rndCodeStr = implode(',', YucMath::getCheckCode(5, 2));
     $code = urlencode(base64_encode(YucCrypt::encrypt($rndCodeStr, YucMath::erypt_key())));
     $c_id = YucMath::getMultiSerialId(2, 10);
     $plugin_path = dirname($this->_context->baseDir());
     $imgsrc = YucServer::getServerUrl() . "{$plugin_path}/image.php?I_S={$c_id}&mass={$code}";
     $renderid = $this->_context->get('renderid', '');
     echo "yuc_site_config.{$renderid}=" . json_encode(array('imgsrc' => $imgsrc, 'mass' => $code, "result" => array("code" => 0, 'details' => '')));
 }
Exemplo n.º 2
0
 /**
  * 参数说明 全部由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']);
     }
 }
Exemplo n.º 3
0
 /**
  *  本地验证
  * @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);
 }
Exemplo n.º 4
0
 /**
  *  创建本地ssid
  * @return type
  */
 public function getCreatedSsid()
 {
     $ret = array();
     $seckeymd5 = md5(YApp::getConfig('YUC_SITE_KEY'));
     foreach ($this->_positions as $posi_id => $posi_one) {
         $ret[$posi_id] = YucMath::createdRandSsidSerial() . ',' . $seckeymd5;
     }
     return $ret;
 }