From 1ae5758ffce22493c6fd78571d8e94519b68b217 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 15 Jun 2007 04:28:00 +0000 Subject: [PATCH] Login as an admin user during cron maintenance so we can delete screenshots --- cron/cleanup.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cron/cleanup.php b/cron/cleanup.php index ec695de..4c41a84 100644 --- a/cron/cleanup.php +++ b/cron/cleanup.php @@ -314,11 +314,20 @@ function removeScreenshotsWithMissingFiles() if($sEmail) mail_appdb($sEmail, $sSubject, $sMsg); + // log in as admin user with user id 1000 + // NOTE: this is a bit of a hack but we need admin + // access to delete these screenshots + $oUser = new User(); + $oUser->iUserId = 1000; + // remove the screenshots with missing files foreach($aMissingScreenshotIds as $iScreenshotId) { $oScreenshot = new Screenshot($iScreenshotId); $oScreenshot->delete(); // delete the screenshot } + + // log out as user + $oUser->logout() } ?>