Last change
on this file since 170 was
58,
checked in by fpvanagthoven, 14 years ago
|
mainmenu.php tweaked for usability. When not logged in, the user gets redirected to index.php
|
File size:
551 bytes
|
Rev | Line | |
---|
[10] | 1 | <?php |
---|
| 2 | |
---|
| 3 | /** |
---|
| 4 | * Description of master |
---|
| 5 | * |
---|
| 6 | * For autoloading of classes for example. |
---|
| 7 | * |
---|
| 8 | * @author fpvanagthoven |
---|
| 9 | */ |
---|
| 10 | // Determine our absolute document root |
---|
| 11 | define('DOC_ROOT', realpath(dirname(__FILE__) . '/../')); |
---|
| 12 | |
---|
[58] | 13 | /* Session */ |
---|
| 14 | session_name("cpsft"); // Set a session name |
---|
| 15 | session_start(); // Start the session |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | |
---|
[10] | 19 | function __autoload($class_name) { |
---|
| 20 | require 'classes/' . $class_name . '.php'; |
---|
[51] | 21 | } |
---|
| 22 | |
---|
| 23 | |
---|
| 24 | // Redirects user to $url |
---|
| 25 | function redirect($url = null) |
---|
| 26 | { |
---|
| 27 | if (is_null($url)) |
---|
| 28 | $url = $_SERVER['PHP_SELF']; |
---|
| 29 | |
---|
| 30 | header("Location: $url"); |
---|
| 31 | exit(); |
---|
[10] | 32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.