Checked PSR-1: Basic Coding Standard

This commit is contained in:
kjh
2022-05-27 09:20:20 +00:00
parent 9199b7c986
commit b1640d7b76
42 changed files with 3734 additions and 3518 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
define('G5_IS_ADMIN', true); define('G5_IS_ADMIN', true);
include_once ('../common.php'); require_once '../common.php';
include_once(G5_ADMIN_PATH.'/admin.lib.php'); require_once G5_ADMIN_PATH . '/admin.lib.php';
if (isset($token)) { if (isset($token)) {
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES); $token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);

View File

@ -1,5 +1,7 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; if (!defined('_GNUBOARD_')) {
exit;
}
$is_use_apache = (stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false); $is_use_apache = (stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false);

View File

@ -1,5 +1,7 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; if (!defined('_GNUBOARD_')) {
exit;
}
$g5_debug['php']['begin_time'] = $begin_time = get_microtime(); $g5_debug['php']['begin_time'] = $begin_time = get_microtime();
@ -10,14 +12,16 @@ if (is_array($files)) {
$fileinfo = pathinfo($css_file); $fileinfo = pathinfo($css_file);
$ext = $fileinfo['extension']; $ext = $fileinfo['extension'];
if( $ext !== 'css' ) continue; if ($ext !== 'css') {
continue;
}
$css_file = str_replace(G5_ADMIN_PATH, G5_ADMIN_URL, $css_file); $css_file = str_replace(G5_ADMIN_PATH, G5_ADMIN_URL, $css_file);
add_stylesheet('<link rel="stylesheet" href="' . $css_file . '">', $k); add_stylesheet('<link rel="stylesheet" href="' . $css_file . '">', $k);
} }
} }
include_once(G5_PATH.'/head.sub.php'); require_once G5_PATH . '/head.sub.php';
function print_menu1($key, $no = '') function print_menu1($key, $no = '')
{ {
@ -33,21 +37,25 @@ function print_menu2($key, $no='')
global $menu, $auth_menu, $is_admin, $auth, $g5, $sub_menu; global $menu, $auth_menu, $is_admin, $auth, $g5, $sub_menu;
$str = "<ul>"; $str = "<ul>";
for($i=1; $i<count($menu[$key]); $i++) for ($i = 1; $i < count($menu[$key]); $i++) {
{
if (!isset($menu[$key][$i])) { if (!isset($menu[$key][$i])) {
continue; continue;
} }
if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0],$auth) || !strstr($auth[$menu[$key][$i][0]], 'r'))) if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0], $auth) || !strstr($auth[$menu[$key][$i][0]], 'r'))) {
continue; continue;
}
$gnb_grp_div = $gnb_grp_style = ''; $gnb_grp_div = $gnb_grp_style = '';
if (isset($menu[$key][$i][4])) { if (isset($menu[$key][$i][4])) {
if (($menu[$key][$i][4] == 1 && $gnb_grp_style == false) || ($menu[$key][$i][4] != 1 && $gnb_grp_style == true)) $gnb_grp_div = 'gnb_grp_div'; if (($menu[$key][$i][4] == 1 && $gnb_grp_style == false) || ($menu[$key][$i][4] != 1 && $gnb_grp_style == true)) {
$gnb_grp_div = 'gnb_grp_div';
}
if ($menu[$key][$i][4] == 1) $gnb_grp_style = 'gnb_grp_style'; if ($menu[$key][$i][4] == 1) {
$gnb_grp_style = 'gnb_grp_style';
}
} }
$current_class = ''; $current_class = '';
@ -82,8 +90,7 @@ if( ! empty($_COOKIE['g5_admin_btn_gnb']) ){
var tempX = 0; var tempX = 0;
var tempY = 0; var tempY = 0;
function imageview(id, w, h) function imageview(id, w, h) {
{
menu(id); menu(id);
@ -141,8 +148,9 @@ function imageview(id, w, h)
} }
$current_class = ""; $current_class = "";
if (isset($sub_menu) && (substr($sub_menu, 0, 3) == substr($menu['menu'.$key][0][0], 0, 3))) if (isset($sub_menu) && (substr($sub_menu, 0, 3) == substr($menu['menu' . $key][0][0], 0, 3))) {
$current_class = " on"; $current_class = " on";
}
$button_title = $menu['menu' . $key][0][1]; $button_title = $menu['menu' . $key][0][1];
?> ?>
@ -182,9 +190,7 @@ jQuery(function($){
} else { } else {
delete_cookie(menu_cookie_key); delete_cookie(menu_cookie_key);
} }
} } catch (err) {}
catch(err) {
}
$("#container").toggleClass("container-small"); $("#container").toggleClass("container-small");
$("#gnb").toggleClass("gnb_small"); $("#gnb").toggleClass("gnb_small");

View File

@ -1,5 +1,7 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; if (!defined('_GNUBOARD_')) {
exit;
}
/* /*
// 081022 : CSRF 방지를 위해 코드를 작성했으나 효과가 없어 주석처리 함 // 081022 : CSRF 방지를 위해 코드를 작성했으나 효과가 없어 주석처리 함
@ -29,11 +31,14 @@ function get_skin_select($skin_gubun, $id, $name, $selected='', $event='')
$str = "<select id=\"$id\" name=\"$name\" $event>\n"; $str = "<select id=\"$id\" name=\"$name\" $event>\n";
for ($i = 0; $i < count($skins); $i++) { for ($i = 0; $i < count($skins); $i++) {
if ($i == 0) $str .= "<option value=\"\">선택</option>"; if ($i == 0) {
if(preg_match('#^theme/(.+)$#', $skins[$i], $match)) $str .= "<option value=\"\">선택</option>";
}
if (preg_match('#^theme/(.+)$#', $skins[$i], $match)) {
$text = '(테마) ' . $match[1]; $text = '(테마) ' . $match[1];
else } else {
$text = $skins[$i]; $text = $skins[$i];
}
$str .= option_selected($skins[$i], $selected, $text); $str .= option_selected($skins[$i], $selected, $text);
} }
@ -61,11 +66,14 @@ function get_mobile_skin_select($skin_gubun, $id, $name, $selected='', $event=''
$str = "<select id=\"$id\" name=\"$name\" $event>\n"; $str = "<select id=\"$id\" name=\"$name\" $event>\n";
for ($i = 0; $i < count($skins); $i++) { for ($i = 0; $i < count($skins); $i++) {
if ($i == 0) $str .= "<option value=\"\">선택</option>"; if ($i == 0) {
if(preg_match('#^theme/(.+)$#', $skins[$i], $match)) $str .= "<option value=\"\">선택</option>";
}
if (preg_match('#^theme/(.+)$#', $skins[$i], $match)) {
$text = '(테마) ' . $match[1]; $text = '(테마) ' . $match[1];
else } else {
$text = $skins[$i]; $text = $skins[$i];
}
$str .= option_selected($skins[$i], $selected, $text); $str .= option_selected($skins[$i], $selected, $text);
} }
@ -82,14 +90,19 @@ function get_skin_dir($skin, $skin_path=G5_SKIN_PATH)
$result_array = array(); $result_array = array();
$dirname = $skin_path . '/' . $skin . '/'; $dirname = $skin_path . '/' . $skin . '/';
if(!is_dir($dirname)) if (!is_dir($dirname)) {
return array(); return array();
}
$handle = opendir($dirname); $handle = opendir($dirname);
while ($file = readdir($handle)) { while ($file = readdir($handle)) {
if($file == '.'||$file == '..') continue; if ($file == '.' || $file == '..') {
continue;
}
if (is_dir($dirname.$file)) $result_array[] = $file; if (is_dir($dirname . $file)) {
$result_array[] = $file;
}
} }
closedir($handle); closedir($handle);
sort($result_array); sort($result_array);
@ -106,14 +119,17 @@ function get_theme_dir()
$dirname = G5_PATH . '/' . G5_THEME_DIR . '/'; $dirname = G5_PATH . '/' . G5_THEME_DIR . '/';
$handle = opendir($dirname); $handle = opendir($dirname);
while ($file = readdir($handle)) { while ($file = readdir($handle)) {
if($file == '.'||$file == '..') continue; if ($file == '.' || $file == '..') {
continue;
}
if (is_dir($dirname . $file)) { if (is_dir($dirname . $file)) {
$theme_path = $dirname . $file; $theme_path = $dirname . $file;
if(is_file($theme_path.'/index.php') && is_file($theme_path.'/head.php') && is_file($theme_path.'/tail.php')) if (is_file($theme_path . '/index.php') && is_file($theme_path . '/head.php') && is_file($theme_path . '/tail.php')) {
$result_array[] = $file; $result_array[] = $file;
} }
} }
}
closedir($handle); closedir($handle);
natsort($result_array); natsort($result_array);
@ -129,12 +145,14 @@ function get_theme_info($dir)
if (is_dir($path)) { if (is_dir($path)) {
$screenshot = $path . '/screenshot.png'; $screenshot = $path . '/screenshot.png';
$screenshot_url = '';
if (is_file($screenshot)) { if (is_file($screenshot)) {
$size = @getimagesize($screenshot); $size = @getimagesize($screenshot);
if($size[2] == 3) if ($size[2] == 3) {
$screenshot_url = str_replace(G5_PATH, G5_URL, $screenshot); $screenshot_url = str_replace(G5_PATH, G5_URL, $screenshot);
} }
}
$info['screenshot'] = $screenshot_url; $info['screenshot'] = $screenshot_url;
@ -162,9 +180,10 @@ function get_theme_info($dir)
$info['license_uri'] = trim($m7[1]); $info['license_uri'] = trim($m7[1]);
} }
if(!$info['theme_name']) if (!$info['theme_name']) {
$info['theme_name'] = $dir; $info['theme_name'] = $dir;
} }
}
return $info; return $info;
} }
@ -177,8 +196,8 @@ function get_theme_config_value($dir, $key='*')
$theme_config_file = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir . '/theme.config.php'; $theme_config_file = G5_PATH . '/' . G5_THEME_DIR . '/' . $dir . '/theme.config.php';
if (is_file($theme_config_file)) { if (is_file($theme_config_file)) {
include($theme_config_file); include $theme_config_file;
// 22.05.26 Undefined Variable $theme_config;
if ($key == '*') { if ($key == '*') {
$tconfig = $theme_config; $tconfig = $theme_config;
} else { } else {
@ -199,12 +218,15 @@ function get_member_level_select($name, $start_id=0, $end_id=10, $selected="", $
global $g5; global $g5;
$str = "\n<select id=\"{$name}\" name=\"{$name}\""; $str = "\n<select id=\"{$name}\" name=\"{$name}\"";
if ($event) $str .= " $event"; if ($event) {
$str .= " $event";
}
$str .= ">\n"; $str .= ">\n";
for ($i = $start_id; $i <= $end_id; $i++) { for ($i = $start_id; $i <= $end_id; $i++) {
$str .= '<option value="' . $i . '"'; $str .= '<option value="' . $i . '"';
if ($i == $selected) if ($i == $selected) {
$str .= ' selected="selected"'; $str .= ' selected="selected"';
}
$str .= ">{$i}</option>\n"; $str .= ">{$i}</option>\n";
} }
$str .= "</select>\n"; $str .= "</select>\n";
@ -220,10 +242,11 @@ function get_member_id_select($name, $level, $selected="", $event="")
$sql = " select mb_id from {$g5['member_table']} where mb_level >= '{$level}' "; $sql = " select mb_id from {$g5['member_table']} where mb_level >= '{$level}' ";
$result = sql_query($sql); $result = sql_query($sql);
$str = '<select id="' . $name . '" name="' . $name . '" ' . $event . '><option value="">선택안함</option>'; $str = '<select id="' . $name . '" name="' . $name . '" ' . $event . '><option value="">선택안함</option>';
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{
$str .= '<option value="' . $row['mb_id'] . '"'; $str .= '<option value="' . $row['mb_id'] . '"';
if ($row['mb_id'] == $selected) $str .= ' selected'; if ($row['mb_id'] == $selected) {
$str .= ' selected';
}
$str .= '>' . $row['mb_id'] . '</option>'; $str .= '>' . $row['mb_id'] . '</option>';
} }
$str .= '</select>'; $str .= '</select>';
@ -231,11 +254,11 @@ function get_member_id_select($name, $level, $selected="", $event="")
} }
// php8 버전 호환 권한 검사 함수 // php8 버전 호환 권한 검사 함수
function auth_check_menu($auth, $sub_menu, $attr, $return=false) { function auth_check_menu($auth, $sub_menu, $attr, $return = false)
{
$check_auth = isset($auth[$sub_menu]) ? $auth[$sub_menu] : ''; $check_auth = isset($auth[$sub_menu]) ? $auth[$sub_menu] : '';
return auth_check($check_auth, $attr, $return); return auth_check($check_auth, $attr, $return);
} }
// 권한 검사 // 권한 검사
@ -243,46 +266,53 @@ function auth_check($auth, $attr, $return=false)
{ {
global $is_admin; global $is_admin;
if ($is_admin == 'super') return; if ($is_admin == 'super') {
return;
}
if (!trim($auth)) { if (!trim($auth)) {
$msg = '이 메뉴에는 접근 권한이 없습니다.\\n\\n접근 권한은 최고관리자만 부여할 수 있습니다.'; $msg = '이 메뉴에는 접근 권한이 없습니다.\\n\\n접근 권한은 최고관리자만 부여할 수 있습니다.';
if($return) if ($return) {
return $msg; return $msg;
else } else {
alert($msg); alert($msg);
} }
}
$attr = strtolower($attr); $attr = strtolower($attr);
if (!strstr($auth, $attr)) { if (!strstr($auth, $attr)) {
if ($attr == 'r') { if ($attr == 'r') {
$msg = '읽을 권한이 없습니다.'; $msg = '읽을 권한이 없습니다.';
if($return) if ($return) {
return $msg; return $msg;
else } else {
alert($msg); alert($msg);
}
} else if ($attr == 'w') { } else if ($attr == 'w') {
$msg = '입력, 추가, 생성, 수정 권한이 없습니다.'; $msg = '입력, 추가, 생성, 수정 권한이 없습니다.';
if($return) if ($return) {
return $msg; return $msg;
else } else {
alert($msg); alert($msg);
}
} else if ($attr == 'd') { } else if ($attr == 'd') {
$msg = '삭제 권한이 없습니다.'; $msg = '삭제 권한이 없습니다.';
if($return) if ($return) {
return $msg; return $msg;
else } else {
alert($msg); alert($msg);
}
} else { } else {
$msg = '속성이 잘못 되었습니다.'; $msg = '속성이 잘못 되었습니다.';
if($return) if ($return) {
return $msg; return $msg;
else } else {
alert($msg); alert($msg);
} }
} }
} }
}
// 작업아이콘 출력 // 작업아이콘 출력
@ -292,10 +322,11 @@ function icon($act, $link='', $target='_parent')
$img = array('입력' => 'insert', '추가' => 'insert', '생성' => 'insert', '수정' => 'modify', '삭제' => 'delete', '이동' => 'move', '그룹' => 'move', '보기' => 'view', '미리보기' => 'view', '복사' => 'copy'); $img = array('입력' => 'insert', '추가' => 'insert', '생성' => 'insert', '수정' => 'modify', '삭제' => 'delete', '이동' => 'move', '그룹' => 'move', '보기' => 'view', '미리보기' => 'view', '복사' => 'copy');
$icon = '<img src="' . G5_ADMIN_PATH . '/img/icon_' . $img[$act] . '.gif" title="' . $act . '">'; $icon = '<img src="' . G5_ADMIN_PATH . '/img/icon_' . $img[$act] . '.gif" title="' . $act . '">';
if ($link) if ($link) {
$s = '<a href="' . $link . '">' . $icon . '</a>'; $s = '<a href="' . $link . '">' . $icon . '</a>';
else } else {
$s = $icon; $s = $icon;
}
return $s; return $s;
} }
@ -308,9 +339,10 @@ function rm_rf($file)
if (is_dir($file)) { if (is_dir($file)) {
$handle = opendir($file); $handle = opendir($file);
while ($filename = readdir($handle)) { while ($filename = readdir($handle)) {
if ($filename != '.' && $filename != '..') if ($filename != '.' && $filename != '..') {
rm_rf($file . '/' . $filename); rm_rf($file . '/' . $filename);
} }
}
closedir($handle); closedir($handle);
@chmod($file, G5_DIR_PERMISSION); @chmod($file, G5_DIR_PERMISSION);
@ -364,7 +396,8 @@ function get_admin_token()
} }
// 관리자가 자동등록방지를 사용해야 할 경우 // 관리자가 자동등록방지를 사용해야 할 경우
function get_admin_captcha_by($type='get'){ function get_admin_captcha_by($type = 'get')
{
$captcha_name = 'ss_admin_use_captcha'; $captcha_name = 'ss_admin_use_captcha';
@ -376,7 +409,8 @@ function get_admin_captcha_by($type='get'){
} }
//input value 에서 xss 공격 filter 역할을 함 ( 반드시 input value='' 타입에만 사용할것 ) //input value 에서 xss 공격 filter 역할을 함 ( 반드시 input value='' 타입에만 사용할것 )
function get_sanitize_input($s, $is_html=false){ function get_sanitize_input($s, $is_html = false)
{
if (!$is_html) { if (!$is_html) {
$s = strip_tags($s); $s = strip_tags($s);
@ -387,7 +421,8 @@ function get_sanitize_input($s, $is_html=false){
return $s; return $s;
} }
function check_log_folder($log_path, $is_delete=true){ function check_log_folder($log_path, $is_delete = true)
{
if (is_writable($log_path)) { if (is_writable($log_path)) {
@ -439,8 +474,9 @@ function check_admin_token()
$token = get_session('ss_admin_token'); $token = get_session('ss_admin_token');
set_session('ss_admin_token', ''); set_session('ss_admin_token', '');
if(!$token || !$_REQUEST['token'] || $token != $_REQUEST['token']) if (!$token || !$_REQUEST['token'] || $token != $_REQUEST['token']) {
alert('올바른 방법으로 이용해 주십시오.', G5_URL); alert('올바른 방법으로 이용해 주십시오.', G5_URL);
}
return true; return true;
} }
@ -452,11 +488,12 @@ function admin_referer_check($return=false)
if (!$referer) { if (!$referer) {
$msg = '정보가 올바르지 않습니다.'; $msg = '정보가 올바르지 않습니다.';
if($return) if ($return) {
return $msg; return $msg;
else } else {
alert($msg, G5_URL); alert($msg, G5_URL);
} }
}
$p = @parse_url($referer); $p = @parse_url($referer);
@ -480,13 +517,18 @@ function admin_referer_check($return=false)
} }
} }
function admin_check_xss_params($params){ function admin_check_xss_params($params)
{
if( ! $params ) return; if (!$params) {
return;
}
foreach ($params as $key => $value) { foreach ($params as $key => $value) {
if ( empty($value) ) continue; if (empty($value)) {
continue;
}
if (is_array($value)) { if (is_array($value)) {
admin_check_xss_params($value); admin_check_xss_params($value);
@ -499,7 +541,8 @@ function admin_check_xss_params($params){
return; return;
} }
function admin_menu_find_by($call, $search_key){ function admin_menu_find_by($call, $search_key)
{
global $menu; global $menu;
static $cache_menu = array(); static $cache_menu = array();
@ -507,12 +550,18 @@ function admin_menu_find_by($call, $search_key){
if (empty($cache_menu)) { if (empty($cache_menu)) {
foreach ($menu as $k1 => $arr1) { foreach ($menu as $k1 => $arr1) {
if (empty($arr1) ) continue; if (empty($arr1)) {
continue;
}
foreach ($arr1 as $k2 => $arr2) { foreach ($arr1 as $k2 => $arr2) {
if (empty($arr2) ) continue; if (empty($arr2)) {
continue;
}
$menu_key = isset($arr2[3]) ? $arr2[3] : ''; $menu_key = isset($arr2[3]) ? $arr2[3] : '';
if (empty($menu_key) ) continue; if (empty($menu_key)) {
continue;
}
$cache_menu[$menu_key] = array( $cache_menu[$menu_key] = array(
'sub_menu' => $arr2[0], 'sub_menu' => $arr2[0],
@ -531,22 +580,17 @@ function admin_menu_find_by($call, $search_key){
} }
// 접근 권한 검사 // 접근 권한 검사
if (!$member['mb_id']) if (!$member['mb_id']) {
{
alert('로그인 하십시오.', G5_BBS_URL . '/login.php?url=' . urlencode(correct_goto_url(G5_ADMIN_URL))); alert('로그인 하십시오.', G5_BBS_URL . '/login.php?url=' . urlencode(correct_goto_url(G5_ADMIN_URL)));
} } else if ($is_admin != 'super') {
else if ($is_admin != 'super')
{
$auth = array(); $auth = array();
$sql = " select au_menu, au_auth from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' "; $sql = " select au_menu, au_auth from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
$result = sql_query($sql); $result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{
$auth[$row['au_menu']] = $row['au_auth']; $auth[$row['au_menu']] = $row['au_auth'];
} }
if (!$i) if (!$i) {
{
alert('최고관리자 또는 관리권한이 있는 회원만 접근 가능합니다.', G5_URL); alert('최고관리자 또는 관리권한이 있는 회원만 접근 가능합니다.', G5_URL);
} }
} }
@ -557,7 +601,7 @@ if (get_session('ss_mb_key') !== $admin_key) {
session_destroy(); session_destroy();
include_once(G5_LIB_PATH.'/mailer.lib.php'); include_once G5_LIB_PATH . '/mailer.lib.php';
// 메일 알림 // 메일 알림
mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'] . ' 아이피로 XSS 공격이 있었습니다.<br><br>관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.<br><br>해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.' . G5_URL, 0); mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'] . ' 아이피로 XSS 공격이 있었습니다.<br><br>관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.<br><br>해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.' . G5_URL, 0);
@ -577,15 +621,16 @@ unset($amenu);
$tmp = dir(G5_ADMIN_PATH); $tmp = dir(G5_ADMIN_PATH);
$menu_files = array(); $menu_files = array();
while ($entry = $tmp->read()) { while ($entry = $tmp->read()) {
if (!preg_match('/^admin.menu([0-9]{3}).*\.php$/', $entry, $m)) if (!preg_match('/^admin.menu([0-9]{3}).*\.php$/', $entry, $m)) {
continue; // 파일명이 menu 으로 시작하지 않으면 무시한다. continue; // 파일명이 menu 으로 시작하지 않으면 무시한다.
}
$amenu[$m[1]] = $entry; $amenu[$m[1]] = $entry;
$menu_files[] = G5_ADMIN_PATH . '/' . $entry; $menu_files[] = G5_ADMIN_PATH . '/' . $entry;
} }
@asort($menu_files); @asort($menu_files);
foreach ($menu_files as $file) { foreach ($menu_files as $file) {
include_once($file); include_once $file;
} }
@ksort($amenu); @ksort($amenu);
@ -595,11 +640,21 @@ if( isset($menu) && $menu ){
} }
$arr_query = array(); $arr_query = array();
if (isset($sst)) $arr_query[] = 'sst='.$sst; if (isset($sst)) {
if (isset($sod)) $arr_query[] = 'sod='.$sod; $arr_query[] = 'sst=' . $sst;
if (isset($sfl)) $arr_query[] = 'sfl='.$sfl; }
if (isset($stx)) $arr_query[] = 'stx='.$stx; if (isset($sod)) {
if (isset($page)) $arr_query[] = 'page='.$page; $arr_query[] = 'sod=' . $sod;
}
if (isset($sfl)) {
$arr_query[] = 'sfl=' . $sfl;
}
if (isset($stx)) {
$arr_query[] = 'stx=' . $stx;
}
if (isset($page)) {
$arr_query[] = 'page=' . $page;
}
$qstr = implode("&amp;", $arr_query); $qstr = implode("&amp;", $arr_query);
if (isset($_REQUEST) && $_REQUEST) { if (isset($_REQUEST) && $_REQUEST) {

View File

@ -1,5 +1,7 @@
<?php <?php
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) return; if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) {
return;
}
$menu['menu400'] = array( $menu['menu400'] = array(
array('400000', '쇼핑몰관리', G5_ADMIN_URL . '/shop_admin/', 'shop_config'), array('400000', '쇼핑몰관리', G5_ADMIN_URL . '/shop_admin/', 'shop_config'),

View File

@ -1,5 +1,7 @@
<?php <?php
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) return; if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) {
return;
}
$menu['menu500'] = array( $menu['menu500'] = array(
array('500000', '쇼핑몰현황/기타', G5_ADMIN_URL . '/shop_admin/itemsellrank.php', 'shop_stats'), array('500000', '쇼핑몰현황/기타', G5_ADMIN_URL . '/shop_admin/itemsellrank.php', 'shop_stats'),

View File

@ -1,5 +1,7 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; if (!defined('_GNUBOARD_')) {
exit;
}
// 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전이 통합됨에 따라 그누보드 버전만 표시 // 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전이 통합됨에 따라 그누보드 버전만 표시
// $print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER; // $print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
@ -26,7 +28,9 @@ $print_version = 'Version '.G5_GNUBOARD_VER;
<script> <script>
$(".scroll_top").click(function() { $(".scroll_top").click(function() {
$("body,html").animate({scrollTop:0},400); $("body,html").animate({
scrollTop: 0
}, 400);
}) })
</script> </script>
@ -131,8 +135,7 @@ function submenu_hide() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on"); $(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
} }
function menu_rearrange(el) function menu_rearrange(el) {
{
var width = $("#gnb_1dul").width(); var width = $("#gnb_1dul").width();
var left = w1 = w2 = 0; var left = w1 = w2 = 0;
var idx = $(".gnb_1dli").index(el); var idx = $(".gnb_1dli").index(el);
@ -148,8 +151,7 @@ function menu_rearrange(el)
left += w1; left += w1;
} }
} }
</script> </script>
<?php <?php
include_once(G5_PATH.'/tail.sub.php'); require_once G5_PATH . '/tail.sub.php';

View File

@ -1,12 +1,13 @@
<?php <?php
include_once('./_common.php'); require_once './_common.php';
include_once(G5_LIB_PATH.'/json.lib.php'); require_once G5_LIB_PATH . '/json.lib.php';
set_session('ss_admin_token', ''); set_session('ss_admin_token', '');
$error = admin_referer_check(true); $error = admin_referer_check(true);
if($error) if ($error) {
die(json_encode(array('error' => $error, 'url' => G5_URL))); die(json_encode(array('error' => $error, 'url' => G5_URL)));
}
$token = get_admin_token(); $token = get_admin_token();

View File

@ -1,5 +1,5 @@
<?php <?php
include_once('./_common.php'); require_once './_common.php';
if (isset($_POST['admin_use_captcha'])) { if (isset($_POST['admin_use_captcha'])) {
set_session('ss_admin_use_captcha', true); set_session('ss_admin_use_captcha', true);

View File

@ -1,9 +1,10 @@
<?php <?php
$sub_menu = "100200"; $sub_menu = "100200";
include_once('./_common.php'); require_once './_common.php';
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
}
$sql_common = " from {$g5['auth_table']} a left join {$g5['member_table']} b on (a.mb_id=b.mb_id) "; $sql_common = " from {$g5['auth_table']} a left join {$g5['member_table']} b on (a.mb_id=b.mb_id) ";
@ -33,7 +34,9 @@ $total_count = $row['cnt'];
$rows = $config['cf_page_rows']; $rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지) if ($page < 1) {
$page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
}
$from_record = ($page - 1) * $rows; // 시작 열을 구함 $from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select * $sql = " select *
@ -46,7 +49,7 @@ $result = sql_query($sql);
$listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall btn_ov02">전체목록</a>'; $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall btn_ov02">전체목록</a>';
$g5['title'] = "관리권한설정"; $g5['title'] = "관리권한설정";
include_once('./admin.head.php'); require_once './admin.head.php';
$colspan = 5; $colspan = 5;
?> ?>
@ -91,8 +94,7 @@ $colspan = 5;
<tbody> <tbody>
<?php <?php
$count = 0; $count = 0;
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{
$is_continue = false; $is_continue = false;
// 회원아이디가 없는 메뉴는 삭제함 // 회원아이디가 없는 메뉴는 삭제함
if ($row['mb_id'] == '' && $row['mb_nick'] == '') { if ($row['mb_id'] == '' && $row['mb_nick'] == '') {
@ -101,14 +103,14 @@ $colspan = 5;
} }
// 메뉴번호가 바뀌는 경우에 현재 없는 저장된 메뉴는 삭제함 // 메뉴번호가 바뀌는 경우에 현재 없는 저장된 메뉴는 삭제함
if (!isset($auth_menu[$row['au_menu']])) if (!isset($auth_menu[$row['au_menu']])) {
{
sql_query(" delete from {$g5['auth_table']} where au_menu = '{$row['au_menu']}' "); sql_query(" delete from {$g5['auth_table']} where au_menu = '{$row['au_menu']}' ");
$is_continue = true; $is_continue = true;
} }
if($is_continue) if ($is_continue) {
continue; continue;
}
$mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']); $mb_nick = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
@ -133,8 +135,9 @@ $colspan = 5;
$count++; $count++;
} }
if ($count == 0) if ($count == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>'; echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?> ?>
</tbody> </tbody>
</table> </table>
@ -148,10 +151,11 @@ $colspan = 5;
//if (isset($stx)) //if (isset($stx))
// echo '<script>document.fsearch.sfl.value = "'.$sfl.'";</script>'."\n"; // echo '<script>document.fsearch.sfl.value = "'.$sfl.'";</script>'."\n";
if (strstr($sfl, 'mb_id')) if (strstr($sfl, 'mb_id')) {
$mb_id = $stx; $mb_id = $stx;
else } else {
$mb_id = ''; $mb_id = '';
}
?> ?>
</form> </form>
@ -198,11 +202,11 @@ echo $pagelist;
<select id="au_menu" name="au_menu" required class="required"> <select id="au_menu" name="au_menu" required class="required">
<option value=''>선택하세요</option> <option value=''>선택하세요</option>
<?php <?php
foreach($auth_menu as $key=>$value) foreach ($auth_menu as $key => $value) {
{ if (!(substr($key, -3) == '000' || $key == '-' || !$key)) {
if (!(substr($key, -3) == '000' || $key == '-' || !$key))
echo '<option value="' . $key . '">' . $key . ' ' . $value . '</option>'; echo '<option value="' . $key . '">' . $key . ' ' . $value . '</option>';
} }
}
?> ?>
</select> </select>
</td> </td>
@ -222,7 +226,7 @@ echo $pagelist;
<th scope="row">자동등록방지</th> <th scope="row">자동등록방지</th>
<td> <td>
<?php <?php
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
$captcha_html = captcha_html(); $captcha_html = captcha_html();
$captcha_js = chk_captcha_js(); $captcha_js = chk_captcha_js();
echo $captcha_html; echo $captcha_html;
@ -248,8 +252,7 @@ function fauth_add_submit(f){
return true; return true;
} }
function fauthlist_submit(f) function fauthlist_submit(f) {
{
if (!is_checked("chk[]")) { if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요."); alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
return false; return false;
@ -266,4 +269,4 @@ function fauthlist_submit(f)
</script> </script>
<?php <?php
include_once ('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,26 +1,27 @@
<?php <?php
$sub_menu = "100200"; $sub_menu = "100200";
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
}
check_admin_token(); check_admin_token();
$count = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0; $count = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$post_act_button = isset($_POST['act_button']) ? clean_xss_tags($_POST['act_button'], 1, 1) : ''; $post_act_button = isset($_POST['act_button']) ? clean_xss_tags($_POST['act_button'], 1, 1) : '';
if (!$count) if (!$count) {
alert($_POST['act_button'] . " 하실 항목을 하나 이상 체크하세요."); alert($_POST['act_button'] . " 하실 항목을 하나 이상 체크하세요.");
}
if ((isset($_POST['mb_id']) && !is_array($_POST['mb_id'])) || (isset($_POST['au_menu']) && !is_array($_POST['au_menu']))) { if ((isset($_POST['mb_id']) && !is_array($_POST['mb_id'])) || (isset($_POST['au_menu']) && !is_array($_POST['au_menu']))) {
alert("잘못된 요청입니다."); alert("잘못된 요청입니다.");
} }
for ($i=0; $i<$count; $i++) for ($i = 0; $i < $count; $i++) {
{
// 실제 번호를 넘김 // 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0; $k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;

View File

@ -1,23 +1,25 @@
<?php <?php
$sub_menu = "100200"; $sub_menu = "100200";
include_once('./_common.php'); require_once './_common.php';
include_once(G5_LIB_PATH.'/mailer.lib.php'); require_once G5_LIB_PATH . '/mailer.lib.php';
$au_menu = isset($_POST['au_menu']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['au_menu']) : ''; $au_menu = isset($_POST['au_menu']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['au_menu']) : '';
$post_r = isset($_POST['r']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['r']) : ''; $post_r = isset($_POST['r']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['r']) : '';
$post_w = isset($_POST['w']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['w']) : ''; $post_w = isset($_POST['w']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['w']) : '';
$post_d = isset($_POST['d']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['d']) : ''; $post_d = isset($_POST['d']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['d']) : '';
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
}
$mb = get_member($mb_id); $mb = get_member($mb_id);
if (!$mb['mb_id']) if (!$mb['mb_id']) {
alert('존재하는 회원아이디가 아닙니다.'); alert('존재하는 회원아이디가 아닙니다.');
}
check_admin_token(); check_admin_token();
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
if (!chk_captcha()) { if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.'); alert('자동등록방지 숫자가 틀렸습니다.');
@ -27,7 +29,7 @@ $sql = " insert into {$g5['auth_table']}
set mb_id = '$mb_id', set mb_id = '$mb_id',
au_menu = '$au_menu', au_menu = '$au_menu',
au_auth = '{$post_r},{$post_w},{$post_d}' "; au_auth = '{$post_r},{$post_w},{$post_d}' ";
$result = sql_query($sql, FALSE); $result = sql_query($sql, false);
if (!$result) { if (!$result) {
$sql = " update {$g5['auth_table']} $sql = " update {$g5['auth_table']}
set au_auth = '{$post_r},{$post_w},{$post_d}' set au_auth = '{$post_r},{$post_w},{$post_d}'

View File

@ -1,11 +1,11 @@
<?php <?php
$sub_menu = "300100"; $sub_menu = "300100";
include_once("./_common.php"); require_once "./_common.php";
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
$g5['title'] = '게시판 복사'; $g5['title'] = '게시판 복사';
include_once(G5_PATH.'/head.sub.php'); require_once G5_PATH . '/head.sub.php';
$bo_table = $_REQUEST['bo_table']; $bo_table = $_REQUEST['bo_table'];
if (empty($bo_table)) { if (empty($bo_table)) {
@ -61,8 +61,7 @@ if (empty($bo_table)) {
</div> </div>
<script> <script>
function fboardcopy_check(f) function fboardcopy_check(f) {
{
<?php <?php
if (!$w) { if (!$w) {
@ -88,4 +87,4 @@ function fboardcopy_check(f)
<?php <?php
include_once(G5_PATH.'/tail.sub.php'); require_once G5_PATH . '/tail.sub.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = '300100'; $sub_menu = '300100';
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();

View File

@ -1,7 +1,7 @@
<?php <?php
$sub_menu = "300100"; $sub_menu = "300100";
include_once('./_common.php'); require_once './_common.php';
include_once(G5_EDITOR_LIB); require_once G5_EDITOR_LIB;
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -51,9 +51,11 @@ if (!isset($board['bo_use_sns'])) {
$result = sql_query(" select bo_table from `{$g5['board_table']}` "); $result = sql_query(" select bo_table from `{$g5['board_table']}` ");
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
sql_query(" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}` sql_query(
" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
ADD `wr_facebook_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_ip`, ADD `wr_facebook_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_ip`,
ADD `wr_twitter_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_facebook_user` ", false); ADD `wr_twitter_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_facebook_user` ", false
);
} }
} }
@ -68,8 +70,10 @@ if (!isset($board['bo_use_list_file'])) {
$result = sql_query(" select bo_table from `{$g5['board_table']}` "); $result = sql_query(" select bo_table from `{$g5['board_table']}` ");
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i=0; $row=sql_fetch_array($result); $i++) {
sql_query(" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}` sql_query(
ADD `wr_file` TINYINT NOT NULL DEFAULT '0' AFTER `wr_datetime` ", false); " ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
ADD `wr_file` TINYINT NOT NULL DEFAULT '0' AFTER `wr_datetime` ", false
);
} }
} }
@ -201,7 +205,7 @@ if ($is_admin != 'super') {
} }
$g5['title'] = $html_title; $g5['title'] = $html_title;
include_once('./admin.head.php'); require_once './admin.head.php';
$pg_anchor = '<ul class="anchor"> $pg_anchor = '<ul class="anchor">
<li><a href="#anc_bo_basic">기본 설정</a></li> <li><a href="#anc_bo_basic">기본 설정</a></li>
@ -937,7 +941,7 @@ $pg_anchor = '<ul class="anchor">
<?php <?php
echo help("파일 경로를 입력 또는 수정시 캡챠를 반드시 입력해야 합니다."); echo help("파일 경로를 입력 또는 수정시 캡챠를 반드시 입력해야 합니다.");
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); include_once G5_CAPTCHA_PATH.'/captcha.lib.php';
$captcha_html = captcha_html(); $captcha_html = captcha_html();
$captcha_js = chk_captcha_js(); $captcha_js = chk_captcha_js();
echo $captcha_html; echo $captcha_html;
@ -1491,4 +1495,4 @@ function fboardform_submit(f)
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300100"; $sub_menu = "300100";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
@ -51,7 +51,7 @@ $result = sql_query($sql);
$listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">전체목록</a>'; $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">전체목록</a>';
$g5['title'] = '게시판관리'; $g5['title'] = '게시판관리';
include_once('./admin.head.php'); require_once './admin.head.php';
$colspan = 15; $colspan = 15;
?> ?>
@ -207,8 +207,7 @@ $colspan = 15;
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&amp;page='); ?> <?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&amp;page='); ?>
<script> <script>
function fboardlist_submit(f) function fboardlist_submit(f) {
{
if (!is_checked("chk[]")) { if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요."); alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
return false; return false;
@ -232,4 +231,4 @@ $(function(){
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300100"; $sub_menu = "300100";
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();
@ -86,7 +86,7 @@ if ($act_button === "선택수정") {
$tmp_bo_table = isset($_POST['board_table'][$k]) ? trim(clean_xss_tags($_POST['board_table'][$k], 1, 1)) : ''; $tmp_bo_table = isset($_POST['board_table'][$k]) ? trim(clean_xss_tags($_POST['board_table'][$k], 1, 1)) : '';
if (preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table)) { if (preg_match("/^[A-Za-z0-9_]+$/", $tmp_bo_table)) {
include('./board_delete.inc.php'); include './board_delete.inc.php';
} }
} }
} }

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = '300100'; $sub_menu = '300100';
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -9,7 +9,7 @@ if (!$board['bo_table']) {
} }
$g5['title'] = $board['bo_subject'] . ' 게시판 썸네일 삭제'; $g5['title'] = $board['bo_subject'] . ' 게시판 썸네일 삭제';
include_once('./admin.head.php'); require_once './admin.head.php';
?> ?>
<div class="local_desc02 local_desc"> <div class="local_desc02 local_desc">
@ -50,4 +50,4 @@ if (is_dir($dir)) {
<div class="btn_confirm01 btn_confirm"><a href="./board_form.php?w=u&amp;bo_table=<?php echo $bo_table; ?>&amp;<?php echo $qstr; ?>">게시판 수정으로 돌아가기</a></div> <div class="btn_confirm01 btn_confirm"><a href="./board_form.php?w=u&amp;bo_table=<?php echo $bo_table; ?>&amp;<?php echo $qstr; ?>">게시판 수정으로 돌아가기</a></div>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300200"; $sub_menu = "300200";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -41,7 +41,7 @@ $row1 = sql_fetch($sql1);
$group_member_count = $row1['cnt']; $group_member_count = $row1['cnt'];
$g5['title'] = $html_title; $g5['title'] = $html_title;
include_once('./admin.head.php'); require_once './admin.head.php';
?> ?>
<form name="fboardgroup" id="fboardgroup" action="./boardgroup_form_update.php" onsubmit="return fboardgroup_check(this);" method="post" autocomplete="off"> <form name="fboardgroup" id="fboardgroup" action="./boardgroup_form_update.php" onsubmit="return fboardgroup_check(this);" method="post" autocomplete="off">
@ -161,12 +161,11 @@ include_once('./admin.head.php');
</div> </div>
<script> <script>
function fboardgroup_check(f) function fboardgroup_check(f) {
{
f.action = './boardgroup_form_update.php'; f.action = './boardgroup_form_update.php';
return true; return true;
} }
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300200"; $sub_menu = "300200";
include_once('./_common.php'); require_once './_common.php';
if ($w == 'u') { if ($w == 'u') {
check_demo(); check_demo();

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300200"; $sub_menu = "300200";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
@ -57,7 +57,7 @@ $result = sql_query($sql);
$listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">처음</a>'; $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">처음</a>';
$g5['title'] = '게시판그룹설정'; $g5['title'] = '게시판그룹설정';
include_once('./admin.head.php'); require_once './admin.head.php';
$colspan = 10; $colspan = 10;
?> ?>
@ -192,8 +192,7 @@ echo $pagelist;
?> ?>
<script> <script>
function fboardgrouplist_submit(f) function fboardgrouplist_submit(f) {
{
if (!is_checked("chk[]")) { if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요."); alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
return false; return false;
@ -210,4 +209,4 @@ function fboardgrouplist_submit(f)
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300200"; $sub_menu = "300200";
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300200"; $sub_menu = "300200";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -12,13 +12,12 @@ if (! (isset($mb['mb_id']) && $mb['mb_id'])) {
} }
$g5['title'] = '접근가능그룹'; $g5['title'] = '접근가능그룹';
include_once('./admin.head.php'); require_once './admin.head.php';
$colspan = 4; $colspan = 4;
?> ?>
<form name="fboardgroupmember_form" id="fboardgroupmember_form" action="./boardgroupmember_update.php" <form name="fboardgroupmember_form" id="fboardgroupmember_form" action="./boardgroupmember_update.php" onsubmit="return boardgroupmember_form_check(this)" method="post">
onsubmit="return boardgroupmember_form_check(this)" method="post">
<input type="hidden" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id"> <input type="hidden" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id">
<input type="hidden" name="token" value="" id="token"> <input type="hidden" name="token" value="" id="token">
@ -50,8 +49,7 @@ $colspan = 4;
</div> </div>
</form> </form>
<form name="fboardgroupmember" id="fboardgroupmember" action="./boardgroupmember_update.php" <form name="fboardgroupmember" id="fboardgroupmember" action="./boardgroupmember_update.php" onsubmit="return fboardgroupmember_submit(this);" method="post">
onsubmit="return fboardgroupmember_submit(this);" method="post">
<input type="hidden" name="sst" value="<?php echo $sst ?>" id="sst"> <input type="hidden" name="sst" value="<?php echo $sst ?>" id="sst">
<input type="hidden" name="sod" value="<?php echo $sod ?>" id="sod"> <input type="hidden" name="sod" value="<?php echo $sod ?>" id="sod">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>" id="sfl"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>" id="sfl">
@ -113,8 +111,7 @@ $colspan = 4;
</form> </form>
<script> <script>
function fboardgroupmember_submit(f) function fboardgroupmember_submit(f) {
{
if (!is_checked("chk[]")) { if (!is_checked("chk[]")) {
alert("선택삭제 하실 항목을 하나 이상 선택하세요."); alert("선택삭제 하실 항목을 하나 이상 선택하세요.");
return false; return false;
@ -123,8 +120,7 @@ function fboardgroupmember_submit(f)
return true; return true;
} }
function boardgroupmember_form_check(f) function boardgroupmember_form_check(f) {
{
if (f.gr_id.value == '') { if (f.gr_id.value == '') {
alert('접근가능 그룹을 선택하세요.'); alert('접근가능 그룹을 선택하세요.');
return false; return false;
@ -135,4 +131,4 @@ function boardgroupmember_form_check(f)
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300200"; $sub_menu = "300200";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
@ -52,7 +52,7 @@ $sql = " select *
$result = sql_query($sql); $result = sql_query($sql);
$g5['title'] = $gr['gr_subject'] . ' 그룹 접근가능회원 (그룹아이디:' . $gr['gr_id'] . ')'; $g5['title'] = $gr['gr_subject'] . ' 그룹 접근가능회원 (그룹아이디:' . $gr['gr_id'] . ')';
include_once('./admin.head.php'); require_once './admin.head.php';
$colspan = 7; $colspan = 7;
?> ?>
@ -68,8 +68,7 @@ $colspan = 7;
<input type="submit" value="검색" class="btn_submit"> <input type="submit" value="검색" class="btn_submit">
</form> </form>
<form name="fboardgroupmember" id="fboardgroupmember" action="./boardgroupmember_update.php" <form name="fboardgroupmember" id="fboardgroupmember" action="./boardgroupmember_update.php" onsubmit="return fboardgroupmember_submit(this);" method="post">
onsubmit="return fboardgroupmember_submit(this);" method="post">
<input type="hidden" name="sst" value="<?php echo $sst ?>"> <input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>"> <input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
@ -144,8 +143,7 @@ echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pa
?> ?>
<script> <script>
function fboardgroupmember_submit(f) function fboardgroupmember_submit(f) {
{
if (!is_checked("chk[]")) { if (!is_checked("chk[]")) {
alert("선택삭제 하실 항목을 하나 이상 선택하세요."); alert("선택삭제 하실 항목을 하나 이상 선택하세요.");
return false; return false;
@ -156,4 +154,4 @@ function fboardgroupmember_submit(f)
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "300200"; $sub_menu = "300200";
include_once('./_common.php'); require_once './_common.php';
sql_query(" ALTER TABLE {$g5['group_member_table']} CHANGE `gm_id` `gm_id` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ", false); sql_query(" ALTER TABLE {$g5['group_member_table']} CHANGE `gm_id` `gm_id` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ", false);

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "100510"; $sub_menu = "100510";
include_once('./_common.php'); require_once './_common.php';
if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) { if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) {
alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL)); alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL));
@ -11,7 +11,7 @@ if ($is_admin != 'super') {
} }
$g5['title'] = 'Browscap 업데이트'; $g5['title'] = 'Browscap 업데이트';
include_once('./admin.head.php'); require_once './admin.head.php';
?> ?>
<div id="processing"> <div id="processing">
@ -43,4 +43,4 @@ $(function() {
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "100520"; $sub_menu = "100520";
include_once('./_common.php'); require_once './_common.php';
if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) { if (!(version_compare(phpversion(), '5.3.0', '>=') && defined('G5_BROWSCAP_USE') && G5_BROWSCAP_USE)) {
alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL)); alert('사용할 수 없는 기능입니다.', correct_goto_url(G5_ADMIN_URL));
@ -16,7 +16,7 @@ if (!$rows) {
} }
$g5['title'] = '접속로그 변환'; $g5['title'] = '접속로그 변환';
include_once('./admin.head.php'); require_once './admin.head.php';
?> ?>
<div id="processing"> <div id="processing">
@ -32,7 +32,9 @@ $(function() {
$.ajax({ $.ajax({
method: "GET", method: "GET",
url: "./browscap_converter.php", url: "./browscap_converter.php",
data: { rows: "<?php echo strval($rows); ?>" }, data: {
rows: "<?php echo strval($rows); ?>"
},
async: true, async: true,
cache: false, cache: false,
dataType: "html", dataType: "html",
@ -45,4 +47,4 @@ $(function() {
</script> </script>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
ini_set('memory_limit', '-1'); ini_set('memory_limit', '-1');
include_once('./_common.php'); require_once './_common.php';
// clean the output buffer // clean the output buffer
ob_end_clean(); ob_end_clean();
@ -20,7 +20,7 @@ if (!is_file(G5_DATA_PATH.'/cache/browscap_cache.php')) {
exit; exit;
} }
include_once(G5_PLUGIN_PATH.'/browscap/Browscap.php'); require_once G5_PLUGIN_PATH . '/browscap/Browscap.php';
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache'); $browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache');
$browscap->doAutoUpdate = false; $browscap->doAutoUpdate = false;
$browscap->cacheFilename = 'browscap_cache.php'; $browscap->cacheFilename = 'browscap_cache.php';

View File

@ -2,7 +2,7 @@
ini_set('memory_limit', '-1'); ini_set('memory_limit', '-1');
$sub_menu = "100510"; $sub_menu = "100510";
include_once('./_common.php'); require_once './_common.php';
// clean the output buffer // clean the output buffer
ob_end_clean(); ob_end_clean();
@ -15,7 +15,7 @@ if ($is_admin != 'super') {
die('최고관리자만 접근 가능합니다.'); die('최고관리자만 접근 가능합니다.');
} }
include_once(G5_PLUGIN_PATH.'/browscap/Browscap.php'); require_once G5_PLUGIN_PATH . '/browscap/Browscap.php';
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache'); $browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache');
$browscap->updateMethod = 'cURL'; $browscap->updateMethod = 'cURL';

View File

@ -1,11 +1,12 @@
<?php <?php
$sub_menu = '100900'; $sub_menu = '100900';
include_once('./_common.php'); require_once './_common.php';
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.', G5_URL); alert('최고관리자만 접근 가능합니다.', G5_URL);
}
@include_once('./safe_check.php'); @require_once './safe_check.php';
if (function_exists('social_log_file_delete')) { if (function_exists('social_log_file_delete')) {
social_log_file_delete(); social_log_file_delete();
} }
@ -13,7 +14,7 @@ if(function_exists('social_log_file_delete')){
run_event('adm_cache_file_delete_before'); run_event('adm_cache_file_delete_before');
$g5['title'] = '캐시파일 일괄삭제'; $g5['title'] = '캐시파일 일괄삭제';
include_once('./admin.head.php'); require_once './admin.head.php';
?> ?>
<div class="local_desc02 local_desc"> <div class="local_desc02 local_desc">
@ -44,10 +45,11 @@ if (is_array($files)) {
flush(); flush();
if ($cnt%10==0) if ($cnt % 10 == 0) {
echo PHP_EOL; echo PHP_EOL;
} }
} }
}
run_event('adm_cache_file_delete'); run_event('adm_cache_file_delete');
@ -56,4 +58,4 @@ echo '<div class="local_desc01 local_desc"><p><strong>최신글 캐시파일 '.$
?> ?>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,12 +1,13 @@
<?php <?php
$sub_menu = '100910'; $sub_menu = '100910';
include_once('./_common.php'); require_once './_common.php';
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.', G5_URL); alert('최고관리자만 접근 가능합니다.', G5_URL);
}
$g5['title'] = '캡챠파일 일괄삭제'; $g5['title'] = '캡챠파일 일괄삭제';
include_once('./admin.head.php'); require_once './admin.head.php';
?> ?>
<div class="local_desc02 local_desc"> <div class="local_desc02 local_desc">
@ -31,7 +32,9 @@ if (is_array($files)) {
foreach ($files as $gcaptcha_file) { foreach ($files as $gcaptcha_file) {
$modification_time = filemtime($gcaptcha_file); // 파일접근시간 $modification_time = filemtime($gcaptcha_file); // 파일접근시간
if ($modification_time > $before_time) continue; if ($modification_time > $before_time) {
continue;
}
$cnt++; $cnt++;
unlink($gcaptcha_file); unlink($gcaptcha_file);
@ -39,14 +42,15 @@ if (is_array($files)) {
flush(); flush();
if ($cnt%10==0) if ($cnt % 10 == 0) {
echo PHP_EOL; echo PHP_EOL;
} }
} }
}
echo '<li>완료됨</li></ul>' . PHP_EOL; echo '<li>완료됨</li></ul>' . PHP_EOL;
echo '<div class="local_desc01 local_desc"><p><strong>캡챠파일 ' . $cnt . '건의 삭제 완료됐습니다.</strong><br>프로그램의 실행을 끝마치셔도 좋습니다.</p></div>' . PHP_EOL; echo '<div class="local_desc01 local_desc"><p><strong>캡챠파일 ' . $cnt . '건의 삭제 완료됐습니다.</strong><br>프로그램의 실행을 끝마치셔도 좋습니다.</p></div>' . PHP_EOL;
?> ?>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,64 +1,92 @@
<?php <?php
$sub_menu = "100100"; $sub_menu = "100100";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
}
if (!isset($config['cf_add_script'])) { if (!isset($config['cf_add_script'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_add_script` TEXT NOT NULL AFTER `cf_admin_email_name` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_add_script` TEXT NOT NULL AFTER `cf_admin_email_name` ",
true
);
} }
if (!isset($config['cf_mobile_new_skin'])) { if (!isset($config['cf_mobile_new_skin'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_mobile_new_skin` VARCHAR(255) NOT NULL AFTER `cf_memo_send_point`, ADD `cf_mobile_new_skin` VARCHAR(255) NOT NULL AFTER `cf_memo_send_point`,
ADD `cf_mobile_search_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_new_skin`, ADD `cf_mobile_search_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_new_skin`,
ADD `cf_mobile_connect_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_search_skin`, ADD `cf_mobile_connect_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_search_skin`,
ADD `cf_mobile_member_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_connect_skin` ", true); ADD `cf_mobile_member_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_connect_skin` ",
true
);
} }
if (isset($config['cf_gcaptcha_mp3'])) { if (isset($config['cf_gcaptcha_mp3'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
CHANGE `cf_gcaptcha_mp3` `cf_captcha_mp3` VARCHAR(255) NOT NULL DEFAULT '' ", true); " ALTER TABLE `{$g5['config_table']}`
CHANGE `cf_gcaptcha_mp3` `cf_captcha_mp3` VARCHAR(255) NOT NULL DEFAULT '' ",
true
);
} elseif (!isset($config['cf_captcha_mp3'])) { } elseif (!isset($config['cf_captcha_mp3'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_captcha_mp3` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_mobile_member_skin` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_captcha_mp3` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_mobile_member_skin` ",
true
);
} }
if (!isset($config['cf_editor'])) { if (!isset($config['cf_editor'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_editor` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_captcha_mp3` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_editor` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_captcha_mp3` ",
true
);
} }
if (!isset($config['cf_googl_shorturl_apikey'])) { if (!isset($config['cf_googl_shorturl_apikey'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_googl_shorturl_apikey` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_captcha_mp3` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_googl_shorturl_apikey` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_captcha_mp3` ",
true
);
} }
if (!isset($config['cf_mobile_pages'])) { if (!isset($config['cf_mobile_pages'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_mobile_pages` INT(11) NOT NULL DEFAULT '0' AFTER `cf_write_pages` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_mobile_pages` INT(11) NOT NULL DEFAULT '0' AFTER `cf_write_pages` ",
true
);
sql_query(" UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true); sql_query(" UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true);
} }
if (!isset($config['cf_facebook_appid'])) { if (!isset($config['cf_facebook_appid'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_facebook_appid` VARCHAR(255) NOT NULL AFTER `cf_googl_shorturl_apikey`, ADD `cf_facebook_appid` VARCHAR(255) NOT NULL AFTER `cf_googl_shorturl_apikey`,
ADD `cf_facebook_secret` VARCHAR(255) NOT NULL AFTER `cf_facebook_appid`, ADD `cf_facebook_secret` VARCHAR(255) NOT NULL AFTER `cf_facebook_appid`,
ADD `cf_twitter_key` VARCHAR(255) NOT NULL AFTER `cf_facebook_secret`, ADD `cf_twitter_key` VARCHAR(255) NOT NULL AFTER `cf_facebook_secret`,
ADD `cf_twitter_secret` VARCHAR(255) NOT NULL AFTER `cf_twitter_key` ", true); ADD `cf_twitter_secret` VARCHAR(255) NOT NULL AFTER `cf_twitter_key` ",
true
);
} }
// uniqid 테이블이 없을 경우 생성 // uniqid 테이블이 없을 경우 생성
if (!sql_query(" DESC {$g5['uniqid_table']} ", false)) { if (!sql_query(" DESC {$g5['uniqid_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['uniqid_table']}` ( sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['uniqid_table']}` (
`uq_id` bigint(20) unsigned NOT NULL, `uq_id` bigint(20) unsigned NOT NULL,
`uq_ip` varchar(255) NOT NULL, `uq_ip` varchar(255) NOT NULL,
PRIMARY KEY (`uq_id`) PRIMARY KEY (`uq_id`)
) ", false); ) ",
false
);
} }
if (!sql_query(" SELECT uq_ip from {$g5['uniqid_table']} limit 1 ", false)) { if (!sql_query(" SELECT uq_ip from {$g5['uniqid_table']} limit 1 ", false)) {
@ -67,7 +95,8 @@ if(!sql_query(" SELECT uq_ip from {$g5['uniqid_table']} limit 1 ", false)) {
// 임시저장 테이블이 없을 경우 생성 // 임시저장 테이블이 없을 경우 생성
if (!sql_query(" DESC {$g5['autosave_table']} ", false)) { if (!sql_query(" DESC {$g5['autosave_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['autosave_table']}` ( sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['autosave_table']}` (
`as_id` int(11) NOT NULL AUTO_INCREMENT, `as_id` int(11) NOT NULL AUTO_INCREMENT,
`mb_id` varchar(20) NOT NULL, `mb_id` varchar(20) NOT NULL,
`as_uid` bigint(20) unsigned NOT NULL, `as_uid` bigint(20) unsigned NOT NULL,
@ -77,32 +106,47 @@ if(!sql_query(" DESC {$g5['autosave_table']} ", false)) {
PRIMARY KEY (`as_id`), PRIMARY KEY (`as_id`),
UNIQUE KEY `as_uid` (`as_uid`), UNIQUE KEY `as_uid` (`as_uid`),
KEY `mb_id` (`mb_id`) KEY `mb_id` (`mb_id`)
) ", false); ) ",
false
);
} }
if (!isset($config['cf_admin_email'])) { if (!isset($config['cf_admin_email'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_admin_email` VARCHAR(255) NOT NULL AFTER `cf_admin` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_admin_email` VARCHAR(255) NOT NULL AFTER `cf_admin` ",
true
);
} }
if (!isset($config['cf_admin_email_name'])) { if (!isset($config['cf_admin_email_name'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_admin_email_name` VARCHAR(255) NOT NULL AFTER `cf_admin_email` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_admin_email_name` VARCHAR(255) NOT NULL AFTER `cf_admin_email` ",
true
);
} }
if (!isset($config['cf_cert_use'])) { if (!isset($config['cf_cert_use'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_cert_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `cf_editor`, ADD `cf_cert_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `cf_editor`,
ADD `cf_cert_ipin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_use`, ADD `cf_cert_ipin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_use`,
ADD `cf_cert_hp` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_ipin`, ADD `cf_cert_hp` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_ipin`,
ADD `cf_cert_kcb_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_hp`, ADD `cf_cert_kcb_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_hp`,
ADD `cf_cert_kcp_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kcb_cd`, ADD `cf_cert_kcp_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kcb_cd`,
ADD `cf_cert_limit` INT(11) NOT NULL DEFAULT '0' AFTER `cf_cert_kcp_cd` ", true); ADD `cf_cert_limit` INT(11) NOT NULL DEFAULT '0' AFTER `cf_cert_kcp_cd` ",
sql_query(" ALTER TABLE `{$g5['member_table']}` true
CHANGE `mb_hp_certify` `mb_certify` VARCHAR(20) NOT NULL DEFAULT '' ", true); );
sql_query(
" ALTER TABLE `{$g5['member_table']}`
CHANGE `mb_hp_certify` `mb_certify` VARCHAR(20) NOT NULL DEFAULT '' ",
true
);
sql_query(" update {$g5['member_table']} set mb_certify = 'hp' where mb_certify = '1' "); sql_query(" update {$g5['member_table']} set mb_certify = 'hp' where mb_certify = '1' ");
sql_query(" update {$g5['member_table']} set mb_certify = '' where mb_certify = '0' "); sql_query(" update {$g5['member_table']} set mb_certify = '' where mb_certify = '0' ");
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['cert_history_table']}` ( sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['cert_history_table']}` (
`cr_id` int(11) NOT NULL auto_increment, `cr_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(255) NOT NULL DEFAULT '', `mb_id` varchar(255) NOT NULL DEFAULT '',
`cr_company` varchar(255) NOT NULL DEFAULT '', `cr_company` varchar(255) NOT NULL DEFAULT '',
@ -112,89 +156,131 @@ if(!isset($config['cf_cert_use'])) {
`cr_time` time NOT NULL DEFAULT '00:00:00', `cr_time` time NOT NULL DEFAULT '00:00:00',
PRIMARY KEY (`cr_id`), PRIMARY KEY (`cr_id`),
KEY `mb_id` (`mb_id`) KEY `mb_id` (`mb_id`)
)", true); )",
true
);
} }
if (!isset($config['cf_analytics'])) { if (!isset($config['cf_analytics'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_analytics` TEXT NOT NULL AFTER `cf_intercept_ip` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_analytics` TEXT NOT NULL AFTER `cf_intercept_ip` ",
true
);
} }
if (!isset($config['cf_add_meta'])) { if (!isset($config['cf_add_meta'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_add_meta` TEXT NOT NULL AFTER `cf_analytics` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_add_meta` TEXT NOT NULL AFTER `cf_analytics` ",
true
);
} }
if (!isset($config['cf_syndi_token'])) { if (!isset($config['cf_syndi_token'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_syndi_token` VARCHAR(255) NOT NULL AFTER `cf_add_meta` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_syndi_token` VARCHAR(255) NOT NULL AFTER `cf_add_meta` ",
true
);
} }
if (!isset($config['cf_syndi_except'])) { if (!isset($config['cf_syndi_except'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_syndi_except` TEXT NOT NULL AFTER `cf_syndi_token` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_syndi_except` TEXT NOT NULL AFTER `cf_syndi_token` ",
true
);
} }
if (!isset($config['cf_sms_use'])) { if (!isset($config['cf_sms_use'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_sms_use` varchar(255) NOT NULL DEFAULT '' AFTER `cf_cert_limit`, ADD `cf_sms_use` varchar(255) NOT NULL DEFAULT '' AFTER `cf_cert_limit`,
ADD `cf_icode_id` varchar(255) NOT NULL DEFAULT '' AFTER `cf_sms_use`, ADD `cf_icode_id` varchar(255) NOT NULL DEFAULT '' AFTER `cf_sms_use`,
ADD `cf_icode_pw` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_id`, ADD `cf_icode_pw` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_id`,
ADD `cf_icode_server_ip` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_pw`, ADD `cf_icode_server_ip` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_pw`,
ADD `cf_icode_server_port` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_server_ip` ", true); ADD `cf_icode_server_port` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_server_ip` ",
true
);
} }
if (!isset($config['cf_mobile_page_rows'])) { if (!isset($config['cf_mobile_page_rows'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_mobile_page_rows` int(11) NOT NULL DEFAULT '0' AFTER `cf_page_rows` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_mobile_page_rows` int(11) NOT NULL DEFAULT '0' AFTER `cf_page_rows` ",
true
);
} }
if (!isset($config['cf_cert_req'])) { if (!isset($config['cf_cert_req'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_cert_req` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_cert_limit` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_cert_req` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_cert_limit` ",
true
);
} }
if (!isset($config['cf_faq_skin'])) { if (!isset($config['cf_faq_skin'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_connect_skin`, ADD `cf_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_connect_skin`,
ADD `cf_mobile_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_mobile_connect_skin` ", true); ADD `cf_mobile_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_mobile_connect_skin` ",
true
);
} }
// LG유플러스 본인확인 필드 추가 // LG유플러스 본인확인 필드 추가
if (!isset($config['cf_lg_mid'])) { if (!isset($config['cf_lg_mid'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_lg_mid` varchar(255) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`, ADD `cf_lg_mid` varchar(255) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`,
ADD `cf_lg_mert_key` varchar(255) NOT NULL DEFAULT '' AFTER `cf_lg_mid` ", true); ADD `cf_lg_mert_key` varchar(255) NOT NULL DEFAULT '' AFTER `cf_lg_mid` ",
true
);
} }
if (!isset($config['cf_optimize_date'])) { if (!isset($config['cf_optimize_date'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_optimize_date` date NOT NULL default '0000-00-00' AFTER `cf_popular_del` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_optimize_date` date NOT NULL default '0000-00-00' AFTER `cf_popular_del` ",
true
);
} }
// 카카오톡링크 api 키 // 카카오톡링크 api 키
if (!isset($config['cf_kakao_js_apikey'])) { if (!isset($config['cf_kakao_js_apikey'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_kakao_js_apikey` varchar(255) NOT NULL DEFAULT '' AFTER `cf_googl_shorturl_apikey` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_kakao_js_apikey` varchar(255) NOT NULL DEFAULT '' AFTER `cf_googl_shorturl_apikey` ",
true
);
} }
// SMS 전송유형 필드 추가 // SMS 전송유형 필드 추가
if (!isset($config['cf_sms_type'])) { if (!isset($config['cf_sms_type'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_sms_type` varchar(10) NOT NULL DEFAULT '' AFTER `cf_sms_use` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_sms_type` varchar(10) NOT NULL DEFAULT '' AFTER `cf_sms_use` ",
true
);
} }
// 접속자 정보 필드 추가 // 접속자 정보 필드 추가
if (!sql_query(" select vi_browser from {$g5['visit_table']} limit 1 ")) { if (!sql_query(" select vi_browser from {$g5['visit_table']} limit 1 ")) {
sql_query(" ALTER TABLE `{$g5['visit_table']}` sql_query(
" ALTER TABLE `{$g5['visit_table']}`
ADD `vi_browser` varchar(255) NOT NULL DEFAULT '' AFTER `vi_agent`, ADD `vi_browser` varchar(255) NOT NULL DEFAULT '' AFTER `vi_agent`,
ADD `vi_os` varchar(255) NOT NULL DEFAULT '' AFTER `vi_browser`, ADD `vi_os` varchar(255) NOT NULL DEFAULT '' AFTER `vi_browser`,
ADD `vi_device` varchar(255) NOT NULL DEFAULT '' AFTER `vi_os` ", true); ADD `vi_device` varchar(255) NOT NULL DEFAULT '' AFTER `vi_os` ",
true
);
} }
//소셜 로그인 관련 필드 및 구글 리챕챠 필드 추가 //소셜 로그인 관련 필드 및 구글 리챕챠 필드 추가
if (!isset($config['cf_social_login_use'])) { if (!isset($config['cf_social_login_use'])) {
sql_query("ALTER TABLE `{$g5['config_table']}` sql_query(
"ALTER TABLE `{$g5['config_table']}`
ADD `cf_social_login_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_googl_shorturl_apikey`, ADD `cf_social_login_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_googl_shorturl_apikey`,
ADD `cf_google_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_twitter_secret`, ADD `cf_google_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_twitter_secret`,
ADD `cf_google_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_clientid`, ADD `cf_google_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_clientid`,
@ -207,23 +293,31 @@ if(!isset($config['cf_social_login_use'])) {
ADD `cf_captcha` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_js_apikey`, ADD `cf_captcha` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_js_apikey`,
ADD `cf_recaptcha_site_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_captcha`, ADD `cf_recaptcha_site_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_captcha`,
ADD `cf_recaptcha_secret_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_recaptcha_site_key` ADD `cf_recaptcha_secret_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_recaptcha_site_key`
", true); ",
true
);
} }
//소셜 로그인 관련 필드 카카오 클라이언트 시크릿 추가 //소셜 로그인 관련 필드 카카오 클라이언트 시크릿 추가
if (!isset($config['cf_kakao_client_secret'])) { if (!isset($config['cf_kakao_client_secret'])) {
sql_query("ALTER TABLE `{$g5['config_table']}` sql_query(
"ALTER TABLE `{$g5['config_table']}`
ADD `cf_kakao_client_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_rest_key` ADD `cf_kakao_client_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_rest_key`
", true); ",
true
);
} }
// 회원 이미지 관련 필드 추가 // 회원 이미지 관련 필드 추가
if (!isset($config['cf_member_img_size'])) { if (!isset($config['cf_member_img_size'])) {
sql_query("ALTER TABLE `{$g5['config_table']}` sql_query(
"ALTER TABLE `{$g5['config_table']}`
ADD `cf_member_img_size` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_icon_height`, ADD `cf_member_img_size` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_icon_height`,
ADD `cf_member_img_width` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_size`, ADD `cf_member_img_width` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_size`,
ADD `cf_member_img_height` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_width` ADD `cf_member_img_height` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_width`
", true); ",
true
);
$sql = " update {$g5['config_table']} set cf_member_img_size = 50000, cf_member_img_width = 60, cf_member_img_height = 60 "; $sql = " update {$g5['config_table']} set cf_member_img_size = 50000, cf_member_img_width = 60, cf_member_img_height = 60 ";
sql_query($sql, false); sql_query($sql, false);
@ -235,7 +329,8 @@ if(!isset($config['cf_member_img_size'])) {
// 소셜 로그인 관리 테이블 없을 경우 생성 // 소셜 로그인 관리 테이블 없을 경우 생성
if (!sql_query(" DESC {$g5['social_profile_table']} ", false)) { if (!sql_query(" DESC {$g5['social_profile_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['social_profile_table']}` ( sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['social_profile_table']}` (
`mp_no` int(11) NOT NULL AUTO_INCREMENT, `mp_no` int(11) NOT NULL AUTO_INCREMENT,
`mb_id` varchar(255) NOT NULL DEFAULT '', `mb_id` varchar(255) NOT NULL DEFAULT '',
`provider` varchar(50) NOT NULL DEFAULT '', `provider` varchar(50) NOT NULL DEFAULT '',
@ -250,25 +345,36 @@ if(!sql_query(" DESC {$g5['social_profile_table']} ", false)) {
UNIQUE KEY `mp_no` (`mp_no`), UNIQUE KEY `mp_no` (`mp_no`),
KEY `mb_id` (`mb_id`), KEY `mb_id` (`mb_id`),
KEY `provider` (`provider`) KEY `provider` (`provider`)
) ", true); ) ",
true
);
} }
// 짧은 URL 주소를 사용 여부 필드 추가 // 짧은 URL 주소를 사용 여부 필드 추가
if (!isset($config['cf_bbs_rewrite'])) { if (!isset($config['cf_bbs_rewrite'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}` sql_query(
ADD `cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_link_target` ", true); " ALTER TABLE `{$g5['config_table']}`
ADD `cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_link_target` ",
true
);
} }
// 읽지 않은 메모 수 칼럼 추가 // 읽지 않은 메모 수 칼럼 추가
if (!isset($member['mb_memo_cnt'])) { if (!isset($member['mb_memo_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}` sql_query(
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`", true); " ALTER TABLE `{$g5['member_table']}`
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`",
true
);
} }
// 스크랩 읽은 수 추가 // 스크랩 읽은 수 추가
if (!isset($member['mb_scrap_cnt'])) { if (!isset($member['mb_scrap_cnt'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}` sql_query(
ADD `mb_scrap_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_cnt`", true); " ALTER TABLE `{$g5['member_table']}`
ADD `mb_scrap_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_cnt`",
true
);
} }
// 아이코드 토큰키 추가 // 아이코드 토큰키 추가
@ -299,11 +405,15 @@ if(!isset($config['cf_cert_kg_mid']) ){
ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; "; ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; ";
sql_query($sql, false); sql_query($sql, false);
} }
if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic"; if (!$config['cf_faq_skin']) {
if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic"; $config['cf_faq_skin'] = "basic";
}
if (!$config['cf_mobile_faq_skin']) {
$config['cf_mobile_faq_skin'] = "basic";
}
$g5['title'] = '환경설정'; $g5['title'] = '환경설정';
include_once ('./admin.head.php'); require_once './admin.head.php';
$pg_anchor = '<ul class="anchor"> $pg_anchor = '<ul class="anchor">
<li><a href="#anc_cf_basic">기본환경</a></li> <li><a href="#anc_cf_basic">기본환경</a></li>
@ -322,8 +432,12 @@ $pg_anchor = '<ul class="anchor">
</ul>'; </ul>';
if (!$config['cf_icode_server_ip']) $config['cf_icode_server_ip'] = '211.172.232.124'; if (!$config['cf_icode_server_ip']) {
if (!$config['cf_icode_server_port']) $config['cf_icode_server_port'] = '7295'; $config['cf_icode_server_ip'] = '211.172.232.124';
}
if (!$config['cf_icode_server_port']) {
$config['cf_icode_server_port'] = '7295';
}
$userinfo = array('payment' => ''); $userinfo = array('payment' => '');
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) { if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
@ -500,7 +614,9 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<?php <?php
$arr = get_skin_dir('', G5_EDITOR_PATH); $arr = get_skin_dir('', G5_EDITOR_PATH);
for ($i = 0; $i < count($arr); $i++) { for ($i = 0; $i < count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">사용안함</option>"; if ($i == 0) {
echo "<option value=\"\">사용안함</option>";
}
echo "<option value=\"" . $arr[$i] . "\"" . get_selected($config['cf_editor'], $arr[$i]) . ">" . $arr[$i] . "</option>\n"; echo "<option value=\"" . $arr[$i] . "\"" . get_selected($config['cf_editor'], $arr[$i]) . ">" . $arr[$i] . "</option>\n";
} }
?> ?>
@ -526,7 +642,9 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<?php <?php
$arr = get_skin_dir('mp3', str_replace(array('recaptcha_inv', 'recaptcha'), 'kcaptcha', G5_CAPTCHA_PATH)); $arr = get_skin_dir('mp3', str_replace(array('recaptcha_inv', 'recaptcha'), 'kcaptcha', G5_CAPTCHA_PATH));
for ($i = 0; $i < count($arr); $i++) { for ($i = 0; $i < count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">선택</option>"; if ($i == 0) {
echo "<option value=\"\">선택</option>";
}
echo "<option value=\"" . $arr[$i] . "\"" . get_selected($config['cf_captcha_mp3'], $arr[$i]) . ">" . $arr[$i] . "</option>\n"; echo "<option value=\"" . $arr[$i] . "\"" . get_selected($config['cf_captcha_mp3'], $arr[$i]) . ">" . $arr[$i] . "</option>\n";
} }
?> ?>
@ -589,7 +707,9 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<tr> <tr>
<th scope="row"><label for="cf_syndi_token">네이버 신디케이션 연동키</label></th> <th scope="row"><label for="cf_syndi_token">네이버 신디케이션 연동키</label></th>
<td colspan="3"> <td colspan="3">
<?php if (!function_exists('curl_init')) echo help('<b>경고) curl이 지원되지 않아 네이버 신디케이션을 사용할수 없습니다.</b>'); ?> <?php if (!function_exists('curl_init')) {
echo help('<b>경고) curl이 지원되지 않아 네이버 신디케이션을 사용할수 없습니다.</b>');
} ?>
<?php echo help('네이버 신디케이션 연동키(token)을 입력하면 네이버 신디케이션을 사용할 수 있습니다.<br>연동키는 <a href="http://webmastertool.naver.com/" target="_blank"><u>네이버 웹마스터도구</u></a> -> 네이버 신디케이션에서 발급할 수 있습니다.') ?> <?php echo help('네이버 신디케이션 연동키(token)을 입력하면 네이버 신디케이션을 사용할 수 있습니다.<br>연동키는 <a href="http://webmastertool.naver.com/" target="_blank"><u>네이버 웹마스터도구</u></a> -> 네이버 신디케이션에서 발급할 수 있습니다.') ?>
<input type="text" name="cf_syndi_token" value="<?php echo isset($config['cf_syndi_token']) ? get_sanitize_input($config['cf_syndi_token']) : ''; ?>" id="cf_syndi_token" class="frm_input" size="70"> <input type="text" name="cf_syndi_token" value="<?php echo isset($config['cf_syndi_token']) ? get_sanitize_input($config['cf_syndi_token']) : ''; ?>" id="cf_syndi_token" class="frm_input" size="70">
</td> </td>
@ -863,7 +983,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<th scope="row" class="cf_cert_service"><label for="cf_cert_find">회원정보찾기</label></th> <th scope="row" class="cf_cert_service"><label for="cf_cert_find">회원정보찾기</label></th>
<td class="cf_cert_service"> <td class="cf_cert_service">
<?php echo help('휴대폰/아이핀 본인확인을 이용하시다가 간편인증을 이용하시는 경우, 기존 회원은 아이디/비밀번호 찾기에 사용할 수 없을 수 있습니다.') ?> <?php echo help('휴대폰/아이핀 본인확인을 이용하시다가 간편인증을 이용하시는 경우, 기존 회원은 아이디/비밀번호 찾기에 사용할 수 없을 수 있습니다.') ?>
<input type="checkbox" name="cf_cert_find" id="cf_cert_find" value="1" <?php if (isset($config['cf_cert_find']) && $config['cf_cert_find'] == 1) { ?> checked <?php } ?>><label for="cf_cert_find"> 아이디/비밀번호 찾기에 사용하기</label> <input type="checkbox" name="cf_cert_find" id="cf_cert_find" value="1" <?php if (isset($config['cf_cert_find']) && $config['cf_cert_find'] == 1) { echo "checked"; } ?>><label for="cf_cert_find"> 아이디/비밀번호 찾기에 사용하기</label>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -944,7 +1064,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</section> </section>
<?php <?php
include_once('_rewrite_config_form.php'); require_once '_rewrite_config_form.php';
?> ?>
<section id="anc_cf_mail"> <section id="anc_cf_mail">
@ -1410,8 +1530,9 @@ include_once('_rewrite_config_form.php');
<script> <script>
$(function() { $(function() {
<?php <?php
if(!$config['cf_cert_use']) if (!$config['cf_cert_use']) {
echo '$(".cf_cert_service").addClass("cf_cert_hide");'; echo '$(".cf_cert_service").addClass("cf_cert_hide");';
}
?> ?>
$("#cf_cert_use").change(function() { $("#cf_cert_use").change(function() {
switch ($(this).val()) { switch ($(this).val()) {
@ -1446,7 +1567,9 @@ $(function(){
url: "./theme_config_load.php", url: "./theme_config_load.php",
cache: false, cache: false,
async: false, async: false,
data: { type: type }, data: {
type: type
},
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
if (data.error) { if (data.error) {
@ -1469,8 +1592,7 @@ $(function(){
}); });
}); });
function fconfigform_submit(f) function fconfigform_submit(f) {
{
var current_user_ip = "<?php echo $_SERVER['REMOTE_ADDR']; ?>"; var current_user_ip = "<?php echo $_SERVER['REMOTE_ADDR']; ?>";
var cf_intercept_ip_val = f.cf_intercept_ip.value; var cf_intercept_ip_val = f.cf_intercept_ip.value;
@ -1503,16 +1625,18 @@ if($config['cf_cert_use']) {
if ($config['cf_cert_ipin'] == 'kcb' || $config['cf_cert_hp'] == 'kcb') { if ($config['cf_cert_ipin'] == 'kcb' || $config['cf_cert_hp'] == 'kcb') {
// 실행모듈 // 실행모듈
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if(PHP_INT_MAX == 2147483647) // 32-bit if (PHP_INT_MAX == 2147483647) { // 32-bit
$exe = G5_OKNAME_PATH . '/bin/okname'; $exe = G5_OKNAME_PATH . '/bin/okname';
else
$exe = G5_OKNAME_PATH.'/bin/okname_x64';
} else { } else {
if(PHP_INT_MAX == 2147483647) // 32-bit $exe = G5_OKNAME_PATH . '/bin/okname_x64';
}
} else {
if (PHP_INT_MAX == 2147483647) { // 32-bit
$exe = G5_OKNAME_PATH . '/bin/okname.exe'; $exe = G5_OKNAME_PATH . '/bin/okname.exe';
else } else {
$exe = G5_OKNAME_PATH . '/bin/oknamex64.exe'; $exe = G5_OKNAME_PATH . '/bin/oknamex64.exe';
} }
}
echo module_exec_check($exe, 'okname'); echo module_exec_check($exe, 'okname');
@ -1524,10 +1648,11 @@ if($config['cf_cert_use']) {
// kcp일 때 // kcp일 때
if ($config['cf_cert_hp'] == 'kcp') { if ($config['cf_cert_hp'] == 'kcp') {
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if(PHP_INT_MAX == 2147483647) // 32-bit if (PHP_INT_MAX == 2147483647) { // 32-bit
$exe = G5_KCPCERT_PATH . '/bin/ct_cli'; $exe = G5_KCPCERT_PATH . '/bin/ct_cli';
else } else {
$exe = G5_KCPCERT_PATH . '/bin/ct_cli_x64'; $exe = G5_KCPCERT_PATH . '/bin/ct_cli_x64';
}
} else { } else {
$exe = G5_KCPCERT_PATH . '/bin/ct_cli_exe.exe'; $exe = G5_KCPCERT_PATH . '/bin/ct_cli_exe.exe';
} }
@ -1540,7 +1665,6 @@ if($config['cf_cert_use']) {
$log_path = G5_LGXPAY_PATH . '/lgdacom/log'; $log_path = G5_LGXPAY_PATH . '/lgdacom/log';
if (!is_dir($log_path)) { if (!is_dir($log_path)) {
if (is_writable(G5_LGXPAY_PATH . '/lgdacom/')) { if (is_writable(G5_LGXPAY_PATH . '/lgdacom/')) {
// 디렉토리가 없다면 생성합니다. (퍼미션도 변경하구요.) // 디렉토리가 없다면 생성합니다. (퍼미션도 변경하구요.)
@mkdir($log_path, G5_DIR_PERMISSION); @mkdir($log_path, G5_DIR_PERMISSION);
@ -1575,4 +1699,4 @@ if (stripos($config['cf_image_extension'], "webp") !== false) {
} }
} }
include_once ('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,13 +1,14 @@
<?php <?php
$sub_menu = "100100"; $sub_menu = "100100";
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
}
$cf_title = isset($_POST['cf_title']) ? strip_tags(clean_xss_attributes($_POST['cf_title'])) : ''; $cf_title = isset($_POST['cf_title']) ? strip_tags(clean_xss_attributes($_POST['cf_title'])) : '';
$cf_admin = isset($_POST['cf_admin']) ? clean_xss_tags($_POST['cf_admin'], 1, 1) : ''; $cf_admin = isset($_POST['cf_admin']) ? clean_xss_tags($_POST['cf_admin'], 1, 1) : '';
@ -15,8 +16,9 @@ $posts = array();
$mb = get_member($cf_admin); $mb = get_member($cf_admin);
if (! (isset($mb['mb_id']) && $mb['mb_id'])) if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
alert('최고관리자 회원아이디가 존재하지 않습니다.'); alert('최고관리자 회원아이디가 존재하지 않습니다.');
}
check_admin_token(); check_admin_token();
@ -33,12 +35,12 @@ foreach( $check_keys as $key ){
$posts['cf_icode_server_port'] = $_POST['cf_icode_server_port'] = isset($_POST['cf_icode_server_port']) ? preg_replace('/[^0-9]/', '', $_POST['cf_icode_server_port']) : '7295'; $posts['cf_icode_server_port'] = $_POST['cf_icode_server_port'] = isset($_POST['cf_icode_server_port']) ? preg_replace('/[^0-9]/', '', $_POST['cf_icode_server_port']) : '7295';
if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) { if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) {
$pattern = explode("\n", trim($_POST['cf_intercept_ip'])); $pattern = explode("\n", trim($_POST['cf_intercept_ip']));
for ($i = 0; $i < count($pattern); $i++) { for ($i = 0; $i < count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]); $pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i])) if (empty($pattern[$i])) {
continue; continue;
}
$pattern[$i] = str_replace(".", "\.", $pattern[$i]); $pattern[$i] = str_replace(".", "\.", $pattern[$i]);
$pattern[$i] = str_replace("+", "[0-9\.]+", $pattern[$i]); $pattern[$i] = str_replace("+", "[0-9\.]+", $pattern[$i]);
@ -173,8 +175,9 @@ foreach( $check_keys as $k => $v ){
} }
// 본인확인을 사용할 경우 아이핀, 휴대폰인증 중 하나는 선택되어야 함 // 본인확인을 사용할 경우 아이핀, 휴대폰인증 중 하나는 선택되어야 함
if($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] && !$_POST['cf_cert_simple']) if ($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] && !$_POST['cf_cert_simple']) {
alert('본인확인을 위해 아이핀, 휴대폰 본인확인, KG이니시스 간편인증 서비스 중 하나 이상 선택해 주십시오.'); alert('본인확인을 위해 아이핀, 휴대폰 본인확인, KG이니시스 간편인증 서비스 중 하나 이상 선택해 주십시오.');
}
if (!$_POST['cf_cert_use']) { if (!$_POST['cf_cert_use']) {
$posts[$key] = $_POST['cf_cert_ipin'] = ''; $posts[$key] = $_POST['cf_cert_ipin'] = '';

View File

@ -1,7 +1,7 @@
<?php <?php
$sub_menu = '300600'; $sub_menu = '300600';
include_once('./_common.php'); require_once './_common.php';
include_once(G5_EDITOR_LIB); require_once G5_EDITOR_LIB;
auth_check_menu($auth, $sub_menu, "w"); auth_check_menu($auth, $sub_menu, "w");
@ -16,22 +16,31 @@ if(!sql_query(" select co_include_head from {$g5['content_table']} limit 1 ", fa
// html purifier 사용여부 필드 // html purifier 사용여부 필드
if (!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) { if (!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}` sql_query(
ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ", true); " ALTER TABLE `{$g5['content_table']}`
ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ",
true
);
sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' "); sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' ");
} }
// 모바일 내용 추가 // 모바일 내용 추가
if (!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) { if (!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}` sql_query(
ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ", true); " ALTER TABLE `{$g5['content_table']}`
ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ",
true
);
} }
// 스킨 설정 추가 // 스킨 설정 추가
if (!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) { if (!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['content_table']}` sql_query(
" ALTER TABLE `{$g5['content_table']}`
ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`, ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`,
ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ", true); ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ",
true
);
sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' "); sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' ");
} }
@ -39,18 +48,16 @@ $html_title = "내용";
$g5['title'] = $html_title . ' 관리'; $g5['title'] = $html_title . ' 관리';
$readonly = ''; $readonly = '';
if ($w == "u") if ($w == "u") {
{
$html_title .= " 수정"; $html_title .= " 수정";
$readonly = " readonly"; $readonly = " readonly";
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' "; $sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql); $co = sql_fetch($sql);
if (!$co['co_id']) if (!$co['co_id']) {
alert('등록된 자료가 없습니다.'); alert('등록된 자료가 없습니다.');
} }
else } else {
{
$html_title .= ' 입력'; $html_title .= ' 입력';
$co = array( $co = array(
'co_id' => '', 'co_id' => '',
@ -66,7 +73,7 @@ else
); );
} }
include_once (G5_ADMIN_PATH.'/admin.head.php'); require_once G5_ADMIN_PATH . '/admin.head.php';
?> ?>
<form name="frmcontentform" action="./contentformupdate.php" onsubmit="return frmcontentform_check(this);" method="post" enctype="MULTIPART/FORM-DATA"> <form name="frmcontentform" action="./contentformupdate.php" onsubmit="return frmcontentform_check(this);" method="post" enctype="MULTIPART/FORM-DATA">
@ -146,7 +153,7 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
<?php <?php
echo help("파일 경로를 입력 또는 수정시 캡챠를 반드시 입력해야 합니다."); echo help("파일 경로를 입력 또는 수정시 캡챠를 반드시 입력해야 합니다.");
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
$captcha_html = captcha_html(); $captcha_html = captcha_html();
$captcha_js = chk_captcha_js(); $captcha_js = chk_captcha_js();
echo $captcha_html; echo $captcha_html;
@ -165,10 +172,11 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
$himg_str = ''; $himg_str = '';
if (file_exists($himg)) { if (file_exists($himg)) {
$size = @getimagesize($himg); $size = @getimagesize($himg);
if($size[0] && $size[0] > 750) if ($size[0] && $size[0] > 750) {
$width = 750; $width = 750;
else } else {
$width = $size[0]; $width = $size[0];
}
echo '<input type="checkbox" name="co_himg_del" value="1" id="co_himg_del"> <label for="co_himg_del">삭제</label>'; echo '<input type="checkbox" name="co_himg_del" value="1" id="co_himg_del"> <label for="co_himg_del">삭제</label>';
$himg_str = '<img src="' . G5_DATA_URL . '/content/' . $co['co_id'] . '_h" width="' . $width . '" alt="">'; $himg_str = '<img src="' . G5_DATA_URL . '/content/' . $co['co_id'] . '_h" width="' . $width . '" alt="">';
@ -190,10 +198,11 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
$timg_str = ''; $timg_str = '';
if (file_exists($timg)) { if (file_exists($timg)) {
$size = @getimagesize($timg); $size = @getimagesize($timg);
if($size[0] && $size[0] > 750) if ($size[0] && $size[0] > 750) {
$width = 750; $width = 750;
else } else {
$width = $size[0]; $width = $size[0];
}
echo '<input type="checkbox" name="co_timg_del" value="1" id="co_timg_del"> <label for="co_timg_del">삭제</label>'; echo '<input type="checkbox" name="co_timg_del" value="1" id="co_timg_del"> <label for="co_timg_del">삭제</label>';
$timg_str = '<img src="' . G5_DATA_URL . '/content/' . $co['co_id'] . '_t" width="' . $width . '" alt="">'; $timg_str = '<img src="' . G5_DATA_URL . '/content/' . $co['co_id'] . '_t" width="' . $width . '" alt="">';
@ -227,12 +236,13 @@ function use_captcha_check(){
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: g5_admin_url + "/ajax.use_captcha.php", url: g5_admin_url + "/ajax.use_captcha.php",
data: { admin_use_captcha: "1" }, data: {
admin_use_captcha: "1"
},
cache: false, cache: false,
async: false, async: false,
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {}
}
}); });
} }
@ -267,8 +277,7 @@ jQuery(function($){
} }
}); });
function frmcontentform_check(f) function frmcontentform_check(f) {
{
errmsg = ""; errmsg = "";
errfld = ""; errfld = "";
@ -295,4 +304,4 @@ function frmcontentform_check(f)
</script> </script>
<?php <?php
include_once (G5_ADMIN_PATH.'/admin.tail.php'); require_once G5_ADMIN_PATH . '/admin.tail.php';

View File

@ -1,22 +1,25 @@
<?php <?php
$sub_menu = '300600'; $sub_menu = '300600';
include_once('./_common.php'); require_once './_common.php';
if ($w == "u" || $w == "d") if ($w == "u" || $w == "d") {
check_demo(); check_demo();
}
if ($w == 'd') if ($w == 'd') {
auth_check_menu($auth, $sub_menu, "d"); auth_check_menu($auth, $sub_menu, "d");
else } else {
auth_check_menu($auth, $sub_menu, "w"); auth_check_menu($auth, $sub_menu, "w");
}
check_admin_token(); check_admin_token();
$co_row = array('co_id' => '', 'co_include_head' => '', 'co_include_tail' => ''); $co_row = array('co_id' => '', 'co_include_head' => '', 'co_include_tail' => '');
if ($w == "" || $w == "u") if ($w == "" || $w == "u") {
{ if (isset($_REQUEST['co_id']) && preg_match("/[^a-z0-9_]/i", $_REQUEST['co_id'])) {
if(isset($_REQUEST['co_id']) && preg_match("/[^a-z0-9_]/i", $_REQUEST['co_id'])) alert("ID 는 영문자, 숫자, _ 만 가능합니다."); alert("ID 는 영문자, 숫자, _ 만 가능합니다.");
}
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' "; $sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co_row = sql_fetch($sql); $co_row = sql_fetch($sql);
@ -37,7 +40,7 @@ $co_mobile_skin = isset($_POST['co_mobile_skin']) ? clean_xss_tags($_POST['co_mo
// 관리자가 자동등록방지를 사용해야 할 경우 // 관리자가 자동등록방지를 사용해야 할 경우
if (((isset($co_row['co_include_head']) && $co_row['co_include_head'] !== $co_include_head) || (isset($co_row['co_include_tail']) && $co_row['co_include_tail'] !== $co_include_tail)) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) { if (((isset($co_row['co_include_head']) && $co_row['co_include_head'] !== $co_include_head) || (isset($co_row['co_include_tail']) && $co_row['co_include_tail'] !== $co_include_tail)) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); include_once G5_CAPTCHA_PATH . '/captcha.lib.php';
if (!chk_captcha()) { if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.'); alert('자동등록방지 숫자가 틀렸습니다.');
@ -47,13 +50,16 @@ if ((( isset($co_row['co_include_head']) && $co_row['co_include_head'] !== $co_i
@mkdir(G5_DATA_PATH . "/content", G5_DIR_PERMISSION); @mkdir(G5_DATA_PATH . "/content", G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH . "/content", G5_DIR_PERMISSION); @chmod(G5_DATA_PATH . "/content", G5_DIR_PERMISSION);
if ($co_himg_del) @unlink(G5_DATA_PATH."/content/{$co_id}_h"); if ($co_himg_del) {
if ($co_timg_del) @unlink(G5_DATA_PATH."/content/{$co_id}_t"); @unlink(G5_DATA_PATH . "/content/{$co_id}_h");
}
if ($co_timg_del) {
@unlink(G5_DATA_PATH . "/content/{$co_id}_t");
}
$error_msg = ''; $error_msg = '';
if ($co_include_head) { if ($co_include_head) {
$file_ext = pathinfo($co_include_head, PATHINFO_EXTENSION); $file_ext = pathinfo($co_include_head, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $co_include_head)) { if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $co_include_head)) {
@ -62,7 +68,6 @@ if( $co_include_head ){
} }
if ($co_include_tail) { if ($co_include_tail) {
$file_ext = pathinfo($co_include_tail, PATHINFO_EXTENSION); $file_ext = pathinfo($co_include_tail, PATHINFO_EXTENSION);
if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $co_include_tail)) { if (!$file_ext || !in_array($file_ext, array('php', 'htm', 'html')) || !preg_match('/^.*\.(php|htm|html)$/i', $co_include_tail)) {
@ -98,26 +103,22 @@ $sql_common = " co_include_head = '$co_include_head',
co_skin = '$co_skin', co_skin = '$co_skin',
co_mobile_skin = '$co_mobile_skin' "; co_mobile_skin = '$co_mobile_skin' ";
if ($w == "") if ($w == "") {
{
$row = $co_row; $row = $co_row;
if (isset($row['co_id']) && $row['co_id']) if (isset($row['co_id']) && $row['co_id']) {
alert("이미 같은 ID로 등록된 내용이 있습니다."); alert("이미 같은 ID로 등록된 내용이 있습니다.");
}
$sql = " insert {$g5['content_table']} $sql = " insert {$g5['content_table']}
set co_id = '$co_id', set co_id = '$co_id',
$sql_common "; $sql_common ";
sql_query($sql); sql_query($sql);
} } elseif ($w == "u") {
else if ($w == "u")
{
$sql = " update {$g5['content_table']} $sql = " update {$g5['content_table']}
set $sql_common set $sql_common
where co_id = '$co_id' "; where co_id = '$co_id' ";
sql_query($sql); sql_query($sql);
} } elseif ($w == "d") {
else if ($w == "d")
{
@unlink(G5_DATA_PATH . "/content/{$co_id}_h"); @unlink(G5_DATA_PATH . "/content/{$co_id}_h");
@unlink(G5_DATA_PATH . "/content/{$co_id}_t"); @unlink(G5_DATA_PATH . "/content/{$co_id}_t");
@ -125,21 +126,19 @@ else if ($w == "d")
sql_query($sql); sql_query($sql);
} }
if(function_exists('get_admin_captcha_by')) if (function_exists('get_admin_captcha_by')) {
get_admin_captcha_by('remove'); get_admin_captcha_by('remove');
}
g5_delete_cache_by_prefix('content-' . $co_id . '-'); g5_delete_cache_by_prefix('content-' . $co_id . '-');
if ($w == "" || $w == "u") if ($w == "" || $w == "u") {
{ if ($_FILES['co_himg']['name']) {
if ($_FILES['co_himg']['name'])
{
$dest_path = G5_DATA_PATH . "/content/" . $co_id . "_h"; $dest_path = G5_DATA_PATH . "/content/" . $co_id . "_h";
@move_uploaded_file($_FILES['co_himg']['tmp_name'], $dest_path); @move_uploaded_file($_FILES['co_himg']['tmp_name'], $dest_path);
@chmod($dest_path, G5_FILE_PERMISSION); @chmod($dest_path, G5_FILE_PERMISSION);
} }
if ($_FILES['co_timg']['name']) if ($_FILES['co_timg']['name']) {
{
$dest_path = G5_DATA_PATH . "/content/" . $co_id . "_t"; $dest_path = G5_DATA_PATH . "/content/" . $co_id . "_t";
@move_uploaded_file($_FILES['co_timg']['tmp_name'], $dest_path); @move_uploaded_file($_FILES['co_timg']['tmp_name'], $dest_path);
@chmod($dest_path, G5_FILE_PERMISSION); @chmod($dest_path, G5_FILE_PERMISSION);
@ -150,8 +149,6 @@ if ($w == "" || $w == "u")
} else { } else {
goto_url("./contentform.php?w=u&amp;co_id=$co_id"); goto_url("./contentform.php?w=u&amp;co_id=$co_id");
} }
} } else {
else
{
goto_url("./contentlist.php"); goto_url("./contentlist.php");
} }

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = '300600'; $sub_menu = '300600';
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, "r"); auth_check_menu($auth, $sub_menu, "r");
@ -12,7 +12,8 @@ if(!sql_query(" DESCRIBE {$g5['content_table']} ", false)) {
if (sql_query(" DESCRIBE {$g5['g5_shop_content_table']} ", false)) { if (sql_query(" DESCRIBE {$g5['g5_shop_content_table']} ", false)) {
sql_query(" ALTER TABLE {$g5['g5_shop_content_table']} RENAME TO `{$g5['content_table']}` ;", false); sql_query(" ALTER TABLE {$g5['g5_shop_content_table']} RENAME TO `{$g5['content_table']}` ;", false);
} else { } else {
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['content_table']}` ( $query_cp = sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['content_table']}` (
`co_id` varchar(20) NOT NULL DEFAULT '', `co_id` varchar(20) NOT NULL DEFAULT '',
`co_html` tinyint(4) NOT NULL DEFAULT '0', `co_html` tinyint(4) NOT NULL DEFAULT '0',
`co_subject` varchar(255) NOT NULL DEFAULT '', `co_subject` varchar(255) NOT NULL DEFAULT '',
@ -21,7 +22,9 @@ if(!sql_query(" DESCRIBE {$g5['content_table']} ", false)) {
`co_include_head` varchar(255) NOT NULL, `co_include_head` varchar(255) NOT NULL,
`co_include_tail` varchar(255) NOT NULL, `co_include_tail` varchar(255) NOT NULL,
PRIMARY KEY (`co_id`) PRIMARY KEY (`co_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true); ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
true
);
// 내용관리 생성 // 내용관리 생성
sql_query(" insert into `{$g5['content_table']}` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", false); sql_query(" insert into `{$g5['content_table']}` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", false);
@ -31,7 +34,7 @@ if(!sql_query(" DESCRIBE {$g5['content_table']} ", false)) {
} }
$g5['title'] = '내용관리'; $g5['title'] = '내용관리';
include_once (G5_ADMIN_PATH.'/admin.head.php'); require_once G5_ADMIN_PATH . '/admin.head.php';
$sql_common = " from {$g5['content_table']} "; $sql_common = " from {$g5['content_table']} ";
@ -42,7 +45,9 @@ $total_count = $row['cnt'];
$rows = $config['cf_page_rows']; $rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) if ($page < 1) {
$page = 1;
} // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함 $from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = "select * $sql_common order by co_id limit $from_record, {$config['cf_page_rows']} "; $sql = "select * $sql_common order by co_id limit $from_record, {$config['cf_page_rows']} ";
@ -94,4 +99,4 @@ $result = sql_query($sql);
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?> <?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
<?php <?php
include_once (G5_ADMIN_PATH.'/admin.tail.php'); require_once G5_ADMIN_PATH . '/admin.tail.php';