1 |
rodolico |
1 |
<?php
|
|
|
2 |
// set the library and include paths
|
|
|
3 |
/// see http://www.bin-co.com/php/articles/current_file_path.php
|
|
|
4 |
$path = pathinfo( $_SERVER['SCRIPT_FILENAME'] );
|
18 |
rodolico |
5 |
$includes = $path['dirname'] . '/include/';
|
|
|
6 |
$library = $path['dirname'] . '/library/';
|
1 |
rodolico |
7 |
|
|
|
8 |
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $library );
|
|
|
9 |
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $includes );
|
|
|
10 |
include_once( realpath( $_SERVER['DOCUMENT_ROOT'] . '/../camp2_config.php' ) );
|
|
|
11 |
|
|
|
12 |
include_once( 'Auth.class.php' );
|
|
|
13 |
|
|
|
14 |
// this application requires sessions
|
|
|
15 |
session_start();
|
|
|
16 |
global $loggingIn;
|
|
|
17 |
if ( ! $loggingIn ) { // don't check for auth if we are being loaded from login!
|
|
|
18 |
if ( ! isset( $_SESSION["authorization information"] ) ) {
|
|
|
19 |
header( "Location: login.html" );
|
|
|
20 |
exit; // should never be reached, just making sure.
|
|
|
21 |
} elseif ( ! $_SESSION["authorization information"]->authorize( $_SERVER['PHP_SELF'] ) ) {
|
|
|
22 |
header ( "Location: /" );
|
|
|
23 |
exit; // should never be reached, just making sure
|
|
|
24 |
}
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
?>
|