de2daf081e756494c683daecf2e3c77551e50e5a
[atutor.git] / mods / disclaimer / module.php
1 <?php\r
2 /*******\r
3  * doesn't allow this file to be loaded with a browser.\r
4  */\r
5 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
6 \r
7 /******\r
8  * this file must only be included within a Module obj\r
9  */\r
10 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }\r
11 \r
12 global $_config;\r
13 /*******\r
14  * assign the instructor and admin privileges to the constants.\r
15  */\r
16 define('AT_ADMIN_TERMS_AND_CONDITIONS', $this->getAdminPrivilege());\r
17 \r
18 /*******\r
19  * add the admin pages when needed.\r
20  */\r
21 if (admin_authenticate(AT_ADMIN_TERMS_AND_CONDITION, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {\r
22          $this->_pages['admin/config_edit.php']['children'][] = 'mods/disclaimer/tac_edit.php';\r
23          $this->_pages['mods/disclaimer/tac_edit.php']['title_var']  = 'disclaimer';\r
24          $this->_pages['mods/disclaimer/tac_edit.php']['parent']         = 'admin/config_edit.php';\r
25 }\r
26 \r
27 // The user cannot bypass the "terms and conditions" page \r
28 //if($_config['enable_terms_and_conditions']==1 && !isset($_SESSION['agree_terms_and_conditions']) && !strstr($_SERVER['PHP_SELF'], 'terms_and_conditions.php')){\r
29 //      header('Location: '.AT_BASE_HREF.'mods/disclaimer/terms_and_conditions.php');\r
30 //      exit;\r
31 //}\r
32 //\r
33 //// destroy the session var at logout\r
34 //if (strstr($_SERVER['PHP_SELF'], 'logout.php')) {\r
35 //      unset($_SESSION['agree_terms_and_conditions']);\r
36 //}\r
37 ?>