Add and use distribution::mustBeQueued()

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-04-21 17:50:44 +00:00
committed by WineHQ
parent 3ab921cf0d
commit 208033d788

View File

@@ -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;