Add and use distribution::mustBeQueued()
This commit is contained in:
committed by
WineHQ
parent
3ab921cf0d
commit
208033d788
@@ -92,16 +92,11 @@ class distribution {
|
|||||||
return false;
|
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) ".
|
$hResult = query_parameters("INSERT INTO distributions (name, url, submitterId, queued) ".
|
||||||
"VALUES ('?', '?', '?', '?')",
|
"VALUES ('?', '?', '?', '?')",
|
||||||
$this->sName, $this->sUrl, $_SESSION['current']->iUserId,
|
$this->sName, $this->sUrl,
|
||||||
$this->sQueued);
|
$_SESSION['current']->iUserId,
|
||||||
|
$this->mustBeQueued() ? "true" : "false");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iDistributionId = mysql_insert_id();
|
$this->iDistributionId = mysql_insert_id();
|
||||||
@@ -488,6 +483,14 @@ class distribution {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mustBeQueued()
|
||||||
|
{
|
||||||
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
function objectHideDelete()
|
function objectHideDelete()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user