Merge branch 'g5'

This commit is contained in:
chicpro
2014-02-06 13:40:09 +09:00
9 changed files with 171 additions and 4 deletions

View File

@ -5,6 +5,7 @@ $menu['menu200'] = array (
array('200300', '회원메일발송', G5_ADMIN_URL.'/mail_list.php', 'mb_mail'),
array('200800', '접속자집계', G5_ADMIN_URL.'/visit_list.php', 'mb_visit', 1),
array('200810', '접속자검색', G5_ADMIN_URL.'/visit_search.php', 'mb_search', 1),
array('200820', '접속자로그삭제', G5_ADMIN_URL.'/visit_delete.php', 'mb_delete', 1),
array('200200', '포인트관리', G5_ADMIN_URL.'/point_list.php', 'mb_point'),
array('200900', '투표관리', G5_ADMIN_URL.'/poll_list.php', 'mb_poll')
);

95
adm/visit_delete.php Normal file
View File

@ -0,0 +1,95 @@
<?php
$sub_menu = "200820";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
$g5['title'] = '접속자로그삭제';
include_once('./admin.head.php');
// 최소년도 구함
$sql = " select min(vi_date) as min_date from {$g5['visit_table']} ";
$row = sql_fetch($sql);
$min_year = (int)substr($row['min_date'], 0, 4);
$now_year = (int)substr(G5_TIME_YMD, 0, 4);
?>
<div class="local_ov01 local_ov">
접속자 로그를 삭제할 년도와 방법을 선택해주십시오.
</div>
<form name="fvisitdelete" class="local_sch02 local_sch" method="post" action="./visit_delete_update.php" onsubmit="return form_submit(this);">
<div>
<label for="year" class="sound_only">년도선택</label>
<select name="year" id="year">
<option value="">년도선택</option>
<?php
for($year=$min_year; $year<=$now_year; $year++) {
?>
<option value="<?php echo $year; ?>"><?php echo $year; ?></option>
<?php
}
?>
</select> 년
<label for="year" class="sound_only">월선택</label>
<select name="month" id="month">
<option value="">월선택</option>
<?php
for($i=1; $i<=12; $i++) {
?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php
}
?>
</select> 월
<label for="method" class="sound_only">삭제방법선택</label>
<select name="method" id="method">
<option value="before">선택년월 이전 자료삭제</option>
<option value="specific">선택년월의 자료삭제</option>
</select>
</div>
<div class="sch_last">
<label for="pass">관리자 비밀번호</label>
<input type="password" name="pass" id="pass" class="frm_input required">
<input type="submit" value="확인" class="btn_submit">
</div>
</form>
<script>
function form_submit(f)
{
var year = $("#year").val();
var month = $("#month").val();
var method = $("#method").val();
var pass = $("#pass").val();
if(!year) {
alert("년도를 선택해 주십시오.");
return false;
}
if(!month) {
alert("월을 선택해 주십시오.");
return false;
}
if(!pass) {
alert("관리자 비밀번호를 입력해 주십시오.");
return false;
}
var msg = year+"년 "+month+"월";
if(method == "before")
msg += " 이전";
else
msg += "의";
msg += " 자료를 삭제하시겠습니까?";
return confirm(msg);
}
</script>
<?php
include_once('./admin.tail.php');
?>

View File

@ -0,0 +1,60 @@
<?php
$sub_menu = "200820";
include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], 'd');
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
$year = preg_replace('/[^0-9]/', '', $_POST['year']);
$month = preg_replace('/[^0-9]/', '', $_POST['month']);
$method = $_POST['method'];
$pass = trim($_POST['pass']);
if(!$pass)
alert('관리자 비밀번호를 입력해 주십시오.');
// 관리자 비밀번호 비교
$admin = get_admin('super');
if(sql_password($pass) != $admin['mb_password'])
alert('관리자 비밀번호가 일치하지 않습니다.');
if(!$year)
alert('년도를 선택해 주십시오.');
if(!$month)
alert('월을 선택해 주십시오.');
// 로그삭제 query
$del_date = $year.'-'.str_pad($month, 2, '0', STR_PAD_LEFT);
switch($method) {
case 'before':
$sql_common = " where substring(vi_date, 1, 7) < '$del_date' ";
break;
case 'specific':
$sql_common = " where substring(vi_date, 1, 7) = '$del_date' ";
break;
default:
alert('올바른 방법으로 이용해 주십시오.');
break;
}
// 총 로그수
$sql = " select count(*) as cnt from {$g5['visit_table']} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
// 로그삭제
$sql = " delete from {$g5['visit_table']} $sql_common ";
sql_query($sql);
// 삭제 후 총 로그수
$sql = " select count(*) as cnt from {$g5['visit_table']} ";
$row = sql_fetch($sql);
$total_count2 = $row['cnt'];
alert('총 '.number_format($total_count).'건 중 '.number_format($total_count - $total_count2).'건 삭제 완료', './visit_delete.php');
?>

View File

@ -91,7 +91,7 @@ $result = sql_query($sql);
<?php
}
if ($i == 0)
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없거나 관리자에 의해 삭제되었습니다.</td></tr>';
?>
</tbody>
</table>

View File

@ -252,6 +252,10 @@ if ($w == '') {
ob_end_clean();
mailer($config['cf_title'], $config['cf_admin_email'], $mb_email, $subject, $content, 1);
// 메일인증을 사용하는 경우 가입메일에 인증 url이 있으므로 인증메일을 다시 발송되지 않도록 함
if($config['cf_use_email_certify'])
$old_email = $mb_email;
}
// 최고관리자님께 메일 발송

View File

@ -21,7 +21,9 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<a href="<?php echo G5_URL ?>" target="_blank"><?php echo $config['cf_title'] ?></a>
</span>
<p style="margin:20px 0 0;padding:30px 30px 50px;min-height:200px;height:auto !important;height:200px;border-bottom:1px solid #eee">
<?php if($w == 'u') { ?>
<b><?php echo $mb_name ?></b> 님의 E-mail 주소가 변경되었습니다.<br><br>
<?php } ?>
아래의 주소를 클릭하시면 인증이 완료됩니다.<br>
<a href="<?php echo $certify_href ?>" target="_blank"><b><?php echo $certify_href ?></b></a><br><br>

View File

@ -2195,7 +2195,7 @@ function html_end()
$buffer = ob_get_contents();
ob_end_clean();
preg_match('#<body>(.*)</body>#is', $buffer, $bodys);
preg_match_all('/(\r|\n)?<link[^>]+>/i', $bodys[0], $links);
preg_match_all('/[\n\r]?(<!.*)?(<link[^>]+>).*(<!.*>)?/i', $bodys[0], $links);
$stylesheet = '';
$links[0] = array_unique($links[0]);
foreach ($links[0] as $key=>$link) {
@ -2257,6 +2257,9 @@ function https_url($dir, $https=true)
// 게시판의 공지사항을 , 로 구분하여 업데이트 한다.
function board_notice($bo_notice, $wr_id, $insert=false)
{
if(strpos($bo_notice, strval($wr_id)) !== false)
return $bo_notice;
$notice_array = explode(",", trim($bo_notice));
$notice_array = array_merge(array($wr_id), $notice_array);
$notice_array = array_unique($notice_array);

View File

@ -95,9 +95,10 @@
/* 회원가입 완료 */
#reg_result {padding:40px 10px 0}
#reg_result #result_logo {margin-bottom:50px;text-align:center}
#reg_result #result_email {padding:10px 50px;border-top:1px solid #eee;border-bottom:1px solid #eee;background:#fff;line-height:2em}
#reg_result #result_email {margin:20px 0;padding:10px 50px;border-top:1px solid #eee;border-bottom:1px solid #eee;background:#fff;line-height:2em}
#reg_result #result_email span {display:inline-block;width:150px}
#reg_result #result_email strong {color:#e8180c;font-size:1.2em}
#reg_result p {line-height:1.8em}
#reg_result .btn_confirm {margin:50px 0}
/* 아이디/비밀번호 찾기 */

View File

@ -102,9 +102,10 @@
/* 회원가입 완료 */
#reg_result {padding:50px 0 0}
#reg_result #result_logo {margin-bottom:50px;text-align:center}
#reg_result #result_email {padding:10px 50px;border-top:1px solid #e9e9e9;border-bottom:1px solid #dde4e9;background:#fff;line-height:2em}
#reg_result #result_email {margin:20px 0;padding:10px 50px;border-top:1px solid #e9e9e9;border-bottom:1px solid #dde4e9;background:#fff;line-height:2em}
#reg_result #result_email span {display:inline-block;width:150px}
#reg_result #result_email strong {color:#e8180c;font-size:1.2em}
#reg_result p {line-height:1.8em}
#reg_result .btn_confirm {margin:50px 0}
/* 아이디/비밀번호 찾기 */