appdb/include testData.php version.php

WineHQ wineowner at wine.codeweavers.com
Sun Apr 22 11:15:12 CDT 2007


ChangeSet ID:	31087
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/04/22 11:15:12

Modified files:
	include        : testData.php version.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Fix testData/version::mustBeQueued()

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

Old revision  New revision  Changes     Path
 1.45          1.46          +15 -2      appdb/include/testData.php
 1.118         1.119         +18 -4      appdb/include/version.php

Index: appdb/include/testData.php
diff -u -p appdb/include/testData.php:1.45 appdb/include/testData.php:1.46
--- appdb/include/testData.php:1.45	22 Apr 2007 16:15:12 -0000
+++ appdb/include/testData.php	22 Apr 2007 16:15:12 -0000
@@ -922,9 +922,22 @@ class testData{
     function mustBeQueued()
     {
         if($_SESSION['current']->hasPriv("admin"))
+        {
             return FALSE;
-
-        return TRUE;
+        } else if($this->iVersionId)
+        {
+            // if the user can edit the version and the version isn't queued then
+            // they can also submit test results without them being queued
+            // this is the case where they maintain the version and the version isn't queued
+            $oVersion = new version($this->iVersionId);
+            if($oVersion->canEdit() && $oVersion->sQueued == "false")
+                return FALSE;
+            else
+                return TRUE;
+        } else
+        {
+            return TRUE;
+        }
     }
 }
 
Index: appdb/include/version.php
diff -u -p appdb/include/version.php:1.118 appdb/include/version.php:1.119
--- appdb/include/version.php:1.118	22 Apr 2007 16:15:12 -0000
+++ appdb/include/version.php	22 Apr 2007 16:15:12 -0000
@@ -1197,15 +1197,29 @@ class Version {
         if($_SESSION['current']->hasPriv("admin"))
             return FALSE;
 
-        if($this->iVersionId)
+        // if we have a valid iAppId or iVersionId we should
+        // check the status of these objects to determine whether
+        // we need to queue this version object
+        if($this->iVersionId or $this->iAppId)
         {
-            if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
+            // if the user is the super maintainer of the application then
+            // they are authorized to unqueue versions of this application
+            // so the version doesn't have to be queued
+            if($this->iAppId && 
+               maintainer::isUserSuperMaintainer($_SESSION['current'], $this->iAppId))
+                return FALSE;
+
+            // if the user is a maintainer of this version then
+            // this version doesn't have to be queued
+            if($this->iVersionId && 
+               maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
                 return FALSE;
 
             return TRUE;
-        }
-        else
+        } else
+        {
             return TRUE;
+        }
     }
 
     function objectGetHeader()



More information about the wine-cvs mailing list