From 1107fb938b4d520ad5eb48543214fb855c7afe95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sat, 21 Apr 2007 17:51:42 +0000 Subject: [PATCH] Add and use application::mustBeQueued() --- include/application.php | 19 ++++++++++++------- include/user.php | 9 --------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/include/application.php b/include/application.php index f451b7a..b5bcbdd 100644 --- a/include/application.php +++ b/include/application.php @@ -119,17 +119,13 @@ class Application { if(!$_SESSION['current']->canCreateApplication()) return; - if($_SESSION['current']->appCreatedMustBeQueued()) - $this->sQueued = 'true'; - else - $this->sQueued = 'false'; - $hResult = query_parameters("INSERT INTO appFamily (appName, description, keywords, ". "webPage, vendorId, catId, submitterId, queued) VALUES (". "'?', '?', '?', '?', '?', '?', '?', '?')", $this->sName, $this->sDescription, $this->sKeywords, $this->sWebpage, $this->iVendorId, $this->iCatId, - $_SESSION['current']->iUserId, $this->sQueued); + $_SESSION['current']->iUserId, + $this->mustBeQueued() ? "true" : "false"); if($hResult) { $this->iAppId = mysql_insert_id(); @@ -906,11 +902,20 @@ class Application { if($_SESSION['current']->hasPriv("admin")) return TRUE; else if($this) - return maintainer::isUserSuperMaintainer($_SESSION['current'], $this->iAppId); + return maintainer::isUserSuperMaintainer($_SESSION['current'], + $this->iAppId); else return FALSE; } + function mustBeQueued() + { + if($_SESSION['current']->hasPriv("admin")) + return FALSE; + else + return TRUE; + } + function objectDisplayQueueProcessingHelp() { echo "

This is the list of applications waiting for your approval, ". diff --git a/include/user.php b/include/user.php index 43db24e..04aa6d3 100644 --- a/include/user.php +++ b/include/user.php @@ -721,15 +721,6 @@ class User { return $this->hasPriv("admin"); } - /** - * Does the created application have to be queued for admin processing? - */ - function appCreatedMustBeQueued() - { - return !$this->hasPriv("admin"); - } - - /***********************/ /* version permissions */