diff --git a/bbs/register_form.php b/bbs/register_form.php index 57b5eeb53..4a3d6a404 100644 --- a/bbs/register_form.php +++ b/bbs/register_form.php @@ -1,6 +1,6 @@ include_once('./_common.php'); -include_once($g4['path'].'/plugin/captcha/captcha.lib.php'); +if ($captcha->lib) include_once($captcha->lib); // 불법접근을 막도록 토큰생성 $token = md5(uniqid(rand(), true)); diff --git a/bbs/register_form_update.php b/bbs/register_form_update.php index 33c2d11d5..d91812683 100644 --- a/bbs/register_form_update.php +++ b/bbs/register_form_update.php @@ -15,8 +15,8 @@ if ($w == 'u' && $is_admin == 'super') { alert('데모 화면에서는 하실(보실) 수 없는 작업입니다.'); } -if (!chk_tcaptcha("user_answer")) { - alert("정상적인 접근이 아닌것 같습니다."); +if (!chk_captcha("wr_key")) { + alert("자동등록방지 코드에 오류가 있습니다."); } $mb_id = trim(strip_tags(mysql_escape_string($_POST[mb_id]))); diff --git a/bbs/register_result.php b/bbs/register_result.php index 2265ecd84..3751f6cc0 100644 --- a/bbs/register_result.php +++ b/bbs/register_result.php @@ -1,12 +1,14 @@ include_once('./_common.php'); -$mb = get_member($_SESSION[ss_mb_reg]); +if (isset($_SESSION['ss_mb_reg'])) + $mb = get_member($_SESSION['ss_mb_reg']); + // 회원정보가 없다면 초기 페이지로 이동 -if (!$mb[mb_id]) +if (!$mb['mb_id']) goto_url($g4['path']); -$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; +$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; $g4['title'] = '회원가입결과'; include_once('./_head.php'); diff --git a/extend/captcha.extend.php b/extend/captcha.extend.php new file mode 100644 index 000000000..b304c8796 --- /dev/null +++ b/extend/captcha.extend.php @@ -0,0 +1,8 @@ + +if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 + +$captcha = (object)array( + 'lib' => $g4['path']."/plugin/captcha/captcha.lib.php", + 'js' => $g4['path']."/plugin/captcha/captcha.js" +); +?> \ No newline at end of file diff --git a/extend/tcaptcha.extend.php b/extend/tcaptcha.extend.php deleted file mode 100644 index 1c778f019..000000000 --- a/extend/tcaptcha.extend.php +++ /dev/null @@ -1,8 +0,0 @@ - -if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 - -$captcha = (object)array( - 'lib' => $g4['path']."/plugin/tcaptcha/tcaptcha.lib.php", - 'js' => $g4['path']."/plugin/tcaptcha/tcaptcha.js" -); -?> \ No newline at end of file diff --git a/js/wrest.js b/js/wrest.js index c33c2ec0f..32e38169f 100644 --- a/js/wrest.js +++ b/js/wrest.js @@ -13,9 +13,7 @@ function wrestItemname(fld) function wrestTrim(fld) { var pattern = /(^\s+)|(\s+$)/g; // \s 공백 문자 - //(/^\s+|\s+$/g,""); - var str = fld.value.replace(pattern, ""); - return str; + return fld.value.replace(pattern, ""); } // 필수 입력 검사 @@ -60,7 +58,7 @@ function wrestEmail(fld) } } -// 한글인지 검사 (자음, 모음만 있는 한글은 불가) +// 한글인지 검사 (자음, 모음 조합된 한글만 가능) function wrestHangul(fld) { if (!wrestTrim(fld)) return; @@ -69,7 +67,7 @@ function wrestHangul(fld) if (pattern.test(fld.value)) { if (wrestFld == null) { - wrestMsg = wrestItemname(fld) + ' : 한글이 아닙니다. (자음, 모음만 있는 한글은 처리하지 않습니다.)\n'; + wrestMsg = wrestItemname(fld) + ' : 한글이 아닙니다. (자음, 모음 조합된 한글만 가능)\n'; wrestFld = fld; } } @@ -186,7 +184,7 @@ function wrestMinLength(fld, css) { if (!wrestTrim(fld)) return; - var str = css.split('='); // minlength=?? <-- str[1] + var str = css.split('_'); // minlength_?? <-- str[1] if (wrestFld == null) { if (fld.value.length < parseInt(str[1])) { @@ -283,8 +281,8 @@ function wrestSubmit() case "telnum" : wrestTelNum(el); break; // 김선용 2006.3 - 전화번호 형식 검사 case "imgext" : wrestImgExt(el); break; default : - // css 가 minlength= 로 시작한다면 = 뒤의 숫자는 최소길이값 - if (/^minlength\=/.test(css)) { + // css 가 minlength_ 로 시작한다면 _ 뒤의 숫자는 최소길이값 + if (/^minlength\_/.test(css)) { wrestMinLength(el, css); break; } else if (/^extension\=/.test(css)) { wrestExtension(el, css); break; diff --git a/lib/common.lib.php b/lib/common.lib.php index a6e5e65d5..014c8ddb1 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1597,9 +1597,9 @@ function check_mb_nick($reg_mb_nick) // 별명은 한글, 영문, 숫자만 가능 if (!check_string($reg_mb_nick, _G4_HANGUL_ + _G4_ALPHABETIC_ + _G4_NUMERIC_)) { - return "공백없이 한글, 영문, 숫자만 입력 가능합니다."; + return "별명은 공백없이 한글, 영문, 숫자만 입력 가능합니다."; } else if (strlen($reg_mb_nick) < 4) { - return "한글 2글자, 영문 4글자 이상 입력 가능합니다."; + return "별명은 한글 2글자, 영문 4글자 이상 입력 가능합니다."; } else { $row = sql_fetch(" select count(*) as cnt from {$g4['member_table']} where mb_nick = '$reg_mb_nick' "); if ($row['cnt']) { diff --git a/plugin/captcha/captcha.js b/plugin/captcha/captcha.js index 6289dfc7b..7c87b4bcd 100644 --- a/plugin/captcha/captcha.js +++ b/plugin/captcha/captcha.js @@ -1,4 +1,4 @@ -function chk_captcha(input_key) +function check_captcha(input_key) { if (typeof(input_key) != "undefined") { var captcha_result = false; @@ -21,58 +21,16 @@ function chk_captcha(input_key) return true; } -function l_PlaySound(url, placeholderId) { - if (document.getElementById) { - var soundUrl = url; - var placeholder = document.getElementById(placeholderId); - - placeholder.innerHTML = ""; - - document.body.style.cursor = 'wait'; - var html5SoundPlayed = false; - var browserCompatibilityCheck = document.createElement('audio'); - if (!!(browserCompatibilityCheck.canPlayType) && - !!(browserCompatibilityCheck.canPlayType("audio/wav")) && - !l_DetectFirefox3()) { - sound = new Audio(soundUrl); - sound.id = 'LBD_CaptchaSoundAudio'; - sound.autoplay = true; - sound.controls = false; - sound.autobuffer = false; - sound.loop = false; - - placeholder.appendChild(sound); - html5SoundPlayed = true; - } - - if (!html5SoundPlayed) { - var objectSrc = ""; - - placeholder.innerHTML = objectSrc; - } - - document.body.style.cursor = 'default'; - } -} - -function l_DetectFirefox3() { - var detected = false; - if (navigator && navigator.userAgent) { - var matches = navigator.userAgent.match(/(Firefox)\/(3\.6\.[^;\+,\/\s]+)/); - if (matches) { - detected = true; - } - } - return detected; -} - $(function() { - $("#captcha").click(function() { + $("#captcha").click(function(e) { this.setAttribute("src", g4_path+"/plugin/captcha/run.php?t="+(new Date).getTime()); - //$("#captcha_key").focus();//이미지 새로고침 후 입력박스에 포커스 : 지운아빠 2012-07-13 - //캡챠 클릭 시에 포커스 줘야 하는데 페이지 새로 고침되면 포커스를 줘서 주석처리 : 지운아빠 2012-08-03 + var keycode = (e.keyCode ? e.keyCode : e.which); + // 첫 실행에서는 포커스를 주지 않음 + if (typeof(keycode) != "undefined") { + $("#captcha_key").focus();//이미지 새로고침 후 입력박스에 포커스 : 지운아빠 2012-07-13 + } }) - .css("cursor", "pointer") + .css("cursor", "pointer"); .trigger("click"); $("#captcha_wav").click(function(){ diff --git a/plugin/captcha/captcha.lib.php b/plugin/captcha/captcha.lib.php index 487fc1354..620d1f0d0 100644 --- a/plugin/captcha/captcha.lib.php +++ b/plugin/captcha/captcha.lib.php @@ -80,10 +80,6 @@ class captcha // The text to draw $captcha_key = $this->get_captcha_key(); - /* - $_SESSION['ss_captcha_key'] = $captcha_key; - $_SESSION['ss_captcha_cnt'] = 0; - */ set_session('ss_captcha_key', $captcha_key); set_session('ss_captcha_cnt', 0); diff --git a/skin/member/neo/register_form.skin.php b/skin/member/neo/register_form.skin.php index 10e3c4714..eabd35898 100644 --- a/skin/member/neo/register_form.skin.php +++ b/skin/member/neo/register_form.skin.php @@ -14,7 +14,6 @@ var member_skin_path = "=$member_skin_path?>"; - if (isset($member['mb_sex'])) { ?> } ?> if (isset($member['mb_nick_date']) && $member['mb_nick_date'] <= date("Y-m-d", $g4['server_time'] - ($config['cf_nick_modify'] * 86400))) { // 별명수정일이 지나지 않았다면 ?> @@ -26,18 +25,18 @@ var member_skin_path = "=$member_skin_path?>";