diff --git a/include/user.php b/include/user.php index 84ab6b0..71e9c1e 100644 --- a/include/user.php +++ b/include/user.php @@ -760,18 +760,6 @@ class User { return $this->isLoggedIn(); } - function versionCreatedMustBeQueued($oVersion) - { - if($this->hasPriv("admin")) - return false; - - if($this->isSupermaintainer($oVersion->iAppId)) - return false; - - return true; - } - - /** * Returns 'true' if the current user has the permission to delete * this version, 'false' otherwise diff --git a/include/version.php b/include/version.php index fe66050..5c4bacd 100644 --- a/include/version.php +++ b/include/version.php @@ -87,10 +87,7 @@ class Version { if(!$_SESSION['current']->canCreateVersion()) return; - if($_SESSION['current']->versionCreatedMustBeQueued($this)) - $this->sQueued = 'true'; - else - $this->sQueued = 'false'; + $this->sQueued = $this->mustBeQueued() ? "true" : "false"; $hResult = query_parameters("INSERT INTO appVersion (versionName, description, maintainer_release, @@ -98,7 +95,7 @@ class Version { VALUES ('?', '?', '?', '?', '?', '?', '?', '?')", $this->sName, $this->sDescription, $this->sTestedRelease, $this->sTestedRating, $this->iAppId, - $_SESSION['current']->iUserId, $this->sQueued, + $_SESSION['current']->iUserId, $this->sQueued, $this->sLicense); if($hResult) @@ -1200,7 +1197,7 @@ class Version { if($_SESSION['current']->hasPriv("admin")) return FALSE; - else if($this->iVersionId) + if($this->iVersionId) { if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId)) return FALSE;