Enable deletion of a distribution's test results along with the distribution, if the user has

admin privileges.
This commit is contained in:
Chris Morgan
2007-08-24 03:49:33 +00:00
committed by WineHQ
parent 82cd3b245b
commit 4d82c32adc

View File

@@ -151,11 +151,16 @@ class distribution {
$this->sQueued != "false")))
return false;
/* Check for associated test results */
if(sizeof($this->aTestingIds))
// if the distribution has test results only enable an admin to delete
// the distribution
if(sizeof($this->aTestingIds) && !$_SESSION['current']->hasPriv("admin"))
return FALSE;
// delete any test results this distribution has
foreach($this->aTestingIds as $iTestId)
{
addmsg("This distribution still has associated test results", "red");
return FALSE;
$oTestData = new TestData($iTestId);
$oTestData->delete();
}
// now delete the Distribution