Use version::mustBeQueued() instead of user function
This commit is contained in:
committed by
WineHQ
parent
995076af3b
commit
b292a84bcf
@@ -760,18 +760,6 @@ class User {
|
|||||||
return $this->isLoggedIn();
|
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
|
* Returns 'true' if the current user has the permission to delete
|
||||||
* this version, 'false' otherwise
|
* this version, 'false' otherwise
|
||||||
|
|||||||
@@ -87,10 +87,7 @@ class Version {
|
|||||||
if(!$_SESSION['current']->canCreateVersion())
|
if(!$_SESSION['current']->canCreateVersion())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if($_SESSION['current']->versionCreatedMustBeQueued($this))
|
$this->sQueued = $this->mustBeQueued() ? "true" : "false";
|
||||||
$this->sQueued = 'true';
|
|
||||||
else
|
|
||||||
$this->sQueued = 'false';
|
|
||||||
|
|
||||||
$hResult = query_parameters("INSERT INTO appVersion
|
$hResult = query_parameters("INSERT INTO appVersion
|
||||||
(versionName, description, maintainer_release,
|
(versionName, description, maintainer_release,
|
||||||
@@ -98,7 +95,7 @@ class Version {
|
|||||||
VALUES ('?', '?', '?', '?', '?', '?', '?', '?')",
|
VALUES ('?', '?', '?', '?', '?', '?', '?', '?')",
|
||||||
$this->sName, $this->sDescription, $this->sTestedRelease,
|
$this->sName, $this->sDescription, $this->sTestedRelease,
|
||||||
$this->sTestedRating, $this->iAppId,
|
$this->sTestedRating, $this->iAppId,
|
||||||
$_SESSION['current']->iUserId, $this->sQueued,
|
$_SESSION['current']->iUserId, $this->sQueued,
|
||||||
$this->sLicense);
|
$this->sLicense);
|
||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
@@ -1200,7 +1197,7 @@ class Version {
|
|||||||
if($_SESSION['current']->hasPriv("admin"))
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
else if($this->iVersionId)
|
if($this->iVersionId)
|
||||||
{
|
{
|
||||||
if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
|
if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user