appdb/include distribution.php

WineHQ wineowner at wine.codeweavers.com
Sat Apr 21 12:50:44 CDT 2007


ChangeSet ID:	31068
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/04/21 12:50:44

Modified files:
	include        : distribution.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Add and use distribution::mustBeQueued()

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

Old revision  New revision  Changes     Path
 1.24          1.25          +11 -8      appdb/include/distribution.php

Index: appdb/include/distribution.php
diff -u -p appdb/include/distribution.php:1.24 appdb/include/distribution.php:1.25
--- appdb/include/distribution.php:1.24	21 Apr 2007 17:50:44 -0000
+++ appdb/include/distribution.php	21 Apr 2007 17:50:44 -0000
@@ -92,16 +92,11 @@ class distribution {
             return false;
         }
 
-        // Security, if we are not an administrator the Distributions must be queued.
-        if(!$_SESSION['current']->hasPriv("admin"))
-            $this->sQueued = 'true';
-        else
-            $this->sQueued = 'false';
-
         $hResult = query_parameters("INSERT INTO distributions (name, url, submitterId, queued) ".
                                     "VALUES ('?', '?', '?', '?')",
-                                    $this->sName, $this->sUrl, $_SESSION['current']->iUserId,
-                                    $this->sQueued);
+                                    $this->sName, $this->sUrl,
+                                    $_SESSION['current']->iUserId,
+                                    $this->mustBeQueued() ? "true" : "false");
         if($hResult)
         {
             $this->iDistributionId = mysql_insert_id();
@@ -488,6 +483,14 @@ class distribution {
         return FALSE;
     }
 
+    function mustBeQueued()
+    {
+        if($_SESSION['current']->hasPriv("admin"))
+            return FALSE;
+        else
+            return TRUE;
+    }
+
     function objectHideDelete()
     {
         return TRUE;



More information about the wine-cvs mailing list