Пример #1
0
require AT_INCLUDE_PATH . 'vitals.inc.php';
admin_authenticate(AT_ADMIN_PRIV_BACKUPS);
require AT_INCLUDE_PATH . '../mods/_core/backups/classes/Backup.class.php';
require_once AT_INCLUDE_PATH . '../mods/_core/file_manager/filemanager.inc.php';
if (isset($_POST['backup_id'])) {
    $ids = explode('_', $_POST['backup_id']);
    $backup_id = $ids[0];
    $course = $ids[1];
}
if (isset($_POST['restore'], $backup_id)) {
    header('Location: restore.php?backup_id=' . $backup_id . SEP . 'course=' . $course);
    exit;
} else {
    if (isset($_POST['download'], $backup_id)) {
        $Backup = new Backup($db, $course);
        $Backup->download($backup_id);
        exit;
        // never reached
    } else {
        if (isset($_POST['delete'], $backup_id)) {
            header('Location: delete.php?backup_id=' . $backup_id . SEP . 'course=' . $course);
            exit;
        } else {
            if (isset($_POST['edit'], $backup_id)) {
                header('Location: edit.php?backup_id=' . $backup_id . SEP . 'course=' . $course);
                exit;
            } else {
                if (!empty($_POST) && !$backup_id) {
                    $msg->addError('NO_ITEM_SELECTED');
                }
            }
Пример #2
0
/* 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);
require AT_INCLUDE_PATH . '../mods/_core/backups/classes/Backup.class.php';
require_once AT_INCLUDE_PATH . '../mods/_core/file_manager/filemanager.inc.php';
if (isset($_POST['restore'], $_POST['backup_id'])) {
    header('Location: restore.php?backup_id=' . $_POST['backup_id']);
    exit;
} else {
    if (isset($_POST['download'], $_POST['backup_id'])) {
        $Backup = new Backup($db, $_SESSION['course_id']);
        $Backup->download($_POST['backup_id']);
        exit;
        // never reached
    } else {
        if (isset($_POST['delete'], $_POST['backup_id'])) {
            header('Location: delete.php?backup_id=' . $_POST['backup_id']);
            exit;
        } else {
            if (isset($_POST['edit'], $_POST['backup_id'])) {
                header('Location: edit.php?backup_id=' . $_POST['backup_id']);
                exit;
            } else {
                if (!empty($_POST)) {
                    $msg->addError('NO_ITEM_SELECTED');
                }
            }