2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg GayJoel Kronenberg & Heidi Hazelton */
6 /* Adaptive Technology Resource Centre / University of Toronto */
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 /************************************************************************/
15 define('AT_INCLUDE_PATH', '../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 authenticate(AT_PRIV_ADMIN);
19 $course = isset($_REQUEST['course']) ? intval($_REQUEST['course']) : 0;
21 if (isset($_POST['submit_no'])) {
22 $msg->addFeedback('CANCELLED');
23 header('Location: '.AT_BASE_HREF.'tools/course_properties.php');
25 } else if (isset($_POST['step']) && ($_POST['step'] == 2) && isset($_POST['submit_yes'])) {
26 require(AT_INCLUDE_PATH.'lib/filemanager.inc.php');
27 require(AT_INCLUDE_PATH.'lib/delete_course.inc.php');
29 delete_course($_SESSION['course_id'], $entire_course = true); // delete the course
30 cache_purge('system_courses','system_courses'); // purge the system_courses cache (if successful)
32 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
33 header('Location: '.AT_BASE_HREF.'bounce.php?course=0');
37 require(AT_INCLUDE_PATH.'header.inc.php');
39 if (!isset($_POST['step'])) {
40 $hidden_vars['step'] = 1;
41 $msg->addConfirm(array('DELETE_COURSE_1', $system_courses[$_SESSION['course_id']]['title']), $hidden_vars);
43 } else if ($_POST['step'] == 1) {
44 $hidden_vars['step'] = 2;
45 $msg->addConfirm(array('DELETE_COURSE_2', $system_courses[$_SESSION['course_id']]['title']), $hidden_vars);
49 require(AT_INCLUDE_PATH.'footer.inc.php');