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

This commit is contained in:
whitedot
2013-01-15 11:28:59 +09:00
7 changed files with 94 additions and 36 deletions

View File

@ -44,3 +44,15 @@ function btn_check(f, act)
f.submit();
}
function is_checked(elements_name)
{
var checked = false;
var chk = document.getElementsByName(elements_name);
for (var i=0; i<chk.length; i++) {
if (chk[i].checked) {
checked = true;
}
}
return checked;
}

View File

@ -85,7 +85,7 @@ var list_delete_php = 'board_list_delete.php';
</div>
<?}?>
<form id="fboardlist" name="fboardlist" method="post">
<form id="fboardlist" name="fboardlist" method="post" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);">
<input type="hidden" name="sst" value="<?=$sst?>">
<input type="hidden" name="sod" value="<?=$sod?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
@ -183,13 +183,17 @@ if ($i == 0)
</table>
<div class="btn_list">
<button onclick="btn_check(this.form, 'update')">선택수정</button>
<input type="submit" name="btn_submit" onclick="document.pressed=this.value" value="선택수정">
<?if ($is_admin == 'super') {?>
<button onclick="btn_check(this.form, 'delete')">선택삭제</button>
<input type="submit" name="btn_submit" onclick="document.pressed=this.value" value="선택삭제">
<a href="./board_form.php">게시판추가</a>
<?}?>
</div>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택수정 및 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<?
$pagelist = get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr.'&amp;page=');
?>
@ -204,6 +208,16 @@ if (isset($stx))
</form>
<script>
function fboardlist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
return true;
}
function board_copy(bo_table) {
window.open("./board_copy.php?bo_table="+bo_table, "BoardCopy", "left=10,top=10,width=500,height=200");
}

View File

@ -4,35 +4,65 @@ include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], 'w');
if (!count($_POST['chk'])) {
alert($_POST['btn_submit']." 하실 항목을 하나 이상 선택하세요.");
}
for ($i=0; $i<count($_POST['chk']); $i++) {
if ($_POST['btn_submit'] == "선택수정") {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
auth_check($auth[$sub_menu], 'w');
if ($is_admin != 'super') {
$sql = " select count(*) as cnt from {$g4['board_table']} a, {$g4['group_table']} b
where a.gr_id = '{$_POST['gr_id'][$k]}'
and a.gr_id = b.gr_id
and b.gr_admin = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt'])
alert('최고관리자가 아닌 경우 다른 관리자의 게시판('.$board_table[$k].')은 수정이 불가합니다.');
for ($i=0; $i<count($_POST['chk']); $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
if ($is_admin != 'super') {
$sql = " select count(*) as cnt from {$g4['board_table']} a, {$g4['group_table']} b
where a.gr_id = '{$_POST['gr_id'][$k]}'
and a.gr_id = b.gr_id
and b.gr_admin = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt'])
alert('최고관리자가 아닌 경우 다른 관리자의 게시판('.$board_table[$k].')은 수정이 불가합니다.');
}
$sql = " update {$g4['board_table']}
set gr_id = '{$_POST['gr_id'][$k]}',
bo_subject = '{$_POST['bo_subject'][$k]}',
bo_skin = '{$_POST['bo_skin'][$k]}',
bo_read_point = '{$_POST['bo_read_point'][$k]}',
bo_write_point = '{$_POST['bo_write_point'][$k]}',
bo_comment_point = '{$_POST['bo_comment_point'][$k]}',
bo_download_point = '{$_POST['bo_download_point'][$k]}',
bo_use_search = '{$_POST['bo_use_search'][$k]}',
bo_order_search = '{$_POST['bo_order_search'][$k]}'
where bo_table = '{$_POST['board_table'][$k]}' ";
sql_query($sql);
}
$sql = " update {$g4['board_table']}
set gr_id = '{$_POST['gr_id'][$k]}',
bo_subject = '{$_POST['bo_subject'][$k]}',
bo_skin = '{$_POST['bo_skin'][$k]}',
bo_read_point = '{$_POST['bo_read_point'][$k]}',
bo_write_point = '{$_POST['bo_write_point'][$k]}',
bo_comment_point = '{$_POST['bo_comment_point'][$k]}',
bo_download_point = '{$_POST['bo_download_point'][$k]}',
bo_use_search = '{$_POST['bo_use_search'][$k]}',
bo_order_search = '{$_POST['bo_order_search'][$k]}'
where bo_table = '{$_POST['board_table'][$k]}' ";
sql_query($sql);
} else if ($_POST['btn_submit'] == "선택삭제") {
if ($is_admin != 'super')
alert('게시판 삭제는 최고관리자만 가능합니다.');
auth_check($auth[$sub_menu], 'd');
check_token();
// _BOARD_DELETE_ 상수를 선언해야 board_delete.inc.php 가 정상 작동함
define("_BOARD_DELETE_", TRUE);
for ($i=0; $i<count($_POST['chk']); $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
// include 전에 $bo_table 값을 반드시 넘겨야 함
$tmp_bo_table = escape_trim($_POST['board_table'][$k]);
include ('./board_delete.inc.php');
}
}
goto_url('./board_list.php?'.$qstr);

View File

@ -1,4 +1,5 @@
<?
define('_CAPTCHA_', 1);
include_once('./_common.php');
include_once($g4['path'].'/lib/register.lib.php');
include_once($g4['path'].'/lib/mailer.lib.php');
@ -301,16 +302,14 @@ if ($w == '') {
// 사용자 코드 실행
@include_once ($g4['path'].'/skin/member/'.$config[cf_member_skin].'/register_update.skin.php');
@include_once ($g4['path'].'/skin/member/'.$config['cf_member_skin'].'/register_update.skin.php');
if ($msg)
echo '<script>alert(\''.$msg.'\');</script>';
$https_url = $g4['url'].'/'.$g4['bbs'];
if ($w == "") {
goto_url($https_url.'/register_result.php');
goto_url($g4['bbs_url'].'/register_result.php');
} else if ($w == 'u') {
$row = sql_fetch(" select mb_password from {$g4['member_table']} where mb_id = '{$member[mb_id]}' ");
$tmp_password = $row['mb_password'];
@ -319,9 +318,11 @@ if ($w == "") {
set_session("ss_mb_id", "");
alert('회원 정보가 수정 되었습니다.\n\nE-mail 주소가 변경되었으므로 다시 인증하셔야 합니다.', $g4['path']);
} else {
alert('회원 정보가 수정 되었습니다.', $g4['url']);
/*
echo '
<html><title>회원정보수정</title><meta http-equiv="Content-Type" content="text/html; charset=$g4[charset]"></html><body>
<form name="fregisterupdate" method="post" action="'.$https_url.'/register_form.php">
<form name="fregisterupdate" method="post" action="'.$g4['bbs_url'].'/register_form.php">
<input type="hidden" name="w" value="u">
<input type="hidden" name="mb_id" value="'.$mb_id.'">
<input type="hidden" name="mb_password" value="'.$tmp_password.'">
@ -333,6 +334,7 @@ if ($w == "") {
</script>
</body>
</html>';
*/
}
}
?>

View File

@ -120,7 +120,7 @@ function alert($msg='', $url='')
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
$msg = str_replace("\\n", "<br>", $msg);
if (!$url) $url = "javascript:history.go(-1);";
if (!$url) $url = $_SERVER['HTTP_REFERER'];
/*
//header("Content-Type: text/html; charset=$g4['charset']");

View File

@ -28,13 +28,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
</form>
<script>
$(document).ready(function(){
$(function(){
$("#login_auto_login").click(function(){
if (this.checked) {
this.checked = confirm("자동로그인을 사용하시면 다음부터 회원아이디와 패스워드를 입력하실 필요가 없습니다.\n\n공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?");
}
});
}
});
function flogin_submit(f)
{

View File

@ -19,7 +19,7 @@ $po = sql_fetch(" select * from {$g4['poll_table']} where po_id = '$po_id' ");
<section id="poll">
<header>
<h2>설문조사</h2>
<? if ($is_admin == "super") { ?><a href="<?=$g4[admin_path]?>/poll_form.php?w=u&amp;po_id=<?=$po_id?>">설문관리</a><? } ?>
<? if ($is_admin == "super") { ?><a href="<?=$g4['admin_url']?>/poll_form.php?w=u&amp;po_id=<?=$po_id?>">설문조사 관리</a><? } ?>
<p><?=$po['po_subject']?></p>
</header>
<ul>