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

This commit is contained in:
whitedot
2013-05-14 17:52:11 +09:00
23 changed files with 115 additions and 122 deletions

2
.gitignore vendored
View File

@ -1,7 +1,7 @@
.htaccess
data
config.php
test
config.php
sirgle
sr_*
google*

View File

@ -167,7 +167,6 @@ $colspan = 15;
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<?php if ($is_admin == 'super') { ?>
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
<a href="./board_form.php">게시판추가</a>
<?php } ?>
</div>

View File

@ -131,9 +131,9 @@ $colspan = 15;
<th scope="col"><?php echo subject_sort_link('mb_nick') ?>별명</a></th>
<th scope="col">상태/<?php echo subject_sort_link('mb_level', '', 'desc') ?>권한</a></th>
<th scope="col">전화번호</th>
<th scope="col"><?php echo subject_sort_link('mb_email_certify', '', 'desc') ?>메일<br>인증</a></th>
<th scope="col"><?php echo subject_sort_link('mb_mailling', '', 'desc') ?>메일<br>수신</a></th>
<th scope="col"><?php echo subject_sort_link('mb_open', '', 'desc') ?>정보<br>공개</a></th>
<th scope="col"><?php echo subject_sort_link('mb_email_certify', '', 'desc') ?>메일<br>인증</a></th>
<th scope="col"><?php echo subject_sort_link('mb_hp_certify', '', 'desc') ?>본인<br>확인</a></th>
<th scope="col"><?php echo subject_sort_link('mb_adult', '', 'desc') ?>성인<br>인증</a></th>
<th scope="col"><?php echo subject_sort_link('mb_intercept_date', '', 'desc') ?>접근<br>차단</a></th>
@ -211,14 +211,14 @@ $colspan = 15;
<?php echo get_member_level_select("mb_level[$i]", 1, $member['mb_level'], $row['mb_level']) ?>
</td>
<td><?php echo $row['mb_tel']; ?></td>
<td class="td_chk"><?php echo $row['mb_mailling']?'<span class="txt_true">Yes</span>':'<span class="txt_false">No</span>'; ?></td>
<td class="td_chk"><?php echo $row['mb_open']?'<span class="txt_true">Yes</span>':'<span class="txt_false">No</span>'; ?></td>
<td class="td_chk"><?php echo preg_match('/[1-9]/', $row['mb_email_certify'])?'<span class="txt_true">Yes</span>':'<span class="txt_false">No</span>'; ?></td>
<td class="td_chk"><?php echo $row['mb_hp_certify']?'<span class="txt_true">Yes</span>':'<span class="txt_false">No</span>'; ?></td>
<td class="td_chk"><?php echo $row['mb_adult']?'<span class="txt_true">Yes</span>':'<span class="txt_false">No</span>'; ?></td>
<td class="td_chk"><input type="checkbox" name="mb_mailling[<?php echo $i; ?>]" <?php echo $row['mb_mailling']?'checked':''; ?> value="1"></td>
<td class="td_chk"><input type="checkbox" name="mb_open[<?php echo $i; ?>]" <?php echo $row['mb_open']?'checked':''; ?> value="1"></td>
<td class="td_chk"><input type="checkbox" name="mb_hp_certify[<?php echo $i; ?>]" <?php echo $row['mb_hp_certify']?'checked':''; ?> value="1"></td>
<td class="td_chk"><input type="checkbox" name="mb_adult[<?php echo $i; ?>]" <?php echo $row['mb_adult']?'checked':''; ?> value="1"></td>
<td class="td_chk">
<?php if(empty($row['mb_leave_date'])){ ?>
<input type="checkbox" name="mb_intercept_date[<?php echo $i ?>]" <?php echo $row['mb_intercept_date']?'checked':''; ?> value="<?php echo $intercept_date ?>" id="mb_intercept_date_<?php echo $i ?>" title="<?php echo $intercept_title ?>">
<input type="checkbox" name="mb_intercept_date[<?php echo $i; ?>]" <?php echo $row['mb_intercept_date']?'checked':''; ?> value="<?php echo $intercept_date ?>" id="mb_intercept_date_<?php echo $i ?>" title="<?php echo $intercept_title ?>">
<?php } ?>
</td>
<td><?php echo substr($row['mb_datetime'],2,8); ?></td>
@ -235,7 +235,6 @@ $colspan = 15;
<div class="btn_list">
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
<?php if ($is_admin == 'super') { ?><a href="./member_form.php">회원추가</a><?php } ?>
</div>
</form>

View File

@ -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);
}

View File

@ -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.'&amp;url='.urlencode(G4_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr));
alert('목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode(G4_BBS_URL.'/board.php?bo_table='.$bo_table.($qstr?'&amp;':'')));
}
if (!isset($page) || (isset($page) && $page == 0)) $page = 1;

View File

@ -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<count($notice_array); $k++)
if ((int)$write[wr_id] != (int)$notice_array[$k])
$bo_notice .= $notice_array[$k] . "\n";
$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' ");
// 글숫자 감소

View File

@ -130,6 +130,7 @@ for ($i=count($tmp_array)-1; $i>=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;
}

View File

@ -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";
// 로그인 스킨이 없는 경우 관리자 페이지 접속이 안되는 것을 막기 위하여 기본 스킨으로 대체

View File

@ -74,8 +74,8 @@ for ($i=0; $i<count($member_list['id']); $i++) {
if ($member_list) {
$str_nick_list = implode(',', $member_list['nick']);
alert($str_nick_list." 님께 쪽지를 전달하였습니다.", "./memo.php?kind=send", false);
alert($str_nick_list." 님께 쪽지를 전달하였습니다.", G4_HTTP_BBS_URL."/memo.php?kind=send", false);
} else {
alert("회원아이디 오류 같습니다.", "./memo_form.php", false);
alert("회원아이디 오류 같습니다.", G4_HTTP_BBS_URL."/memo_form.php", false);
}
?>

View File

@ -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');

View File

@ -346,7 +346,7 @@ if ($msg)
echo '<script>alert(\''.$msg.'\');</script>';
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'];

View File

@ -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 '<!-- skin : '.$board_skin_path.' -->';
include_once ($board_skin_path.'/write.skin.php');

View File

@ -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.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr);
alert($file_upload_msg, G4_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr);
else
goto_url(G4_HTTPS_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
goto_url(G4_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
?>

View File

@ -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'])) {

View File

@ -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');
/********************
기타 상수
********************/

View File

@ -0,0 +1 @@
#

View File

@ -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);
}
?>

View File

@ -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();

View File

@ -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')
{

View File

@ -1,4 +0,0 @@
<Files ~ "*">
Order allow,deny
Deny from all
</Files>

View File

@ -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" )

View File

@ -21,7 +21,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<?php if (!$is_member) { ?>
<tr>
<th scope="row"><label for="fnick">이름<strong class="sound_only">필수</strong></label></th>
<td><input type="text"name="fnick" id="fnick" required class="frm_input required"></td>
<td><input type="text" name="fnick" id="fnick" required class="frm_input required"></td>
</tr>
<tr>
<th scope="row"><label for="fmail">E-mail<strong class="sound_only">필수</strong></label></th>

View File

@ -13,7 +13,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<li><a href="./memo_form.php">쪽지쓰기</a></li>
</ul>
<form name="fmemoform" action="./memo_form_update.php" onsubmit="return fmemoform_submit(this);" method="post" autocomplete="off">
<form name="fmemoform" action="<?php echo $memo_action_url; ?>" onsubmit="return fmemoform_submit(this);" method="post" autocomplete="off">
<div class="cbox">
<table class="frm_tbl">
<caption>쪽지쓰기</caption>