move code up one directory
[atutor.git] / mods / _core / modules / module_uninstall_step_3.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 admin_authenticate(AT_ADMIN_PRIV_MODULES);
18
19 if (isset($_REQUEST['cancelled']))
20         $cancelled = $_REQUEST['cancelled'];
21 else if (isset($_POST['cancelled']))
22         $cancelled = $_POST['cancelled'];
23
24 if (isset($_REQUEST['uninstalled']))
25         $uninstalled = $_REQUEST['uninstalled'];
26 else if (isset($_POST['uninstalled']))
27         $uninstalled = $_POST['uninstalled'];
28
29 if (isset($_REQUEST['args']))
30         $args = $_REQUEST['args'];
31 else if (isset($_POST['args']))
32         $args = $_POST['args'];
33
34 if (isset($_REQUEST['mod']))
35         $mod = $_REQUEST['mod'];
36 else if (isset($_POST['mod']))
37         $mod = $_POST['mod'];
38
39 $mods_folder = '../../../mods/';
40
41 if (!is_writable($mods_folder) && isset($_POST['submit_yes'])) 
42 {
43         if ($cancelled == 1) 
44         {
45                 $msg->addFeedback('CANCELLED');
46         }
47         
48         if ($uninstalled == 1) 
49         {
50                 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
51         }
52
53         header('Location: '.AT_BASE_HREF.'mods/_core/modules/index.php?'.$_POST['args']);
54         exit;
55 }
56
57 require(AT_INCLUDE_PATH.'header.inc.php'); 
58
59 unset($hidden_vars);
60 $hidden_vars['cancelled'] = $cancelled;
61 $hidden_vars['uninstalled'] = $uninstalled;
62 $hidden_vars['args'] = $args;
63 $hidden_vars['mod'] = $mod;
64
65 $msg->addConfirm(array('REMOVE_WRITE_PERMISSION', realpath($mods_folder)), $hidden_vars, _AT("continue"), '', true);
66 $msg->printConfirm();
67
68 require(AT_INCLUDE_PATH.'footer.inc.php'); 
69
70 ?>