Login as an admin user during cron maintenance so we can delete screenshots

This commit is contained in:
Chris Morgan
2007-06-15 04:28:00 +00:00
committed by WineHQ
parent 5e7a75584a
commit 1ae5758ffc

View File

@@ -314,11 +314,20 @@ function removeScreenshotsWithMissingFiles()
if($sEmail) if($sEmail)
mail_appdb($sEmail, $sSubject, $sMsg); 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 // remove the screenshots with missing files
foreach($aMissingScreenshotIds as $iScreenshotId) foreach($aMissingScreenshotIds as $iScreenshotId)
{ {
$oScreenshot = new Screenshot($iScreenshotId); $oScreenshot = new Screenshot($iScreenshotId);
$oScreenshot->delete(); // delete the screenshot $oScreenshot->delete(); // delete the screenshot
} }
// log out as user
$oUser->logout()
} }
?> ?>