/** * Deletes a range of backup files * * @return boolean True on success */ public function deleteSelection($list) { foreach ($list as $file) { $backup = new Backup($file); if (!$backup->delete()) { $this->error = $backup->error; return false; } } return true; }
/* Copyright (c) 2002-2010 */ /* Inclusive Design Institute */ /* http://atutor.ca */ /* */ /* This program is free software. You can redistribute it and/or */ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation. */ /****************************************************************************/ // $Id$ define('AT_INCLUDE_PATH', '../../../include/'); require AT_INCLUDE_PATH . 'vitals.inc.php'; authenticate(AT_PRIV_ADMIN); if (isset($_POST['submit_yes'])) { require AT_INCLUDE_PATH . '../mods/_core/backups/classes/Backup.class.php'; $Backup = new Backup($db, $_SESSION['course_id']); $Backup->delete($_POST['backup_id']); $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY'); header('Location: index.php'); exit; } else { if (isset($_POST['submit_no'])) { $msg->addFeedback('CANCELLED'); header('Location: index.php'); exit; } } require AT_INCLUDE_PATH . 'header.inc.php'; $delete_backup = intval($_REQUEST['backup_id']); $sql = "SELECT * from %sbackups WHERE backup_id = '%s'"; $rows_backups = queryDB($sql, array(TABLE_PREFIX, $delete_backup)); foreach ($rows_backups as $row) {