} if ($result) { // delete according definition of primary resources and alternatives for adapted content $filename = '../' . $pathext . $filename; // 1. delete secondary resources types $secondaryResourcesTypesDAO = new SecondaryResourcesTypesDAO(); $secondaryResourcesTypesDAO->DeleteByResourceName($filename); // 2. delete secondary resources $secondaryResourcesDAO = new SecondaryResourcesDAO(); $secondaryResourcesDAO->DeleteByResourceName($filename); // 3. delete primary resources types $primaryResourcesTypesDAO = new PrimaryResourcesTypesDAO(); $primaryResourcesTypesDAO->DeleteByResourceName($filename); // 4. delete primary resources $primaryResourcesDAO = new PrimaryResourcesDAO(); $primaryResourcesDAO->DeleteByResourceName($filename); $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY'); } } /* delete directory */ if (isset($_POST['listofdirs'])) { $checkbox = explode(',', $_POST['listofdirs']); $count = count($checkbox); $result = true; for ($i = 0; $i < $count; $i++) { $filename = $checkbox[$i]; if (strpos($filename, '..') !== false) { $msg->addError('UNKNOWN'); $result = false; header('Location: index.php?pathext=' . $_POST['pathext'] . SEP . 'framed=' . $_POST['framed'] . SEP . 'popup=' . $_POST['popup'] . SEP . 'cp=' . $_POST['cp'] . SEP . 'cid=' . $_POST['cid'] . SEP . 'pid=' . $_POST['pid'] . SEP . 'a_type=' . $_POST['a_type'] . SEP . '_course_id=' . $_course_id); exit;