appdb/include maintainer.php

WineHQ wineowner at wine.codeweavers.com
Fri Dec 8 22:34:07 CST 2006


ChangeSet ID:	30436
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2006/12/08 22:34:07

Modified files:
	include        : maintainer.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Auto-accept a maintainer request if the user has sufficient privileges.

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

Old revision  New revision  Changes     Path
 1.19          1.20          +10 -1      appdb/include/maintainer.php

Index: appdb/include/maintainer.php
diff -u -p appdb/include/maintainer.php:1.19 appdb/include/maintainer.php:1.20
--- appdb/include/maintainer.php:1.19	9 Dec 2006  4:34: 7 -0000
+++ appdb/include/maintainer.php	9 Dec 2006  4:34: 7 -0000
@@ -49,7 +49,7 @@ class maintainer
                                     "VALUES ('?', '?', '?', '?', '?', ?, '?')",
                                     $this->iAppId, $this->iVersionId,
                                     $this->iUserId, $this->sMaintainReason,
-                                    $this->bSuperMaintainer, "NOW()", 'true');
+                                    $this->bSuperMaintainer, "NOW()", $this->mustBeQueued() ? "true" : "false");
 
         /* this objects id is the insert id returned by mysql */
         $this->iMaintainerId = mysql_insert_id();
@@ -128,6 +128,15 @@ class maintainer
         return $hResult;
     }
 
+    function mustBeQueued()
+    {
+        /* In place for future fine-grained permisson system, only allow admins for now */
+        if($_SESSION['current']->hasPriv("admin"))
+            return FALSE;
+        else
+            return TRUE;
+    }
+
     function delete()
     {
         $sQuery = "DELETE from appMaintainers where maintainerId = '?'";



More information about the wine-cvs mailing list