From 81671abd01a2522e7a489d73740b6c72a4d3929b Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 29 Apr 2016 14:20:59 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EC=9D=B4=EB=A9=94=EC=9D=BC=EC=9D=B8?= =?UTF-8?q?=EC=A6=9D=20=ED=94=84=EB=A1=9C=EC=84=B8=EC=8A=A4=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/member_form.php | 5 +++++ bbs/email_certify.php | 15 ++++++++++++--- bbs/register_email_update.php | 10 +++++++--- bbs/register_form_update.php | 9 ++++++--- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/adm/member_form.php b/adm/member_form.php index 980369314..14825a339 100644 --- a/adm/member_form.php +++ b/adm/member_form.php @@ -126,6 +126,11 @@ if(!isset($mb['mb_dupinfo'])) { sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_dupinfo` varchar(255) NOT NULL DEFAULT '' AFTER `mb_adult` ", false); } +// 이메일인증 체크 필드추가 +if(!isset($mb['mb_email_certify2'])) { + sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_email_certify2` varchar(255) NOT NULL DEFAULT '' AFTER `mb_email_certify` ", false); +} + if ($mb['mb_intercept_date']) $g5['title'] = "차단된 "; else $g5['title'] .= ""; $g5['title'] .= '회원 '.$html_title; diff --git a/bbs/email_certify.php b/bbs/email_certify.php index ae50f7356..80b4bf0b8 100644 --- a/bbs/email_certify.php +++ b/bbs/email_certify.php @@ -1,20 +1,29 @@ Date: Fri, 29 Apr 2016 14:46:59 +0900 Subject: [PATCH 2/5] =?UTF-8?q?1:1=EB=AC=B8=EC=9D=98=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/qadelete.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bbs/qadelete.php b/bbs/qadelete.php index 07373f40d..bc22d1eba 100644 --- a/bbs/qadelete.php +++ b/bbs/qadelete.php @@ -29,6 +29,10 @@ for($i=0; $i<$count; $i++) { if($is_admin != 'super' && $row['mb_id'] != $member['mb_id']) continue; + // 답변이 달린 글은 삭제못함 + if($is_admin != 'super' && !$row['qa_type'] && $row['qa_status']) + continue; + // 첨부파일 삭제 for($k=1; $k<=2; $k++) { @unlink(G5_DATA_PATH.'/qa/'.$row['qa_file'.$k]); From 71b403bbe14e06663ac77829a9e95163c72a521e Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 29 Apr 2016 15:26:21 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EA=B8=80=20=EC=B2=B4=ED=81=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/scrap_popin_update.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bbs/scrap_popin_update.php b/bbs/scrap_popin_update.php index fdc90f9d2..5c94f90b6 100644 --- a/bbs/scrap_popin_update.php +++ b/bbs/scrap_popin_update.php @@ -10,6 +10,10 @@ if (!$is_member) exit; } +// 게시글 존재하는지 +if(!$write['wr_id']) + alert_close('스크랩하시려는 게시글이 존재하지 않습니다.'); + $sql = " select count(*) as cnt from {$g5['scrap_table']} where mb_id = '{$member['mb_id']}' and bo_table = '$bo_table' From 2e36c0a6625eb9fdf6cedd391b9f77ddbd8e831e Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 29 Apr 2016 15:30:05 +0900 Subject: [PATCH 4/5] =?UTF-8?q?1:1=EB=AC=B8=EC=9D=98=20=EC=9D=B4=EB=A9=94?= =?UTF-8?q?=EC=9D=BC=20=EC=B2=B4=ED=81=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/qawrite_update.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bbs/qawrite_update.php b/bbs/qawrite_update.php index 7e1c10226..272fd33ef 100644 --- a/bbs/qawrite_update.php +++ b/bbs/qawrite_update.php @@ -16,15 +16,12 @@ $msg = array(); $qaconfig = get_qa_config(); // e-mail 체크 -if(isset($_POST['qa_email']) && $qa_email) { +$qa_email = ''; +if(isset($_POST['qa_email']) && $_POST['qa_email']) $qa_email = get_email_address(trim($_POST['qa_email'])); - if($qaconfig['qa_req_email'] && !$qa_email) - $msg[] = '이메일을 입력하세요.'; - - if (!preg_match("/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/", $qa_email)) - $msg[] = '이메일 주소가 형식에 맞지 않습니다.'; -} +if($qaconfig['qa_req_email'] && !$qa_email) + $msg[] = '이메일을 입력하세요.'; $qa_subject = ''; if (isset($_POST['qa_subject'])) { From 7a8a4fe71d6f25715a1b8615a98ddc9440834205 Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 2 May 2016 16:53:37 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=ED=8F=BC=EB=A9=94=EC=9D=BC=EC=97=90?= =?UTF-8?q?=EC=84=9C=EC=9D=98=20=EC=9D=B4=EB=A9=94=EC=9D=BC=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=20=EB=85=B8=EC=B6=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/formmail.php | 9 +++++--- bbs/formmail_send.php | 3 ++- lib/common.lib.php | 50 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/bbs/formmail.php b/bbs/formmail.php index fdeeab869..fe099d23e 100644 --- a/bbs/formmail.php +++ b/bbs/formmail.php @@ -28,14 +28,17 @@ if ($sendmail_count > 3) $g5['title'] = '메일 쓰기'; include_once(G5_PATH.'/head.sub.php'); -$email = get_email_address(base64_decode($email)); +$email_enc = new str_encrypt(); +$email_dec = $email_enc->decrypt($email); + +$email = get_email_address($email_dec); if(!$email) alert_close('이메일이 올바르지 않습니다.'); -$email = base64_encode($email); +$email = $email_enc->encrypt($email); if (!$name) - $name = base64_decode($email); + $name = $email; else $name = get_text(stripslashes($name), true); diff --git a/bbs/formmail_send.php b/bbs/formmail_send.php index c97575a30..090209479 100644 --- a/bbs/formmail_send.php +++ b/bbs/formmail_send.php @@ -9,7 +9,8 @@ if (!$config['cf_email_use']) if (!$is_member && $config['cf_formmail_is_member']) alert_close('회원만 이용하실 수 있습니다.'); -$to = base64_decode($to); +$email_enc = new str_encrypt(); +$to = $email_enc->decrypt($to); if (substr_count($to, "@") > 1) alert_close('한번에 한사람에게만 메일을 발송할 수 있습니다.'); diff --git a/lib/common.lib.php b/lib/common.lib.php index d960fe183..d25b1f1dd 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1200,7 +1200,8 @@ function get_sideview($mb_id, $name='', $email='', $homepage='') global $g5; global $bo_table, $sca, $is_admin, $member; - $email = base64_encode($email); + $email_enc = new str_encrypt(); + $email = $email_enc->encrypt($email); $homepage = set_http(clean_xss_tags($homepage)); $name = get_text($name, 0, true); @@ -3173,4 +3174,51 @@ function check_vaild_callback($callback){ return true; } } + +// 문자열 암복호화 +class str_encrypt +{ + var $salt; + var $lenght; + + function __construct($salt='') + { + if(!$salt) + $this->salt = md5(G5_MYSQL_PASSWORD); + else + $this->salt = $salt; + + $this->length = strlen($this->salt); + } + + function encrypt($str) + { + $length = strlen($str); + $result = ''; + + for($i=0; $i<$length; $i++) { + $char = substr($str, $i, 1); + $keychar = substr($this->salt, ($i % $this->length) - 1, 1); + $char = chr(ord($char) + ord($keychar)); + $result .= $char; + } + + return base64_encode($result); + } + + function decrypt($str) { + $result = ''; + $str = base64_decode($str); + $length = strlen($str); + + for($i=0; $i<$length; $i++) { + $char = substr($str, $i, 1); + $keychar = substr($this->salt, ($i % $this->length) - 1, 1); + $char = chr(ord($char) - ord($keychar)); + $result .= $char; + } + + return $result; + } +} ?> \ No newline at end of file