Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
whitedot
2013-02-28 12:51:50 +09:00
10 changed files with 237 additions and 86 deletions

View File

@ -18,15 +18,15 @@ if (!isset($board['bo_device'])) {
// pc : pc 전용 사용
// mobile : mobile 전용 사용
// none : 사용 안함
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `bo_subject` ", true);
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `bo_subject` ", false);
}
if (!isset($board['bo_show_menu'])) {
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_order_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", true);
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_order_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", false);
}
if (!isset($board['bo_mobile_skin'])) {
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", true);
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", false);
}
@ -498,7 +498,7 @@ $pg_anchor = "<ul class=\"anchor\">
<th scope="row"><label for="bo_upload_size">파일 업로드 용량<strong class="sound_only">필수</strong></label></th>
<td>
<?=help('최대 '.ini_get("upload_max_filesize").' 이하 업로드 가능, 1 MB = 1,024,768 bytes')?>
업로드 파일 한개당 <input type="text" id="bo_upload_size" name="bo_upload_size" class="required numeric frm_input" required value="<?=$board['bo_upload_size']?>" size="10"> bytes 이하
업로드 파일 한개당 <input type="text" id="bo_upload_size" name="bo_upload_size" class="required numeric frm_input" required value="<?=$board['bo_upload_size']?>" size="10"> bytes 이하
</td>
<td class="group_setting">
<input type="checkbox" id="chk_upload_size" name="chk_upload_size" value="1">
@ -925,7 +925,7 @@ function set_point(f) {
}
}
function fboardform_submit(f)
function fboardform_submit(f)
{
<?=get_editor_js("bo_content_head");?>
<?=get_editor_js("bo_content_tail");?>

View File

@ -1,7 +1,6 @@
<?
include_once('./_common.php');
include_once(G4_GCAPTCHA_PATH.'/gcaptcha.lib.php');
include_once(G4_LIB_PATH.'/mailer.lib.php');
if ($is_member) {
alert("이미 로그인중입니다.");
@ -11,71 +10,5 @@ if (!chk_captcha()) {
alert('스팸방지에 입력한 숫자가 틀렸습니다.');
}
$email = trim($_POST['mb_email']);
if (!$email)
alert_close('메일주소 오류입니다.');
$sql = " select count(*) as cnt from {$g4['member_table']} where mb_email = '$email' ";
$row = sql_fetch($sql);
if ($row['cnt'] > 1)
alert('동일한 메일주소가 2개 이상 존재합니다.\\n\\n관리자에게 문의하여 주십시오.');
$sql = " select mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime from {$g4['member_table']} where mb_email = '$email' ";
$mb = sql_fetch($sql);
if (!$mb['mb_id'])
alert('존재하지 않는 회원입니다.');
else if (is_admin($mb['mb_id']))
alert('관리자 아이디는 접근 불가합니다.');
// 난수 발생
srand(time());
$randval = rand(4, 6);
$change_password = substr(md5(get_microtime()), 0, $randval);
$mb_lost_certify = sql_password($change_password);
$mb_datetime = sql_password($mb['mb_datetime']);
// 회원테이블에 필드를 추가
sql_query(" ALTER TABLE `{$g4['member_table']}` ADD `mb_lost_certify` VARCHAR( 255 ) NOT NULL AFTER `mb_memo` ", false);
$sql = " update {$g4['member_table']}
set mb_lost_certify = '$mb_lost_certify'
where mb_id = '{$mb['mb_id']}' ";
sql_query($sql);
$href = G4_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&amp;mb_datetime='.$mb_datetime.'&amp;mb_lost_certify='.$mb_lost_certify;
$subject = '요청하신 회원아이디/패스워드 정보입니다.';
$content = '';
$content .= '<div style="line-height:180%;">';
$content .= '<p>요청하신 계정정보는 다음과 같습니다.</p>';
$content .= '<hr>';
$content .= '<ul>';
$content .= '<li>회원아이디 : '.$mb['mb_id'].'</li>';
$content .= '<li>변경 패스워드 : <span style="color:#ff3300; font:13px Verdana;"><strong>'.$change_password.'</strong></span></li>';
$content .= '<li>이름 : '.addslashes($mb['mb_name']).'</li>';
$content .= '<li>별명 : '.addslashes($mb['mb_nick']).'</li>';
$content .= '<li>이메일주소 : '.addslashes($mb['mb_email']).'</li>';
$content .= '<li>요청일시 : '.G4_TIME_YMDHIS.'</li>';
$content .= '<li>홈페이지 : '.G4_URL.'</li>';
$content .= '</ul>';
$content .= '<hr>';
$content .= '<p><a href="'.$href.'" target="_blank">'.$href.'</a></p>';
$content .= '<p>';
$content .= '1. 위의 링크를 클릭하십시오. 링크가 클릭되지 않는다면 링크를 브라우저의 주소창에 직접 복사해 넣으시기 바랍니다.<br />';
$content .= '2. 링크를 클릭하시면 패스워드가 변경 되었다는 인증 메세지가 출력됩니다.<br />';
$content .= '3. 홈페이지에서 회원아이디와 위에 적힌 변경 패스워드로 로그인 하십시오.<br />';
$content .= '4. 로그인 하신 후 새로운 패스워드로 변경하시면 됩니다.';
$content .= '</p>';
$content .= '<p>감사합니다.</p>';
$content .= '<p>[끝]</p>';
$content .= '</div>';
$admin = get_admin('super');
mailer($admin['mb_nick'], $admin['mb_email'], $mb['mb_email'], $subject, $content, 1);
alert_close($email.' 메일로 회원아이디와 패스워드를 인증할 수 있는 메일이 발송 되었습니다.\\n\\n메일을 확인하여 주십시오.');
include_once($member_skin_path.'/password_lost2.skin.php');
?>

View File

@ -51,8 +51,6 @@ $mb_8 = isset($_POST['mb_8']) ? escape_trim($_POST['mb_8'])
$mb_9 = isset($_POST['mb_9']) ? escape_trim($_POST['mb_9']) : "";
$mb_10 = isset($_POST['mb_10']) ? escape_trim($_POST['mb_10']) : "";
// 사용자 코드 실행
@include_once($member_skin_path.'/register_form_update.head.skin.php');
if ($w == '' || $w == 'u') {
@ -92,6 +90,9 @@ if ($w == '' || $w == 'u') {
if ($msg = exist_mb_email($mb_email, $mb_id)) alert($msg, "", true, true);
}
// 사용자 코드 실행
@include_once($member_skin_path.'/register_form_update.head.skin.php');
$mb_dir = G4_DATA_PATH.'/member/'.substr($mb_id,0,2);
// 아이콘 삭제

View File

@ -25,7 +25,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
아직 회원이 아니시라면 회원으로 가입 후 이용해 주십시오.
</p>
<div>
<a href="<?=$g4['bbs_url']?>/password_lost.php" id="login_password_lost" class="btn02" target="win_password_lost">아이디 패스워드 찾기</a>
<a href="<?=G4_BBS_URL?>/password_lost.php" id="login_password_lost" class="btn02" target="win_password_lost">아이디 패스워드 찾기</a>
<a href="./register.php" class="btn01">회원 가입</a>
</div>
</section>

View File

@ -0,0 +1,73 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G4_LIB_PATH.'/mailer.lib.php');
$email = trim($_POST['mb_email']);
if (!$email)
alert_close('메일주소 오류입니다.');
$sql = " select count(*) as cnt from {$g4['member_table']} where mb_email = '$email' ";
$row = sql_fetch($sql);
if ($row['cnt'] > 1)
alert('동일한 메일주소가 2개 이상 존재합니다.\\n\\n관리자에게 문의하여 주십시오.');
$sql = " select mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime from {$g4['member_table']} where mb_email = '$email' ";
$mb = sql_fetch($sql);
if (!$mb['mb_id'])
alert('존재하지 않는 회원입니다.');
else if (is_admin($mb['mb_id']))
alert('관리자 아이디는 접근 불가합니다.');
// 난수 발생
srand(time());
$randval = rand(4, 6);
$change_password = substr(md5(get_microtime()), 0, $randval);
$mb_lost_certify = sql_password($change_password);
$mb_datetime = sql_password($mb['mb_datetime']);
// 회원테이블에 필드를 추가
sql_query(" ALTER TABLE `{$g4['member_table']}` ADD `mb_lost_certify` VARCHAR( 255 ) NOT NULL AFTER `mb_memo` ", false);
$sql = " update {$g4['member_table']}
set mb_lost_certify = '$mb_lost_certify'
where mb_id = '{$mb['mb_id']}' ";
sql_query($sql);
$href = G4_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&amp;mb_datetime='.$mb_datetime.'&amp;mb_lost_certify='.$mb_lost_certify;
$subject = '요청하신 회원아이디/패스워드 정보입니다.';
$content = '';
$content .= '<div style="line-height:180%;">';
$content .= '<p>요청하신 계정정보는 다음과 같습니다.</p>';
$content .= '<hr>';
$content .= '<ul>';
$content .= '<li>회원아이디 : '.$mb['mb_id'].'</li>';
$content .= '<li>변경 패스워드 : <span style="color:#ff3300; font:13px Verdana;"><strong>'.$change_password.'</strong></span></li>';
$content .= '<li>이름 : '.addslashes($mb['mb_name']).'</li>';
$content .= '<li>별명 : '.addslashes($mb['mb_nick']).'</li>';
$content .= '<li>이메일주소 : '.addslashes($mb['mb_email']).'</li>';
$content .= '<li>요청일시 : '.G4_TIME_YMDHIS.'</li>';
$content .= '<li>홈페이지 : '.G4_URL.'</li>';
$content .= '</ul>';
$content .= '<hr>';
$content .= '<p><a href="'.$href.'" target="_blank">'.$href.'</a></p>';
$content .= '<p>';
$content .= '1. 위의 링크를 클릭하십시오. 링크가 클릭되지 않는다면 링크를 브라우저의 주소창에 직접 복사해 넣으시기 바랍니다.<br />';
$content .= '2. 링크를 클릭하시면 패스워드가 변경 되었다는 인증 메세지가 출력됩니다.<br />';
$content .= '3. 홈페이지에서 회원아이디와 위에 적힌 변경 패스워드로 로그인 하십시오.<br />';
$content .= '4. 로그인 하신 후 새로운 패스워드로 변경하시면 됩니다.';
$content .= '</p>';
$content .= '<p>감사합니다.</p>';
$content .= '<p>[끝]</p>';
$content .= '</div>';
$admin = get_admin('super');
mailer($admin['mb_nick'], $admin['mb_email'], $mb['mb_email'], $subject, $content, 1);
alert_close($email.' 메일로 회원아이디와 패스워드를 인증할 수 있는 메일이 발송 되었습니다.\\n\\n메일을 확인하여 주십시오.');
?>

View File

@ -0,0 +1,5 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
?>

View File

@ -1,18 +1,26 @@
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if((int)get_cookie('ck_passwordlost_count') > 2)
alert_close('아이디/패스워드 찾기를 기준회수이상 시도하였습니다.');
?>
<div id="find_info" class="new_win">
<h1>아이디/패스워드 찾기</h1>
<form name="fpasswordlost" method="post" action="<?=$action_url?>" onsubmit="return fpasswordlost_submit(this);" autocomplete="off">
<input type="hidden" name="kcpcert_no" value="">
<input type="hidden" name="kcpcert_time" value="">
<fieldset id="find_info_fs">
<p>
회원가입 시 등록하신 이메일 주소를 입력해 주세요.<br>
해당 이메일로 아이디와 패스워드 정보를 보내드립니다.
회원가입 시 등록하신 이름과 핸드폰번호를 입력해 주세요.
</p>
<label for="mb_email">E-mail 주소<strong class="sound_only">필수</strong></label>
<input type="text" id="mb_email" name="mb_email" class="fs_input email" required size="30">
<label for="mb_name">이름<strong class="sound_only">필수</strong></label>
<input type="text" id="mb_name" name="mb_name" class="fs_input hangul nospace required" required size="30">
<label for="mb_hp">핸드폰번호<strong class="sound_only">필수</strong></label>
<input type="text" id="mb_hp" name="mb_hp" class="fs_input required" maxlength="20" required size="30">
<button type="button" id="win_kcpcert">휴대폰인증</button>
<noscript>휴대폰인증을 위해서는 자바스크립트 사용이 가능해야합니다.</noscript>
</fieldset>
<?=captcha_html(); ?>
<div class="btn_win">
@ -22,16 +30,34 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
</form>
</div>
<? // 휴대폰인증 form
include_once(G4_BBS_PATH.'/kcp/kcpcert_form.php');
?>
<script>
$(function() {
$('#win_kcpcert').click(function() {
var name = document.fpasswordlost.mb_name.value;
auth_type_check(name);
return false;
});
});
function fpasswordlost_submit(f)
{
// 휴대폰인증 검사
if(f.kcpcert_time.value == "") {
alert("휴대폰 본인인증을 해주세요.");
return false;
}
<? echo chk_captcha_js(); ?>
return true;
}
self.focus();
document.fpasswordlost.mb_email.focus();
document.fpasswordlost.mb_name.focus();
$(function() {
var sw = screen.width;

View File

@ -0,0 +1,89 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 조회회수 쿠키에 저장
if(!(int)$pl_count = get_cookie('ck_passwordlost_count')) {
set_cookie('ck_passwordlost_count', 1, 60*60*1);
} else {
if($pl_count > 2) {
alert_close('아이디/패스워드 찾기를 기준회수이상 시도하였습니다.');
} else {
$pl_count++;
set_cookie('ck_passwordlost_count', $pl_count, 60*60*1);
}
}
$mb_name = trim($_POST['mb_name']);
$mb_hp = preg_replace("/[^0-9]/", "", $_POST['mb_hp']);
if(!$mb_name)
alert_close('회원 이름을 입력해 주세요.');
if(!$mb_hp)
alert_close('핸드폰번호를 입력해 주세요.');
// 휴대폰인증체크
$kcpcert_no = trim($_POST['kcpcert_no']);
if(!$kcpcert_no)
alert_close('휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.');
// 본인인증 hash 체크
$reg_hash = md5($mb_hp.$mb_name.$kcpcert_no);
if(get_session('ss_kcpcert_hash') != $reg_hash)
alert_close('휴대폰인증 정보가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.');
$len = strlen($mb_hp);
if($len == 10)
$s_mb_hp = preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "\\1-\\2-\\3", $mb_hp);
else if($len == 11)
$s_mb_hp = preg_replace("/([0-9]{3})([0-9]{4})([0-9]{4})/", "\\1-\\2-\\3", $mb_hp);
$sql = " select count(*) as cnt from {$g4['member_table']} where mb_hp = '$s_mb_hp' ";
$row = sql_fetch($sql);
if ($row['cnt'] > 1)
alert('동일한 핸드폰번호가 2개 이상 존재합니다.\\n\\n관리자에게 문의하여 주십시오.');
$sql = " select mb_id from {$g4['member_table']} where mb_name = '$mb_name' and mb_hp = '$s_mb_hp' ";
$mb = sql_fetch($sql);
if (!$mb['mb_id'])
alert('존재하지 않는 회원입니다.');
else if (is_admin($mb['mb_id']))
alert('관리자 아이디는 접근 불가합니다.');
// 난수 발생
srand(time());
$randval = rand(4, 6);
$change_password = substr(md5(get_microtime()), 0, $randval);
$sql = " update {$g4['member_table']}
set mb_password = '".sql_password($change_password)."'
where mb_id = '{$mb['mb_id']}' ";
sql_query($sql);
$g4['title'] = '회원아이디/패스워드 찾기';
include_once(G4_PATH.'/head.sub.php');
?>
<div id="find_info" class="new_win">
<h1>아이디/패스워드 찾기</h1>
<form name="fpasswordlost" method="post" action="<?=$action_url?>" onsubmit="return fpasswordlost_submit(this);" autocomplete="off">
<fieldset id="find_info_fs">
<p>
회원님의 아이디와 변경된 패스워드입니다.<br>
로그인 후 패스워드를 변경해 주세요.
</p>
<div>
<div> 아이디 : <?=$mb['mb_id']?></div>
<div> 패스워드 : <?=$change_password?></div>
</div>
<div class="btn_win">
<a href="javascript:window.close();" class="btn_cancel">확인</a>
</div>
</form>
</div>
<?php
include_once(G4_PATH.'/tail.sub.php');
?>

View File

@ -3,6 +3,26 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
// 핸드폰번호 중복체크
$reg_hp = preg_replace("/[^0-9]/", "", $mb_hp);
if(!$reg_hp)
alert('핸드폰번호를 입력해 주세요.', "", true, true);
$hp_len = strlen($reg_hp);
if($hp_len == 10)
$reg_mb_hp = preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "\\1-\\2-\\3", $reg_hp);
else if($hp_len == 11)
$reg_mb_hp = preg_replace("/([0-9]{3})([0-9]{4})([0-9]{4})/", "\\1-\\2-\\3", $reg_hp);
else
alert('핸드폰번호가 올바르지 않습니다.', "", true, true);
$sql2 = " select count(*) as cnt from {$g4['member_table']}
where mb_hp = '$reg_mb_hp' and mb_id <> '$mb_id' and mb_leave_date = '' ";
$row2 = sql_fetch($sql2);
if($row2['cnt'])
alert('입력하신 핸드폰번호는 다른 회원님이 사용 중입니다.', "", true, true);
/* ======================================================================================================= */
/* = 휴대폰인증 및 성인인증 = */
/* ======================================================================================================= */
@ -13,7 +33,6 @@ if($w == '') {
alert('휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.', "", true, true);
// 본인인증 hash 체크
$reg_hp = preg_replace("/[^0-9]/", "", $mb_hp);
$reg_hash = md5($reg_hp.$mb_name.$kcpcert_no);
if(get_session('ss_kcpcert_hash') != $reg_hash)
alert('휴대폰인증 정보가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', "", true, true);
@ -25,9 +44,7 @@ if($w == '') {
}
} else if($w == 'u') {
// 휴대폰번호 변경체크
$patt = "/[^0-9]/";
$old_hp = preg_replace($patt, "", $_POST['old_mb_hp']);
$reg_hp = preg_replace($patt, "", $mb_hp);
$old_hp = preg_replace("/[^0-9]/", "", $_POST['old_mb_hp']);
if($old_hp != $reg_hp) {
// 본인인증체크

View File

@ -3,6 +3,13 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
// 휴대폰번호 포맷(010-0000-0000) 변경해서 기록
// $reg_mb_hp 는 rigister_form_update.head.skin.php 파일
$sql = " update {$g4['member_table']}
set mb_hp = '$reg_mb_hp'
where mb_id = '$mb_id' ";
sql_query($sql);
/* =========================================================================== */
/* = 휴대폰인증 및 성인인증 = */
/* =========================================================================== */