diff --git a/.gitignore b/.gitignore index 132ef02f0..7d1e324ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .htaccess data -config.php test +config.php sirgle sr_* google* diff --git a/adm/board_list.php b/adm/board_list.php index 1ab007b9e..a0c4fcd12 100644 --- a/adm/board_list.php +++ b/adm/board_list.php @@ -167,7 +167,6 @@ $colspan = 15; - 게시판추가 diff --git a/adm/member_list.php b/adm/member_list.php index e866a0dec..12b8b2a3e 100644 --- a/adm/member_list.php +++ b/adm/member_list.php @@ -131,9 +131,9 @@ $colspan = 15; 별명 상태/권한 전화번호 + 메일
인증 메일
수신 정보
공개 - 메일
인증 본인
확인 성인
인증 접근
차단 @@ -211,14 +211,14 @@ $colspan = 15; - Yes':'No'; ?> - Yes':'No'; ?> Yes':'No'; ?> - Yes':'No'; ?> - Yes':'No'; ?> + value="1"> + value="1"> + value="1"> + value="1"> - value="" id="mb_intercept_date_" title=""> + value="" id="mb_intercept_date_" title=""> @@ -235,7 +235,6 @@ $colspan = 15;
- 회원추가
diff --git a/adm/member_list_update.php b/adm/member_list_update.php index a64979f4c..23aea4b1f 100644 --- a/adm/member_list_update.php +++ b/adm/member_list_update.php @@ -28,7 +28,11 @@ if ($_POST['act_button'] == "선택수정") { } else { $sql = " update {$g4['member_table']} set mb_level = '{$_POST['mb_level'][$k]}', - mb_intercept_date = '{$_POST['mb_intercept_date'][$k]}' + mb_intercept_date = '{$_POST['mb_intercept_date'][$k]}', + mb_mailling = '{$_POST['mb_mailling'][$k]}', + mb_open = '{$_POST['mb_open'][$k]}', + mb_hp_certify = '{$_POST['mb_hp_certify'][$k]}', + mb_adult = '{$_POST['mb_adult'][$k]}' where mb_id = '{$_POST['mb_id'][$k]}' "; sql_query($sql); } diff --git a/bbs/board.php b/bbs/board.php index 61034e624..3e7f32f6d 100644 --- a/bbs/board.php +++ b/bbs/board.php @@ -134,7 +134,7 @@ if (isset($wr_id) && $wr_id) { if ($member['mb_id']) alert('목록을 볼 권한이 없습니다.', G4_URL); else - alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G4_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr)); + alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode(G4_BBS_URL.'/board.php?bo_table='.$bo_table.($qstr?'&':''))); } if (!isset($page) || (isset($page) && $page == 0)) $page = 1; diff --git a/bbs/delete.php b/bbs/delete.php index 166c198af..21ec46c15 100644 --- a/bbs/delete.php +++ b/bbs/delete.php @@ -117,6 +117,7 @@ sql_query(" delete from {$g4['board_new_table']} where bo_table = '$bo_table' an // 스크랩 삭제 sql_query(" delete from {$g4['scrap_table']} where bo_table = '$bo_table' and wr_id = '{$write['wr_id']}' "); +/* // 공지사항 삭제 $notice_array = explode("\n", trim($board['bo_notice'])); $bo_notice = ""; @@ -124,6 +125,8 @@ for ($k=0; $k=0; $i--) // 스크랩 삭제 sql_query(" delete from {$g4['scrap_table']} where bo_table = '$bo_table' and wr_id = '{$write['wr_id']}' "); + /* // 공지사항 삭제 $notice_array = explode(',', trim($board['bo_notice'])); $bo_notice = ""; @@ -137,6 +138,8 @@ for ($i=count($tmp_array)-1; $i>=0; $i--) if ((int)$write['wr_id'] != (int)$notice_array[$k]) $bo_notice .= $notice_array[$k].','; $bo_notice = trim($bo_notice); + */ + $bo_notice = board_notice($board['bo_notice'], $write['wr_id']); sql_query(" update {$g4['board_table']} set bo_notice = '$bo_notice' where bo_table = '$bo_table' "); $board['bo_notice'] = $bo_notice; } diff --git a/bbs/login.php b/bbs/login.php index 31f1ada32..390d2eb91 100644 --- a/bbs/login.php +++ b/bbs/login.php @@ -4,6 +4,8 @@ include_once('./_common.php'); $g4['title'] = '로그인'; include_once('./_head.sub.php'); +$url = $_GET['url']; + $p = parse_url($url); if ((isset($p['scheme']) && $p['scheme']) || (isset($p['host']) && $p['host'])) { //print_r2($p); @@ -19,31 +21,7 @@ if ($is_member) { goto_url(G4_URL); } -if ($url) - $urlencode = urlencode($url); -else - $urlencode = urlencode($_SERVER['REQUEST_URI']); - -if (G4_HTTPS_DOMAIN) { - $login_url = $_GET['url']; - if ($login_url) { - if (preg_match("/^\.\.\//", $url)) { - $login_url = urlencode(G4_URL."/".preg_replace("/^\.\.\//", "", $login_url)); - } else { - $purl = parse_url(G4_URL); - if ($purl['path']) { - $path = urlencode($purl['path']); - $urlencode = preg_replace("/".$path."/", "", $urlencode); - } - $login_url = $urlencode; - } - } else { - $login_url = G4_URL; - } -} else { - $login_url = $urlencode; -} - +$login_url = login_url($url); $login_action_url = G4_HTTPS_BBS_URL."/login_check.php"; // 로그인 스킨이 없는 경우 관리자 페이지 접속이 안되는 것을 막기 위하여 기본 스킨으로 대체 diff --git a/bbs/memo_form_update.php b/bbs/memo_form_update.php index 6c587a064..20a38ce14 100644 --- a/bbs/memo_form_update.php +++ b/bbs/memo_form_update.php @@ -74,8 +74,8 @@ for ($i=0; $i \ No newline at end of file diff --git a/bbs/register.php b/bbs/register.php index 5c17c6d6a..a6a9146dd 100644 --- a/bbs/register.php +++ b/bbs/register.php @@ -12,7 +12,7 @@ set_session("ss_mb_reg", ""); $g4['title'] = '회원가입약관'; include_once('./_head.php'); -$register_action_url = G4_HTTPS_BBS_URL.'/register_form.php'; +$register_action_url = G4_BBS_URL.'/register_form.php'; include_once($member_skin_path.'/register.skin.php'); include_once('./_tail.php'); diff --git a/bbs/register_form_update.php b/bbs/register_form_update.php index 278fc7264..48218b4a3 100644 --- a/bbs/register_form_update.php +++ b/bbs/register_form_update.php @@ -346,7 +346,7 @@ if ($msg) echo ''; if ($w == "") { - goto_url(G4_BBS_URL.'/register_result.php'); + goto_url(G4_HTTP_BBS_URL.'/register_result.php'); } else if ($w == 'u') { $row = sql_fetch(" select mb_password from {$g4['member_table']} where mb_id = '{$member['mb_id']}' "); $tmp_password = $row['mb_password']; diff --git a/bbs/write.php b/bbs/write.php index 198e58be9..7a9e329b7 100644 --- a/bbs/write.php +++ b/bbs/write.php @@ -377,7 +377,7 @@ $editor_html = editor_html('wr_content', $content, $is_dhtml_editor); include_once(G4_PATH.'/head.sub.php'); include_once('./board_head.php'); -$action_url = G4_HTTPS_BBS_URL."/write_update.php"; +$action_url = https_url(G4_BBS_DIR)."/write_update.php"; echo ''; include_once ($board_skin_path.'/write.skin.php'); diff --git a/bbs/write_update.php b/bbs/write_update.php index 914e7bfe9..a7491103c 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -53,7 +53,7 @@ $w = $_POST['w']; $wr_link1 = escape_trim(strip_tags($_POST['wr_link1'])); $wr_link2 = escape_trim(strip_tags($_POST['wr_link2'])); -$notice_array = explode(',', trim($board['bo_notice'])); +$notice_array = explode(",", $board['bo_notice']); if ($w == 'u' || $w == 'r') { $wr = get_write($write_table, $wr_id); @@ -454,6 +454,7 @@ if ($w == '' || $w == 'r') { $sql = " update {$write_table} set ca_name = '{$ca_name}' where wr_parent = '{$wr['wr_id']}' "; sql_query($sql); + /* if ($notice) { //if (!preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice'])) if (!in_array((int)$wr_id, $notice_array)) { @@ -469,6 +470,10 @@ if ($w == '' || $w == 'r') { //$bo_notice = preg_replace("/^".$wr_id."[\n]?$/m", "", $board['bo_notice']); sql_query(" update {$g4['board_table']} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' "); } + */ + + $bo_notice = board_notice($board['bo_notice'], $wr_id, $notice); + sql_query(" update {$g4['board_table']} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' "); } // syndication ping @@ -623,7 +628,7 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai delete_cache_latest($bo_table); if ($file_upload_msg) - alert($file_upload_msg, G4_HTTPS_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr); + alert($file_upload_msg, G4_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr); else - goto_url(G4_HTTPS_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr); + goto_url(G4_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr); ?> diff --git a/common.php b/common.php index 303b4be32..b4cf0bac6 100644 --- a/common.php +++ b/common.php @@ -163,14 +163,8 @@ ini_set("session.cookie_domain", G4_COOKIE_DOMAIN); @session_start(); -// 보안서버주소 설정 -if (G4_HTTPS_DOMAIN) { - define('G4_HTTPS_URL', G4_HTTPS_DOMAIN); - define('G4_HTTPS_BBS_URL', G4_HTTPS_DOMAIN.'/'.G4_BBS_DIR); -} else { - define('G4_HTTPS_URL', G4_URL); - define('G4_HTTPS_BBS_URL', G4_BBS_URL); -} +define('G4_HTTP_BBS_URL', https_url(G4_BBS_DIR, false)); +define('G4_HTTPS_BBS_URL', https_url(G4_BBS_DIR, true)); //============================================================================== // Mobile 모바일 설정 @@ -179,14 +173,16 @@ if (G4_HTTPS_DOMAIN) { // G4_MOBILE_AGENT : config.php 에서 선언 //------------------------------------------------------------------------------ $is_mobile = false; -if ($_REQUEST['device']=='pc') - $is_mobile = false; -else if ($_REQUEST['device']=='mobile') - $is_mobile = true; -else if (isset($_SESSION['ss_is_mobile'])) - $is_mobile = $_SESSION['ss_is_mobile']; -else if (is_mobile()) - $is_mobile = true; +if (G4_USE_MOBILE) { + if ($_REQUEST['device']=='pc') + $is_mobile = false; + else if ($_REQUEST['device']=='mobile') + $is_mobile = true; + else if (isset($_SESSION['ss_is_mobile'])) + $is_mobile = $_SESSION['ss_is_mobile']; + else if (is_mobile()) + $is_mobile = true; +} $_SESSION['ss_is_mobile'] = $is_mobile; define('G4_IS_MOBILE', $is_mobile); @@ -294,7 +290,11 @@ if (isset($_REQUEST['url'])) { $urlencode = urlencode($url); } else { $url = ''; - $urlencode = urlencode(escape_trim($_SERVER['REQUEST_URI'])); + $urlencode = urlencode($_SERVER['REQUEST_URI']); + if (G4_DOMAIN) { + $p = parse_url(G4_DOMAIN); + $urlencode = G4_DOMAIN.urldecode(preg_replace("/^".urlencode($p['path'])."/", "", $urlencode)); + } } if (isset($_REQUEST['gr_id'])) { diff --git a/config.php b/config.php index f006b663f..eb8e86cc3 100644 --- a/config.php +++ b/config.php @@ -24,7 +24,7 @@ if (PHP_VERSION >= '5.3.0') { 보안서버주소가 없다면 공란으로 두시면 되며 보안서버주소 뒤에 / 는 붙이지 않습니다. 입력예) https://www.domain.com:443/gnuboard4s */ -define('G4_DOMAIN', ''); // 사용하지 않습니다. +define('G4_DOMAIN', ''); define('G4_HTTPS_DOMAIN', ''); /* @@ -53,26 +53,13 @@ define('G4_SNS_DIR', 'sns'); define('G4_SYNDI_DIR', 'syndi'); // URL 은 브라우저상에서의 경로 (도메인으로 부터의) + if (G4_DOMAIN) { define('G4_URL', G4_DOMAIN); } else { - if (isset($g4_path['url'])) - define('G4_URL', $g4_path['url']); - else - define('G4_URL', ''); -} - -if (G4_HTTPS_DOMAIN) { - define('G4_URL', G4_HTTPS_DOMAIN); -} else { - define('G4_URL', G4_DOMAIN); -} - -if (isset($g4_path['path'])) { - define('G4_PATH', $g4_path['path']); -} else { - define('G4_PATH', ''); + define('G4_URL', $g4_path['url']); } +define('G4_PATH', $g4_path['path']); define('G4_ADMIN_URL', G4_URL.'/'.G4_ADMIN_DIR); define('G4_BBS_URL', G4_URL.'/'.G4_BBS_DIR); @@ -134,15 +121,6 @@ define('G4_SPECIAL', 64); // 특수문자 define('G4_MOBILE_AGENT', 'phone|samsung|lgtel|mobile|skt|nokia|blackberry|android|sony'); -/******************** - SNS 상수 -********************/ - -define('G4_FACEBOOK_APPID', '119146498278078'); -define('G4_FACEBOOK_SECRET', '311e0d6ff8ff43cfe0e75fe82d71777c'); -define('G4_FACEBOOK_CALLBACK', G4_SNS_URL.'/facebook/callback.php'); - - /******************** 기타 상수 ********************/ diff --git a/extend/.htaccess b/extend/.htaccess index e69de29bb..792d60054 100644 --- a/extend/.htaccess +++ b/extend/.htaccess @@ -0,0 +1 @@ +# diff --git a/lib/common.lib.php b/lib/common.lib.php index b4999e858..781f5c89a 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1981,4 +1981,58 @@ function hyphen_hp_number($hp) $hp = preg_replace("/[^0-9]/", "", $hp); return preg_replace("/([0-9]{3})([0-9]{3,4})([0-9]{4})$/", "\\1-\\2-\\3", $hp); } + + +// 로그인 후 이동할 URL +function login_url($url='') +{ + if (!$url) $url = G4_URL; + /* + $p = parse_url($url); + echo urlencode($_SERVER['REQUEST_URI']); + return $url.urldecode(preg_replace("/^".urlencode($p['path'])."/", "", urlencode($_SERVER['REQUEST_URI']))); + */ + return $url; +} + + +// $dir 을 포함하여 https 또는 http 주소를 반환한다. +function https_url($dir, $https=true) +{ + if ($https) { + if (G4_HTTPS_DOMAIN) { + $url = G4_HTTPS_DOMAIN.'/'.$dir; + } else { + $url = G4_URL.'/'.$dir; + } + } else { + if (G4_DOMAIN) { + $url = G4_DOMAIN.'/'.$dir; + } else { + $url = G4_URL.'/'.$dir; + } + } + + return $url; +} + + +// 게시판의 공지사항을 , 로 구분하여 업데이트 한다. +function board_notice($bo_notice, $wr_id, $insert=false) +{ + $notice_array = explode(",", trim($bo_notice)); + $notice_array = array_merge(array($wr_id), $notice_array); + $notice_array = array_unique($notice_array); + foreach ($notice_array as $key=>$value) { + if (!trim($value)) + unset($notice_array[$key]); + } + if (!$insert) { + foreach ($notice_array as $key=>$value) { + if ((int)$value == (int)$wr_id) + unset($notice_array[$key]); + } + } + return implode(",", $notice_array); +} ?> \ No newline at end of file diff --git a/lib/outlogin.lib.php b/lib/outlogin.lib.php index f5621c13d..077a4bd5a 100644 --- a/lib/outlogin.lib.php +++ b/lib/outlogin.lib.php @@ -34,29 +34,7 @@ function outlogin($skin_dir='basic') $is_auth = true; } - if (G4_HTTPS_DOMAIN) { - $outlogin_url = $_GET['url']; - if ($outlogin_url) { - if (preg_match("/^\.\.\//", $outlogin_url)) { - $outlogin_url = urlencode(G4_URL."/".preg_replace("/^\.\.\//", "", $outlogin_url)); - } - else { - $purl = parse_url(G4_URL); - if ($purl['path']) { - $path = urlencode($purl['path']); - $urlencode = preg_replace("/".$path."/", "", $urlencode); - } - $outlogin_url = $urlencode; - } - } - else { - $outlogin_url = G4_URL; - } - } - else { - $outlogin_url = $urlencode; - } - + $outlogin_url = login_url(); $outlogin_action_url = G4_HTTPS_BBS_URL.'/login_check.php'; ob_start(); diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index c7991dbef..04702a590 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -3,11 +3,6 @@ if (!defined('_GNUBOARD_')) exit; @ini_set('memory_limit', '512M'); -function it_img_thumb($filename, $filepath, $thumb_width, $thumb_height, $is_create=false) -{ - return thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, $is_create); -} - // 게시글리스트 썸네일 생성 function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3') { diff --git a/plugin/gcaptcha/fonts/.htaccess b/plugin/gcaptcha/fonts/.htaccess deleted file mode 100644 index 55fa648e1..000000000 --- a/plugin/gcaptcha/fonts/.htaccess +++ /dev/null @@ -1,4 +0,0 @@ - - Order allow,deny - Deny from all - \ No newline at end of file diff --git a/plugin/kcp/kcpcert_result.php b/plugin/kcp/kcpcert_result.php index 8e112bf2f..e6306d68c 100644 --- a/plugin/kcp/kcpcert_result.php +++ b/plugin/kcp/kcpcert_result.php @@ -150,7 +150,7 @@ if( $cert_enc_use == "Y" ) $adult_day = date("Ymd", strtotime("-19 years", G4_SERVER_TIME)); $adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0; - $sql = " update {$g4['member_table']} set mb_name = '$user_name', mb_hp = '$phone_no', mb_hp_certify = 1, mb_adult = $adult where mb_id = '{$member['mb_id']}' "; + $sql = " update {$g4['member_table']} set mb_name = '$user_name', mb_hp = '$phone_no', mb_hp_certify = 1, mb_adult = $adult, mb_birth = '$birth_day', mb_sex = '$sex_code' where mb_id = '{$member['mb_id']}' "; sql_query($sql); } else if( $res_cd != "0000" ) diff --git a/skin/member/basic/formmail.skin.php b/skin/member/basic/formmail.skin.php index ada849559..bc635db3e 100644 --- a/skin/member/basic/formmail.skin.php +++ b/skin/member/basic/formmail.skin.php @@ -21,7 +21,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 - + diff --git a/skin/member/basic/memo_form.skin.php b/skin/member/basic/memo_form.skin.php index 36e7dca11..9463b6634 100644 --- a/skin/member/basic/memo_form.skin.php +++ b/skin/member/basic/memo_form.skin.php @@ -13,7 +13,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
  • 쪽지쓰기
  • -
    +
    쪽지쓰기