diff --git a/addons/captcha/audio/F_A.mp3 b/addons/captcha/audio/F_A.mp3 deleted file mode 100755 index 90aa7c382..000000000 Binary files a/addons/captcha/audio/F_A.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_B.mp3 b/addons/captcha/audio/F_B.mp3 deleted file mode 100755 index af2fa091e..000000000 Binary files a/addons/captcha/audio/F_B.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_C.mp3 b/addons/captcha/audio/F_C.mp3 deleted file mode 100755 index 83566b97b..000000000 Binary files a/addons/captcha/audio/F_C.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_D.mp3 b/addons/captcha/audio/F_D.mp3 deleted file mode 100755 index ee685b080..000000000 Binary files a/addons/captcha/audio/F_D.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_E.mp3 b/addons/captcha/audio/F_E.mp3 deleted file mode 100755 index 353583ce9..000000000 Binary files a/addons/captcha/audio/F_E.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_F.mp3 b/addons/captcha/audio/F_F.mp3 deleted file mode 100755 index 62810c6f7..000000000 Binary files a/addons/captcha/audio/F_F.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_G.mp3 b/addons/captcha/audio/F_G.mp3 deleted file mode 100755 index d52639161..000000000 Binary files a/addons/captcha/audio/F_G.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_H.mp3 b/addons/captcha/audio/F_H.mp3 deleted file mode 100755 index de0b0bace..000000000 Binary files a/addons/captcha/audio/F_H.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_I.mp3 b/addons/captcha/audio/F_I.mp3 deleted file mode 100755 index 50d09f19c..000000000 Binary files a/addons/captcha/audio/F_I.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_J.mp3 b/addons/captcha/audio/F_J.mp3 deleted file mode 100755 index 647380efd..000000000 Binary files a/addons/captcha/audio/F_J.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_K.mp3 b/addons/captcha/audio/F_K.mp3 deleted file mode 100755 index c03d39feb..000000000 Binary files a/addons/captcha/audio/F_K.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_L.mp3 b/addons/captcha/audio/F_L.mp3 deleted file mode 100755 index d118a5cfe..000000000 Binary files a/addons/captcha/audio/F_L.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_M.mp3 b/addons/captcha/audio/F_M.mp3 deleted file mode 100755 index a253ebddf..000000000 Binary files a/addons/captcha/audio/F_M.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_N.mp3 b/addons/captcha/audio/F_N.mp3 deleted file mode 100755 index 6a612b6c6..000000000 Binary files a/addons/captcha/audio/F_N.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_O.mp3 b/addons/captcha/audio/F_O.mp3 deleted file mode 100755 index ceb35dac4..000000000 Binary files a/addons/captcha/audio/F_O.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_P.mp3 b/addons/captcha/audio/F_P.mp3 deleted file mode 100755 index cbe13027b..000000000 Binary files a/addons/captcha/audio/F_P.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_Q.mp3 b/addons/captcha/audio/F_Q.mp3 deleted file mode 100755 index 8fab925bf..000000000 Binary files a/addons/captcha/audio/F_Q.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_R.mp3 b/addons/captcha/audio/F_R.mp3 deleted file mode 100755 index af4bc5dcf..000000000 Binary files a/addons/captcha/audio/F_R.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_S.mp3 b/addons/captcha/audio/F_S.mp3 deleted file mode 100755 index 42d30c5f6..000000000 Binary files a/addons/captcha/audio/F_S.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_T.mp3 b/addons/captcha/audio/F_T.mp3 deleted file mode 100755 index 47ea6e664..000000000 Binary files a/addons/captcha/audio/F_T.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_U.mp3 b/addons/captcha/audio/F_U.mp3 deleted file mode 100755 index ba39f155e..000000000 Binary files a/addons/captcha/audio/F_U.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_V.mp3 b/addons/captcha/audio/F_V.mp3 deleted file mode 100755 index b8e8686e7..000000000 Binary files a/addons/captcha/audio/F_V.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_W.mp3 b/addons/captcha/audio/F_W.mp3 deleted file mode 100755 index 00cc2afe1..000000000 Binary files a/addons/captcha/audio/F_W.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_X.mp3 b/addons/captcha/audio/F_X.mp3 deleted file mode 100755 index b3bb0c1d7..000000000 Binary files a/addons/captcha/audio/F_X.mp3 and /dev/null differ diff --git a/addons/captcha/audio/F_Y.mp3 b/addons/captcha/audio/F_Y.mp3 deleted file mode 100755 index 1d9c35537..000000000 Binary files a/addons/captcha/audio/F_Y.mp3 and /dev/null differ diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php deleted file mode 100644 index 9c12f9b01..000000000 --- a/addons/captcha/captcha.addon.php +++ /dev/null @@ -1,397 +0,0 @@ - */ - -if(!defined("__XE__")) exit(); - -/** - * @file captcha.addon.php - * @author NAVER (developers@xpressengine.com) - * @brief Captcha for a particular action - * English alphabets and voice verification added - * */ -if(!class_exists('AddonCaptcha', false)) -{ - class AddonCaptcha - { - - var $addon_info; - var $target_acts = NULL; - - function setInfo(&$addon_info) - { - $this->addon_info = $addon_info; - } - - function before_module_proc() - { - if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) - { - unset($_SESSION['captcha_authed']); - } - } - - function before_module_init(&$ModuleHandler) - { - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) - { - return false; - } - if($this->addon_info->target != 'all' && Context::get('is_logged')) - { - return false; - } - if($_SESSION['XE_VALIDATOR_ERROR'] == -1) - { - $_SESSION['captcha_authed'] = false; - } - if($_SESSION['captcha_authed']) - { - return false; - } - - $type = Context::get('captchaType'); - - $this->target_acts = array('procBoardInsertDocument', 'procBoardInsertComment', 'procIssuetrackerInsertIssue', 'procIssuetrackerInsertHistory', 'procTextyleInsertComment'); - - if(Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON') - { - if($type == 'inline') - { - if(!$this->compareCaptcha()) - { - Context::loadLang(_XE_PATH_ . 'addons/captcha/lang'); - $_SESSION['XE_VALIDATOR_ERROR'] = -1; - $_SESSION['XE_VALIDATOR_MESSAGE'] = lang('captcha_denied'); - $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error'; - $_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url'); - $ModuleHandler->_setInputValueToSession(); - } - } - else - { - Context::addHtmlHeader(''); - Context::loadFile(array('./addons/captcha/captcha.js', 'body', '', null), true); - } - } - - // compare session when calling actions such as writing a post or a comment on the board/issue tracker module - if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $this->target_acts)) - { - Context::loadLang(_XE_PATH_ . 'addons/captcha/lang'); - $ModuleHandler->error = "captcha_denied"; - } - - return true; - } - - function createKeyword() - { - $type = Context::get('captchaType'); - if($type == 'inline' && $_SESSION['captcha_keyword']) - { - return; - } - - $arr = range('A', 'Y'); - shuffle($arr); - $arr = array_slice($arr, 0, 6); - $_SESSION['captcha_keyword'] = join('', $arr); - } - - function before_module_init_setCaptchaSession() - { - if($_SESSION['captcha_authed']) - { - return false; - } - // Load language files - Context::loadLang(_XE_PATH_ . 'addons/captcha/lang'); - // Generate keywords - $this->createKeyword(); - - $target = lang('target_captcha'); - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - printf("\r\n 0\r\n success\r\n \r\n \r\n \r\n \r\n \r\n " - , lang('about_captcha') - , lang('captcha_reload') - , lang('captcha_play') - , lang('cmd_input') - , lang('cmd_cancel') - ); - Context::close(); - exit(); - } - - function before_module_init_captchaImage() - { - if($_SESSION['captcha_authed']) - { - return false; - } - if(Context::get('renew')) - { - $this->createKeyword(); - } - - $keyword = $_SESSION['captcha_keyword']; - $im = $this->createCaptchaImage($keyword); - - header("Cache-Control: "); - header("Pragma: "); - header("Content-Type: image/png"); - - imagepng($im); - imagedestroy($im); - - Context::close(); - exit(); - } - - function createCaptchaImage($string) - { - $arr = array(); - for($i = 0, $c = strlen($string); $i < $c; $i++) - { - $arr[] = $string{$i}; - } - - // Font site - $w = 18; - $h = 25; - - // Character length - $c = count($arr); - - // Character image - $im = array(); - - // Create an image by total size - $im[] = imagecreate(($w + 2) * count($arr), $h); - - $deg = range(-30, 30); - shuffle($deg); - - // Create an image for each letter - foreach($arr as $i => $str) - { - $im[$i + 1] = @imagecreate($w, $h); - $background_color = imagecolorallocate($im[$i + 1], 255, 255, 255); - $text_color = imagecolorallocate($im[$i + 1], 0, 0, 0); - - // Control font size - $ran = range(1, 20); - shuffle($ran); - - if(function_exists('imagerotate')) - { - imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 8), $str, $text_color); - $im[$i + 1] = imagerotate($im[$i + 1], array_pop($deg), 0); - - $background_color = imagecolorallocate($im[$i + 1], 255, 255, 255); - imagecolortransparent($im[$i + 1], $background_color); - } - else - { - imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 4), $str, $text_color); - } - } - - // Combine images of each character - for($i = 1, $c = count($im); $i<$c; $i++) - { - imagecopy($im[0], $im[$i], (($w + 2) * ($i - 1)), 0, 0, 0, $w, $h); - imagedestroy($im[$i]); - } - - // Larger image - $big_count = 2; - $big = imagecreatetruecolor(($w + 2) * $big_count * $c, $h * $big_count); - imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w + 2) * $big_count * $c, $h * $big_count, ($w + 2) * $c, $h); - imagedestroy($im[0]); - - if(function_exists('imageantialias')) - { - imageantialias($big, true); - } - - // Background line - $line_color = imagecolorallocate($big, 0, 0, 0); - - $w = ($w + 2) * $big_count * $c; - $h = $h * $big_count; - $d = array_pop($deg); - - for($i = -abs($d); $i < $h + abs($d); $i = $i + 7) - { - imageline($big, 0, $i + $d, $w, $i, $line_color); - } - - $x = range(0, ($w - 10)); - shuffle($x); - - for($i = 0; $i < 200; $i++) - { - imagesetpixel($big, $x[$i] % $w, $x[$i + 1] % $h, $line_color); - } - - return $big; - } - - function before_module_init_captchaAudio() - { - if($_SESSION['captcha_authed']) - { - return false; - } - - $keyword = strtoupper($_SESSION['captcha_keyword']); - $data = $this->createCaptchaAudio($keyword); - - header('Content-type: audio/mpeg'); - header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\""); - header('Cache-Control: no-store, no-cache, must-revalidate'); - header('Expires: Sun, 1 Jan 2000 12:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); - header('Content-Length: ' . strlen($data)); - - echo $data; - Context::close(); - exit(); - } - - function createCaptchaAudio($string) - { - $data = ''; - $_audio = './addons/captcha/audio/F_%s.mp3'; - for($i = 0, $c = strlen($string); $i < $c; $i++) - { - $_data = FileHandler::readFile(sprintf($_audio, $string{$i})); - - $start = rand(5, 68); // Random start in 4-byte header and 64 byte data - $datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes - - for($j = $start; $j < $datalen; $j+=64) - { - $ch = ord($_data{$j}); - if($ch < 9 || $ch > 119) - { - continue; - } - $_data{$j} = chr($ch + rand(-8, 8)); - } - - $data .= $_data; - } - - return $data; - } - - function compareCaptcha() - { - if(!in_array(Context::get('act'), $this->target_acts)) return true; - - if($_SESSION['captcha_authed']) - { - return true; - } - - if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) - { - $_SESSION['captcha_authed'] = true; - return true; - } - - unset($_SESSION['captcha_authed']); - - return false; - } - - function before_module_init_captchaCompare() - { - if(!$this->compareCaptcha()) - { - return false; - } - - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - print("\r\n0\r\nsuccess\r\n"); - - Context::close(); - exit(); - } - - function inlineDisplay() - { - unset($_SESSION['captcha_authed']); - $this->createKeyword(); - - $swfURL = getUrl() . 'addons/captcha/swf/play.swf'; - Context::unloadFile('./addons/captcha/captcha.js'); - Context::loadFile(array('./addons/captcha/inline_captcha.js', 'body')); - - global $lang; - - $tags = << - - - - - - - - - - -
- - -EOD; - $tags = sprintf($tags, getUrl('captcha_action', 'captchaImage', 'rand', mt_rand(10000, 99999)) - , $swfURL - , $swfURL - , $lang->reload - , $lang->play); - return $tags; - } - - } - $GLOBALS['__AddonCaptcha__'] = new AddonCaptcha; - $GLOBALS['__AddonCaptcha__']->setInfo($addon_info); - Context::set('oCaptcha', $GLOBALS['__AddonCaptcha__']); -} - -$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__']; - -if(method_exists($oAddonCaptcha, $called_position)) -{ - if(!call_user_func_array(array(&$oAddonCaptcha, $called_position), array(&$this))) - { - return false; - } -} - -$addon_act = Context::get('captcha_action'); -if($addon_act && method_exists($oAddonCaptcha, $called_position . '_' . $addon_act)) -{ - if(!call_user_func_array(array(&$oAddonCaptcha, $called_position . '_' . $addon_act), array(&$this))) - { - return false; - } -} -/* End of file captcha.addon.php */ -/* Location: ./addons/captcha/captcha.addon.php */ diff --git a/addons/captcha/captcha.js b/addons/captcha/captcha.js deleted file mode 100644 index 8be891b75..000000000 --- a/addons/captcha/captcha.js +++ /dev/null @@ -1,180 +0,0 @@ -/* procFilter 함수를 가로채서 captcha 이미지 및 폼을 출력 */ -var calledArgs = null; -(function($){ - $(function() { - var captchaXE = null; - - function xeCaptcha() { - $('form').each(function(i) - { - var isSubmitHook = false; - if (!$(this).attr('onsubmit') || $(this).attr('onsubmit').indexOf('procFilter') < 0) - { - var act = $(this).find('input[name=act]').val() - for(var i = 0; i'); - if(!$(this).find('input[name=error_return_url]')) - $(this).append(''); - $(this).submit(function(event){ - if ($(this).find('input[name=secret_text]').val()) - { - return true; - } - - event.preventDefault(); - var self = this; - - $('#captcha_layer form') - .submit(function(e){ - e.preventDefault(); - if(!$('#secret_text').val()){ - $(this).find('input[type=text]').val('').focus(); - return false; - } - - $(self).append(''); - $(self).submit(); - }); - var params = new Array(); - params['captcha_action'] = 'setCaptchaSession'; - params['mid'] = current_mid; - window.oldExecXml('', '', params, captchaXE.show,new Array('error','message','about_captcha','captcha_reload','captcha_play','cmd_input','cmd_cancel')); - }); - } - }); - var body = $(document.body); - var captchaIma; - - if (!captchaXE) { - var fc_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; - var fc_isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; - var fc_isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; - var _swfURL_ = request_uri + 'addons/captcha/swf/play.swf'; - - if(fc_isIE && fc_isWin && !fc_isOpera){ - _object_ =''; - _object_ += ''; - _object_ += ''; - _object_ += ''; - _object_ += ''; - _object_ += ''; - _object_ += ''; - _object_ += ''; - }else{ - _object_ = ''; - } - - captchaXE = $('