51ffe94d94c5b145c58c9e33ba46ccc28ceb57e5
[atutor.git] / mods / disclaimer / terms_and_conditions.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                       */
4 /****************************************************************/
5 /* Copyright (c) 2002-2008                                                                              */
6 /* Adaptive Technology Resource Centre / University of Toronto  */
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: terms_and_conditions.php 8319 2009-03-03 16:38:19Z hwong $
14 $_user_location = 'public';
15 define('AT_INCLUDE_PATH', '../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 require('common.inc.php');
18
19 global $_config;
20
21 if (isset($_POST['agree'])) {
22         if (isset($_POST['inreg'])) {
23                 header ('Location: '.AT_BASE_HREF.'registration.php?agreed_disclaimer=1');
24                 exit;
25         }
26         if (!isset($_SESSION['login']) || $_SESSION['login'] == '') {
27                 header ('Location: '.AT_BASE_HREF.'index.php');
28                 exit;
29         }
30         
31         save_agreed_login($_SESSION['login']);
32         
33         if ($_SESSION['course_id'] == -1) { // admin login
34                 header ('Location: '.AT_BASE_HREF.'admin/index.php');
35                 exit;
36         } else { // regular user login
37                 // if page variable is set, bring them there.
38                 if (isset($_POST['p']) && $_POST['p']!=''){
39                         header ('Location: '.urldecode($_POST['p']));
40                         exit;
41                 }
42                 
43                 $msg->addFeedback('LOGIN_SUCCESS');
44             header('Location: '.AT_BASE_HREF.'bounce.php?course='.$_POST['form_course_id']);
45                 exit;
46         }
47 } else if (isset($_POST['disagree'])) {
48         $_SESSION = array();   // destroy all session vars set in login.php
49         header('Location: '.$_config['tac_link']);
50         exit;
51 }
52
53 $savant->assign('site_name', $_config['site_name']);
54 $savant->assign('theme', $_SESSION['prefs']['PREF_THEME']);
55 $savant->assign('base_href', $_base_href);
56 $savant->assign('body_text', $_config['tac_body']);
57 $savant->display('terms_and_conditions.tmpl.php');
58 ?>