diff --git a/i_entrance/adminAction.js b/i_entrance/adminAction.js
index 254de0f..5fe0f79 100644
--- a/i_entrance/adminAction.js
+++ b/i_entrance/adminAction.js
@@ -5,11 +5,33 @@ function Entrance_AdminInit() {
$("#Entrance_000201").click(Entrance_Donation);
$("#Entrance_000202").click(Entrance_Member);
$("#Entrance_000204").click(Entrance_AdminChangeNotice);
+ $("#Entrance_000205").click(Entrance_IconScrub);
}
function Entrance_AdminUpdate() {
}
+function Entrance_IconScrub(){
+ Popup_Confirm('사용하지 않는 전콘 중 등록된지 2개월이 지난 것들을 삭제합니다.', function() {
+ Popup_Wait(function() {
+ PostJSON(
+ HOME+I+ENTRANCE+W+'iconScrub.php', {
+ action: 0,
+ notice: notice
+ },
+ function(response, textStatus) {
+ if(response.result == "SUCCESS") {
+ Popup_WaitHide();
+ Replace(ENTRANCE+PHP);
+ } else {
+ Popup_WaitShow(response.msg);
+ }
+ }
+ )
+ })
+ });
+}
+
function Entrance_Donation() {
$("#Entrance_00").hide();
$("#EntranceDonation_00").show();
diff --git a/i_entrance/adminInc.php b/i_entrance/adminInc.php
index 3f0163c..5994943 100644
--- a/i_entrance/adminInc.php
+++ b/i_entrance/adminInc.php
@@ -17,6 +17,7 @@ Entrance_AdminUpdate();
회 원 관 리
+
diff --git a/i_entrance/adminStyle.css b/i_entrance/adminStyle.css
index 0e12fc3..a0a1fe2 100644
--- a/i_entrance/adminStyle.css
+++ b/i_entrance/adminStyle.css
@@ -12,13 +12,18 @@
}
#Entrance_000201 {
- width: 200px; height: 50px;
- position: absolute; top: 65px; left: 150px;
+ width: 160px; height: 50px;
+ position: absolute; top: 65px; left: 120px;
}
#Entrance_000202 {
- width: 200px; height: 50px;
- position: absolute; top: 65px; left: 450px;
+ width: 160px; height: 50px;
+ position: absolute; top: 65px; left: 320px;
+}
+
+#Entrance_000205 {
+ width: 160px; height: 50px;
+ position: absolute; top: 65px; left: 520px;
}
#Entrance_000203 {
diff --git a/i_entrance/iconScrub.php b/i_entrance/iconScrub.php
new file mode 100644
index 0000000..01624e8
--- /dev/null
+++ b/i_entrance/iconScrub.php
@@ -0,0 +1,50 @@
+Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'");
+$member = $DB->Get($rs);
+if($member['GRADE'] < 6) {
+ $response['result'] = 'FAIL';
+ $response['msg'] = '운영자 권한이 없습니다.';
+ sleep(1);
+ echo json_encode($response);
+}
+
+
+$targetTime = strtotime("-1 month");
+
+$picDir = ROOT.W.D.'pic';
+
+$usedImg = [];
+
+$imgResult = $DB->Select('PICTURE', 'MEMBER', 'IMGSVR=1');
+foreach($DB->GetAll($imgResult) as $row){
+ $imgname = $row['PICTURE'];
+ if(strlen($imgname)<(1+1+3+2+8)){ //*.jpg?=YYYYMMDD
+ continue;
+ }
+ $imgname = substr($imgname, 0, strlen($imgname)-10);
+ $usedImg[$imgname] = true;
+}
+
+foreach(glob($picDir."/*.{jpg,png,gif}", GLOB_BRACE) as $filepath){
+ $filename = basename($filepath);
+
+ if (array_key_exists($filename, $usedImg)) {
+ continue;
+ }
+
+ $mtime = filemtime($filepath);
+ if($mtime > $targetTime){
+ continue;
+ }
+
+ @unlink($filepath);
+}
+
+sleep(1);
+echo json_encode(['result'=>'SUCCESS']);
diff --git a/i_entrance/manage/deletePost.php b/i_entrance/manage/deletePost.php
index 89d342a..dfad9b8 100644
--- a/i_entrance/manage/deletePost.php
+++ b/i_entrance/manage/deletePost.php
@@ -34,9 +34,6 @@ if($dt == $rf) {
$response['result'] = 'FAIL';
} else {
$DB->Update('MEMBER', "PICTURE='', IMGSVR=0", "NO='{$SESSION->NoMember()}'");
- if(file_exists($dest)){
- @unlink($dest);
- }
for($i=0; $i < $_serverCount; $i++) {
if($SETTINGS[$i]->IsExist()) {
diff --git a/i_entrance/manage/iconPost.php b/i_entrance/manage/iconPost.php
index 0da2250..8bde810 100644
--- a/i_entrance/manage/iconPost.php
+++ b/i_entrance/manage/iconPost.php
@@ -74,9 +74,6 @@ if(!is_uploaded_file($image['tmp_name'])) {
$response['msg'] = '업로드에 실패했습니다!';
$response['result'] = 'FAIL';
} else {
- if(file_exists($old_path)){
- @unlink($old_path);
- }
$pic = "{$newPicName}?={$rf}";
$DB->Update('MEMBER', "PICTURE='{$pic}', IMGSVR=1", "NO='{$SESSION->NoMember()}'");