diff --git a/include/distribution.php b/include/distribution.php index b717f63..1c9e45b 100644 --- a/include/distribution.php +++ b/include/distribution.php @@ -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;