diff --git a/adm/admin.menu100.php b/adm/admin.menu100.php
index e019d7c13..1cde62226 100644
--- a/adm/admin.menu100.php
+++ b/adm/admin.menu100.php
@@ -1,15 +1,15 @@
$menu['menu100'] = array (
- array('100000', '환경설정', ''.$g4['admin_path'].'/config_form.php', 'config'),
- array('', '기본환경설정', ''.$g4['admin_path'].'/config_form.php', 'cf_basic'),
- array('', '관리권한설정', ''.$g4['admin_path'].'/auth_list.php', 'cf_auth'),
- array('100300', '메일 테스트', ''.$g4['admin_path'].'/sendmail_test.php', 'cf_mailtest'),
- //array('100400', '버전정보', ''.$g4['admin_path'].'/version.php', 'cf_version'),
+ array('100000', '환경설정', $g4['admin_path'].'/config_form.php', 'config'),
+ array('', '기본환경설정', $g4['admin_path'].'/config_form.php', 'cf_basic'),
+ array('', '관리권한설정', $g4['admin_path'].'/auth_list.php', 'cf_auth'),
+ array('100300', '메일 테스트', $g4['admin_path'].'/sendmail_test.php', 'cf_mailtest'),
+ //array('100400', '버전정보', $g4['admin_path'].'/version.php', 'cf_version'),
array('100500', 'phpinfo()', ''.$g4['admin_path'].'/phpinfo.php', 'cf_phpinfo'),
- //array('100600', '업그레이드', ''.$g4['admin_path'].'/upgrade.php', 'cf_upgrade'),
- //array('100700', '복구/최적화', ''.$g4['admin_path'].'/repair.php', 'cf_repair'),
- array('100800', '세션파일 일괄삭제', ''.$g4['admin_path'].'/session_delete.php', 'cf_delete'),
- array('100900','캐쉬파일 일괄삭제','#', 'cf_cache'),
+ //array('100600', '업그레이드', $g4['admin_path'].'/upgrade.php', 'cf_upgrade'),
+ //array('100700', '복구/최적화', $g4['admin_path'].'/repair.php', 'cf_repair'),
+ array('100800', '세션파일 일괄삭제', $g4['admin_path'].'/session_file_delete.php', 'cf_session'),
+ array('100900','캐쉬파일 일괄삭제', $g4['admin_path'].'/cache_file_delete.php', 'cf_cache'),
//array('', 'phpMyAdmin', ''.$g4['path'].'/'.$g4['phpmyadmin_dir'].'', 'cf_phpmyadmin')
);
?>
\ No newline at end of file
diff --git a/adm/cache_file_delete.php b/adm/cache_file_delete.php
new file mode 100644
index 000000000..2faa22546
--- /dev/null
+++ b/adm/cache_file_delete.php
@@ -0,0 +1,47 @@
+
+$sub_menu = "100900";
+include_once("./_common.php");
+
+if ($is_admin != "super")
+ alert("최고관리자만 접근 가능합니다.", $g4[path]);
+
+$g4['title'] = "캐시파일 일괄삭제";
+include_once("./admin.head.php");
+?>
+
+
+
+ 완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
+
+
+
+
+
+
+include_once("./admin.tail.php");
+flush();
+
+if (!$dir=@opendir($g4['cache_latest_path'])) {
+ echo "최신글 캐시디렉토리를 열지못했습니다.";
+}
+
+$cnt=0;
+while($file=readdir($dir)) {
+ if ($file=='.' || $file=='..') continue;
+
+ $cache_file = $g4['cache_latest_path'].'/'.$file;
+
+ if (!$atime=@fileatime($cache_file))
+ continue;
+
+ $cnt++;
+ $return = unlink($cache_file);
+ echo "\n";
+
+ flush();
+
+ if ($cnt%10==0)
+ echo "\n";
+}
+echo "\n";
+?>
diff --git a/adm/session_delete.php b/adm/session_file_delete.php
similarity index 71%
rename from adm/session_delete.php
rename to adm/session_file_delete.php
index e571d07ec..badf8c4fb 100644
--- a/adm/session_delete.php
+++ b/adm/session_file_delete.php
@@ -21,29 +21,25 @@ include_once("./admin.head.php");
include_once("./admin.tail.php");
flush();
-$session_path = "$g4[path]/data/session"; // 세션이저장된 디렉토리
-if (!$dir=@opendir($session_path)) {
+if (!$dir=@opendir($g4['session_path'])) {
echo "세션 디렉토리를 열지못했습니다.";
}
$cnt=0;
while($file=readdir($dir)) {
- if (!strstr($file,'sess_')) {
- continue;
- }
+ if (!strstr($file,'sess_')) continue;
+ if (strpos($file,'sess_')!=0) continue;
- if (strpos($file,'sess_')!=0) {
- continue;
- }
+ $session_file = $g4['session_path'].'/'.$file;
- if (!$atime=@fileatime("$session_path/$file")) {
+ if (!$atime=@fileatime($session_file)) {
continue;
}
if (time() > $atime + (3600 * 6)) { // 지난시간을 초로 계산해서 적어주시면 됩니다. default : 6시간전
$cnt++;
- $return = unlink("$session_path/$file");
- echo "\n";
+ $return = unlink($session_file);
+ echo "\n";
flush();
diff --git a/css/adm.css b/css/adm.css
index bd6df74c5..3700db006 100644
--- a/css/adm.css
+++ b/css/adm.css
@@ -156,6 +156,7 @@ fieldset button:focus, .fieldset_submit:focus {padding:0 15px;height:23px;border
/* 메일 테스트, 세션파일일괄삭제 */
#fsendmailtest p,
#session_del p {margin-bottom:20px;padding:13px;border:1px solid #ced9de;background:#fff;font-size:0.75em}
+#cache_del p {margin-bottom:20px;padding:13px;border:1px solid #ced9de;background:#fff;font-size:0.75em}
/* pagination */
.pg {clear:both;margin:0 0 10px;padding-top:20px;font-size:0.75em;text-align:center}
diff --git a/extend/g4s.extend.php b/extend/g4s.extend.php
index fcf8dc463..ac2bf0598 100644
--- a/extend/g4s.extend.php
+++ b/extend/g4s.extend.php
@@ -22,6 +22,9 @@ $g4['data_path'] = $g4['path'].'/'.$g4['data_dir'];
$g4['cache_dir'] = 'cache';
$g4['cache_path'] = $g4['data_path'].'/'.$g4['cache_dir'];
+$g4['session_dir'] = 'session';
+$g4['session_path'] = $g4['data_path'].'/'.$g4['session_dir'];
+
$g4['cache_latest_dir'] = $g4['cache_dir'].'/latest';
$g4['cache_member_dir'] = $g4['cache_dir'].'/member';
$g4['cache_captcha_dir'] = $g4['cache_dir'].'/captcha';
diff --git a/lib/latest.lib.php b/lib/latest.lib.php
index 663a87775..58eefd9fa 100644
--- a/lib/latest.lib.php
+++ b/lib/latest.lib.php
@@ -10,7 +10,8 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $options='')
$latest_skin_path = skin_path().'/latest/'.$skin_dir;
$cache_file = $g4['cache_latest_path']."/{$bo_table}_{$skin_dir}_{$rows}_{$subject_len}.php";
- if (!file_exists($cache_file)) {
+ //if (!file_exists($cache_file)) {
+ if (0) {
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";