remove old readme
[atutor.git] / mods / _core / backups / restore.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 authenticate(AT_PRIV_ADMIN); 
19 require(AT_INCLUDE_PATH.'../mods/_core/backups/classes/Backup.class.php');
20 require_once(AT_INCLUDE_PATH.'../mods/_core/file_manager/filemanager.inc.php');
21
22 $Backup = new Backup($db, $_SESSION['course_id']);
23
24 if (!isset($_REQUEST['backup_id'])) {
25         header('Location: index.php');
26         exit;
27 }
28
29 if (isset($_POST['cancel'])) {
30         $msg->addFeedback('CANCELLED');
31         header('Location: index.php');
32         exit;
33 } else if (isset($_POST['submit'])) {
34         if (!$_POST['material']) {
35                 $msg->addError(array('EMPTY_FIELDS', _AT('material')));
36         } else {
37                 $Backup->restore($_POST['material'], $_POST['action'], $_POST['backup_id']);
38                 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
39                 header('Location: index.php');
40                 exit;
41         }
42 }
43
44 require(AT_INCLUDE_PATH.'header.inc.php');
45
46 $row = $Backup->getRow($_REQUEST['backup_id']);
47
48
49 $savant->display('instructor/backups/restore.tmpl.php');
50 require (AT_INCLUDE_PATH.'footer.inc.php');  ?>