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

This commit is contained in:
whitedot
2013-02-18 13:27:49 +09:00
3 changed files with 31 additions and 29 deletions

View File

@ -55,11 +55,6 @@ include_once('./admin.head.php');
$colspan = 5;
?>
<script>
var list_update_php = '';
var list_delete_php = 'auth_list_delete.php';
</script>
<form id="fsearch" name="fsearch" method="get">
<input type="hidden" id="sfl" name="sfl" value="a.mb_id">
<fieldset>
@ -77,7 +72,7 @@ var list_delete_php = 'auth_list_delete.php';
<h2>설정된 관리권한 내역</h2>
<p>권한 <strong>r</strong>은 읽기권한, <strong>w</strong>는 쓰기권한, <strong>d</strong>는 삭제권한입니다.</p>
<form id="fauthlist" name="fauthlist" method="post">
<form id="fauthlist" name="fauthlist" method="post" action="./auth_list_delete.php">
<input type="hidden" name="sst" value="<?=$sst?>">
<input type="hidden" name="sod" value="<?=$sod?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
@ -142,8 +137,8 @@ var list_delete_php = 'auth_list_delete.php';
?>
<?
if (isset($stx))
echo '<script>document.fsearch.sfl.value = "'.$sfl.'";</script>'.PHP_EOL;
//if (isset($stx))
// echo '<script>document.fsearch.sfl.value = "'.$sfl.'";</script>'.PHP_EOL;
if (strstr($sfl, 'mb_id'))
$mb_id = $stx;
@ -153,7 +148,7 @@ var list_delete_php = 'auth_list_delete.php';
</form>
</section>
<form id="fauthlist2" name="fauthlist2" method="post" onsubmit="return fauthlist2_submit(this);" autocomplete="off">
<form id="fauthlist2" name="fauthlist2" method="post" action="./auth_update.php" autocomplete="off">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="sst" value="<?=$sst?>">
@ -192,11 +187,18 @@ var list_delete_php = 'auth_list_delete.php';
</form>
<script>
function fauthlist2_submit(f)
{
f.action = "./auth_update.php";
return true;
}
$(function() {
$('#fauthlist').submit(function() {
var cnt = $('input[name^=chk]:checked').length;
if(cnt < 1) {
alert('삭제할 권한 내역을 1개 이상 선택해 주세요.');
return false;
}
return true;
});
});
</script>
<?

View File

@ -21,8 +21,8 @@ $sql = " insert into {$g4['auth_table']}
au_auth = '{$_POST['r']},{$_POST['w']},{$_POST['d']}' ";
$result = sql_query($sql, FALSE);
if (!$result) {
$sql = " update $g4['auth_table']
set au_auth = '{$_POST[r]},{$_POST['w']},{$_POST['d']}'
$sql = " update {$g4['auth_table']}
set au_auth = '{$_POST['r']},{$_POST['w']},{$_POST['d']}'
where mb_id = '{$_POST['mb_id']}'
and au_menu = '{$_POST['au_menu']}' ";
sql_query($sql);

View File

@ -1,7 +1,7 @@
<?
$sub_menu = '300100';
define('G4_CAPTCHA', 1);
include_once('./_common.php');
include_once(G4_GCAPTCHA_PATH.'/gcaptcha.lib.php');
auth_check($auth[$sub_menu], 'w');
@ -106,11 +106,11 @@ $sql = " insert into {$g4['board_table']}
sql_query($sql);
// 게시판 폴더 생성
@mkdir($g4['path'].'/data/file/'.$target_table, 0707);
@chmod($g4['path'].'/data/file/'.$target_table, 0707);
@mkdir(G4_DATA_PATH.'/file/'.$target_table, 0707);
@chmod(G4_DATA_PATH.'/file/'.$target_table, 0707);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$board_path = $g4['path'].'/data/file/'.$target_table;
$board_path = G4_DATA_PATH.'/file/'.$target_table;
$file = $board_path . '/index.php';
$f = @fopen($file, 'w');
@fwrite($f, '');
@ -119,26 +119,26 @@ $f = @fopen($file, 'w');
$copy_file = 0;
if ($copy_case == 'schema_data_both') {
$d = dir($g4['path'].'/data/file/'.$bo_table);
$d = dir(G4_DATA_PATH.'/file/'.$bo_table);
while ($entry = $d->read()) {
if ($entry == '.' || $entry == '..') continue;
// 김선용 201007 :
if(is_dir($g4['path'].'/data/file/'.$bo_table.'/'.$entry)){
$dd = dir($g4['path'].'/data/file/'.$bo_table.'/'.$entry);
@mkdir($g4['path'].'/data/file/'.$target_table.'/'.$entry, 0707);
@chmod($g4['path'].'/data/file/'.$target_table.'/'.$entry, 0707);
if(is_dir(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry)){
$dd = dir(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry);
@mkdir(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, 0707);
@chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, 0707);
while ($entry2 = $dd->read()) {
if ($entry2 == '.' || $entry2 == '..') continue;
@copy($g4['path'].'/data/file/'.$bo_table.'/'.$entry.'/'.$entry2, $g4['path'].'/data/file/'.$target_table.'/'.$entry.'/'.$entry2);
@chmod($g4['path'].'/data/file/'.$target_table.'/'.$entry.'/'.$entry2, 0707);
@copy(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry.'/'.$entry2, G4_DATA_PATH.'/file/'.$target_table.'/'.$entry.'/'.$entry2);
@chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry.'/'.$entry2, 0707);
$copy_file++;
}
$dd->close();
}
else {
@copy($g4['path'].'/data/file/'.$bo_table.'/'.$entry, $g4['path'].'/data/file/'.$target_table.'/'.$entry);
@chmod($g4['path'].'/data/file/'.$target_table.'/'.$entry, 0707);
@copy(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry, G4_DATA_PATH.'/file/'.$target_table.'/'.$entry);
@chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, 0707);
$copy_file++;
}
}