示例#1
0
 function delete($id = FALSE)
 {
     if ($id) {
         $rs = new Download($id);
         $rs->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
示例#2
0
 private function deleteDownload()
 {
     global $_LANGID, $_ARRAYLANG;
     \Cx\Core\Csrf\Controller\Csrf::check_code();
     $objDownload = new Download();
     $objDownload->load(isset($_GET['delete_file']) ? $_GET['delete_file'] : 0);
     if (!$objDownload->EOF) {
         $name = '<strong>' . htmlentities($objDownload->getName($_LANGID), ENT_QUOTES, CONTREXX_CHARSET) . '</strong>';
         if ($objDownload->delete($this->categoryId)) {
             $this->arrStatusMsg['ok'][] = sprintf($_ARRAYLANG['TXT_DOWNLOADS_DOWNLOAD_DELETE_SUCCESS'], $name);
         } else {
             $this->arrStatusMsg['error'] = array_merge($this->arrStatusMsg['error'], $objDownload->getErrorMsg());
         }
     }
 }
示例#3
0
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/download.php";
include_once "../../../../classes/downloadcategory.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Downloads");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
// Check Login
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $memberInfo = $member->get_info();
} else {
    exit;
}
$downloadObj = new Download($mysqli);
$downloadCatObj = new DownloadCategory($mysqli);
if ($downloadObj->select($_POST['dlID']) && isset($_POST['confirm'])) {
    $downloadInfo = $downloadObj->get_info_filtered();
    $downloadObj->delete();
    unlink("../../../../" . $downloadInfo['splitfile1']);
    unlink("../../../../" . $downloadInfo['splitfile2']);
    include "downloadlist.php";
} elseif ($downloadObj->select($_POST['dlID'])) {
    $downloadInfo = $downloadObj->get_info_filtered();
    echo "\n\t\t<p align='center' class='main'>Are you sure you want to delete the download: <b>" . $downloadInfo['name'] . "</b>?</p>\t\n\t";
} else {
    echo "\n\t\t<p align='center' class='main'>Download not found</p>\n\t";
}
 private function deleteDownloads($arrDownloadIds)
 {
     global $_LANGID, $_ARRAYLANG;
     $succeded = true;
     $objDownload = new Download();
     foreach ($arrDownloadIds as $downloadId) {
         $objDownload->load($downloadId);
         if (!$objDownload->EOF) {
             if (!$objDownload->delete()) {
                 $succeded = false;
                 $this->arrStatusMsg['error'] = array_merge($this->arrStatusMsg['error'], $objDownload->getErrorMsg());
             }
         }
     }
     if ($succeded) {
         $this->arrStatusMsg['ok'][] = $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOADS_DELETE_SUCCESS'];
     }
 }
示例#5
0
 public function delete()
 {
     $returnVal = false;
     if ($this->intTableKeyValue != "") {
         $returnVal = parent::delete();
         $downloadObj = new Download($this->MySQL);
         $arrAttachments = $this->getPostAttachements();
         foreach ($arrAttachments as $attachment) {
             $downloadObj->select($attachment);
             $downloadObj->delete();
         }
     }
 }