Fix testData/version::mustBeQueued()

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-04-22 16:15:12 +00:00
committed by WineHQ
parent 00aacdeadd
commit fb4db22141
2 changed files with 33 additions and 6 deletions

View File

@@ -922,9 +922,22 @@ class testData{
function mustBeQueued() function mustBeQueued()
{ {
if($_SESSION['current']->hasPriv("admin")) if($_SESSION['current']->hasPriv("admin"))
{
return FALSE; return FALSE;
} else if($this->iVersionId)
return TRUE; {
// if the user can edit the version and the version isn't queued then
// they can also submit test results without them being queued
// this is the case where they maintain the version and the version isn't queued
$oVersion = new version($this->iVersionId);
if($oVersion->canEdit() && $oVersion->sQueued == "false")
return FALSE;
else
return TRUE;
} else
{
return TRUE;
}
} }
} }

View File

@@ -1197,15 +1197,29 @@ class Version {
if($_SESSION['current']->hasPriv("admin")) if($_SESSION['current']->hasPriv("admin"))
return FALSE; return FALSE;
if($this->iVersionId) // if we have a valid iAppId or iVersionId we should
// check the status of these objects to determine whether
// we need to queue this version object
if($this->iVersionId or $this->iAppId)
{ {
if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId)) // if the user is the super maintainer of the application then
// they are authorized to unqueue versions of this application
// so the version doesn't have to be queued
if($this->iAppId &&
maintainer::isUserSuperMaintainer($_SESSION['current'], $this->iAppId))
return FALSE;
// if the user is a maintainer of this version then
// this version doesn't have to be queued
if($this->iVersionId &&
maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
return FALSE; return FALSE;
return TRUE; return TRUE;
} } else
else {
return TRUE; return TRUE;
}
} }
function objectGetHeader() function objectGetHeader()