remove old readme
[atutor.git] / mods / _core / backups / index.php
1 <?php
2 /****************************************************************************/
3 /* ATutor                                                                                                                                       */
4 /****************************************************************************/
5 /* Copyright (c) 2002-2010                                                  */
6 /* Inclusive Design Institute                                               */
7 /* http://atutor.ca                                                                                                                     */
8 /*                                                                                                                                                      */
9 /* This program is free software. You can redistribute it and/or                        */
10 /* modify it under the terms of the GNU General Public License                          */
11 /* as published by the Free Software Foundation.                                                        */
12 /****************************************************************************/
13 // $Id$
14
15 define('AT_INCLUDE_PATH', '../../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17
18
19 authenticate(AT_PRIV_ADMIN);
20
21 require(AT_INCLUDE_PATH.'../mods/_core/backups/classes/Backup.class.php');
22 require_once(AT_INCLUDE_PATH.'../mods/_core/file_manager/filemanager.inc.php');
23
24 if (isset($_POST['restore'], $_POST['backup_id'])) {
25         header('Location: restore.php?backup_id=' . $_POST['backup_id']);
26         exit;
27 } else if (isset($_POST['download'], $_POST['backup_id'])) {
28         $Backup = new Backup($db, $_SESSION['course_id']);
29         $Backup->download($_POST['backup_id']);
30         exit; // never reached
31 } else if (isset($_POST['delete'], $_POST['backup_id'])) {
32         header('Location: delete.php?backup_id=' . $_POST['backup_id']);
33         exit;
34 } else if (isset($_POST['edit'], $_POST['backup_id'])) {
35         header('Location: edit.php?backup_id=' . $_POST['backup_id']);
36         exit;
37 } else if (!empty($_POST)) {
38         $msg->addError('NO_ITEM_SELECTED');
39 }
40
41 require(AT_INCLUDE_PATH.'header.inc.php');
42
43 $Backup = new Backup($db, $_SESSION['course_id']);
44 $list = $Backup->getAvailableList();
45 $savant->assign('list', $list);
46 $savant->display('instructor/backups/index.tmpl.php');
47 require (AT_INCLUDE_PATH.'footer.inc.php');  ?>