appdb/include distribution.php

WineHQ wineowner at wine.codeweavers.com
Thu Aug 23 22:49:33 CDT 2007


ChangeSet ID:	31343
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/08/23 22:49:33

Modified files:
	include        : distribution.php 

Log message:
	Chris Morgan <cmorgan at alum.wpi.edu>
	Enable deletion of a distribution's test results along with the distribution, if the user has
	admin privileges.

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

Old revision  New revision  Changes     Path
 1.42          1.43          +9 -4       appdb/include/distribution.php

Index: appdb/include/distribution.php
diff -u -p appdb/include/distribution.php:1.42 appdb/include/distribution.php:1.43
--- appdb/include/distribution.php:1.42	24 Aug 2007  3:49:33 -0000
+++ appdb/include/distribution.php	24 Aug 2007  3:49:33 -0000
@@ -151,11 +151,16 @@ class distribution {
                 $this->sQueued != "false")))
             return false;
 
-        /* Check for associated test results */
-        if(sizeof($this->aTestingIds))
+        // if the distribution has test results only enable an admin to delete
+        // the distribution
+        if(sizeof($this->aTestingIds) && !$_SESSION['current']->hasPriv("admin"))
+          return FALSE;
+
+        // delete any test results this distribution has
+        foreach($this->aTestingIds as $iTestId)
         {
-            addmsg("This distribution still has associated test results", "red");
-            return FALSE;
+          $oTestData = new TestData($iTestId);
+          $oTestData->delete();
         }
 
         // now delete the Distribution 



More information about the wine-cvs mailing list