appdb/cron cleanup.php

WineHQ wineowner at wine.codeweavers.com
Thu Jun 14 23:28:00 CDT 2007


ChangeSet ID:	31200
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/06/14 23:28:00

Modified files:
	cron           : cleanup.php 

Log message:
	Chris Morgan <cmorgan at alum.wpi.edu>
	Login as an admin user during cron maintenance so we can delete screenshots

Patch: http://cvs.winehq.org/patch.py?id=31200

Old revision  New revision  Changes     Path
 1.39          1.40          +9 -0       appdb/cron/cleanup.php

Index: appdb/cron/cleanup.php
diff -u -p appdb/cron/cleanup.php:1.39 appdb/cron/cleanup.php:1.40
--- appdb/cron/cleanup.php:1.39	15 Jun 2007  4:28: 0 -0000
+++ appdb/cron/cleanup.php	15 Jun 2007  4:28: 0 -0000
@@ -314,11 +314,20 @@ function removeScreenshotsWithMissingFil
     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()
 }
 ?>



More information about the wine-cvs mailing list