2 /****************************************************************************/
4 /****************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel 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 admin_authenticate(AT_ADMIN_PRIV_COURSES);
19 if (isset($_POST['submit_yes'])) {
20 $_POST['course'] = intval($_POST['course']);
22 $admin_login = $_SESSION['login'];
24 $sql = "SELECT M.member_id, M.login, M.preferences, M.language FROM ".TABLE_PREFIX."members M, ".TABLE_PREFIX."courses C WHERE C.course_id=".$_POST['course']." and C.member_id=M.member_id";
25 $result = mysql_query($sql, $db);
26 if ($row = mysql_fetch_assoc($result)) {
27 $_SESSION['course_id'] = 0;
28 $_SESSION['login'] = $row['login'];
29 $_SESSION['valid_user'] = true;
30 $_SESSION['member_id'] = intval($row['member_id']);
31 if ($row['preferences'] == "")
32 assign_session_prefs(unserialize(stripslashes($_config["pref_defaults"])));
34 assign_session_prefs(unserialize(stripslashes($row['preferences'])));
35 $_SESSION['is_guest'] = 0;
36 $_SESSION['lang'] = $row['language'];
37 $_SESSION['is_super_admin'] = $admin_login;
38 session_write_close();
40 header('Location: '.AT_BASE_HREF.'bounce.php?course='.$_POST['course']);
43 } else if (isset($_POST['submit_no'])) {
45 $msg->addFeedback('CANCELLED');
46 header('Location: '.AT_BASE_HREF.'admin/courses.php');
50 require(AT_INCLUDE_PATH.'header.inc.php');
52 $sql = "SELECT * FROM ".TABLE_PREFIX."courses WHERE course_id=".$_REQUEST['course'];
53 $result = mysql_query($sql, $db);
54 $row = mysql_fetch_array($result);
56 $hidden_vars['course'] = $_GET['course'];
58 $msg->addConfirm(array('LOGIN_INSTRUCTOR', SITE_NAME, $row['title']), $hidden_vars);
61 require(AT_INCLUDE_PATH.'footer.inc.php');