Enable deletion of a distribution's test results along with the distribution, if the user has
admin privileges.
This commit is contained in:
@@ -151,11 +151,16 @@ class distribution {
|
|||||||
$this->sQueued != "false")))
|
$this->sQueued != "false")))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Check for associated test results */
|
// if the distribution has test results only enable an admin to delete
|
||||||
if(sizeof($this->aTestingIds))
|
// 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");
|
$oTestData = new TestData($iTestId);
|
||||||
return FALSE;
|
$oTestData->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
// now delete the Distribution
|
// now delete the Distribution
|
||||||
|
|||||||
Reference in New Issue
Block a user