AvocadoAmber/AvocadoEdition_Light/adm/captcha_file_delete.php

55 lines
1.3 KiB
PHP
Raw Normal View History

2022-09-17 20:50:50 +09:00
<?php
$sub_menu = '100910';
include_once('./_common.php');
if ($is_admin != 'super')
2024-09-19 20:57:39 +09:00
alert('최고관리자만 접근 가능합니다.', G5_URL);
2022-09-17 20:50:50 +09:00
$g5['title'] = '캡챠파일 일괄삭제';
include_once('./admin.head.php');
?>
<div class="local_desc02 local_desc">
2024-09-19 20:57:39 +09:00
<p>
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
</p>
2022-09-17 20:50:50 +09:00
</div>
<?php
flush();
2024-09-19 20:57:39 +09:00
if (!$dir = @opendir(G5_DATA_PATH . '/cache')) {
echo '<p>캐시디렉토리를 열지못했습니다.</p>';
2022-09-17 20:50:50 +09:00
}
2024-09-19 20:57:39 +09:00
$cnt = 0;
echo '<ul>' . PHP_EOL;
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
$files = glob(G5_DATA_PATH . '/cache/?captcha-*');
2022-09-17 20:50:50 +09:00
if (is_array($files)) {
2024-09-19 20:57:39 +09:00
$before_time = G5_SERVER_TIME - 3600; // 한시간전
foreach ($files as $gcaptcha_file) {
$modification_time = filemtime($gcaptcha_file); // 파일접근시간
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
if ($modification_time > $before_time)
continue;
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
$cnt++;
unlink($gcaptcha_file);
echo '<li>' . $gcaptcha_file . '</li>' . PHP_EOL;
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
flush();
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
if ($cnt % 10 == 0)
echo PHP_EOL;
}
2022-09-17 20:50:50 +09:00
}
2024-09-19 20:57:39 +09:00
echo '<li>완료됨</li></ul>' . PHP_EOL;
echo '<div class="local_desc01 local_desc"><p><strong>캡챠파일 ' . $cnt . '건의 삭제 완료됐습니다.</strong><br>프로그램의 실행을 끝마치셔도 좋습니다.</p></div>' . PHP_EOL;
2022-09-17 20:50:50 +09:00
?>
<?php
include_once('./admin.tail.php');
2024-09-19 20:57:39 +09:00
?>