Subversion Repositories computer_asset_manager_v2

Rev

Rev 1 | Rev 20 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php
   // set the library and include paths 
   /// see http://www.bin-co.com/php/articles/current_file_path.php
   $path = pathinfo( $_SERVER['SCRIPT_FILENAME'] );
   $includes = $path['dirname'] . '/include/';
   $library = $path['dirname'] . '/library/';
   
   ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $library );
   ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $includes );
   include_once( realpath( $_SERVER['DOCUMENT_ROOT'] . '/../camp2_config.php' ) );

   include_once( 'Auth.class.php' );

   // this application requires sessions
   session_start();
   global $loggingIn;
   if ( ! $loggingIn ) { // don't check for auth if we are being loaded from login!
      if ( ! isset(  $_SESSION["authorization information"] ) ) {
         header( "Location: login.html" );
         exit; // should never be reached, just making sure.
      } elseif ( ! $_SESSION["authorization information"]->authorize( $_SERVER['PHP_SELF'] ) ) {
         header ( "Location: /" );
         exit; // should never be reached, just making sure
      }
   }
         
   
?>