Subversion Repositories computer_asset_manager_v2

Rev

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

<?php

   /*
    * The order of the following are important. Since we are storing 
    * an instantiation of the Auth class, we must load it BEFORE
    * starting the session, so it can be deserialized properly
    * So, we have to set the include paths, then include Auth.class.php
    * before session_start is run.
    */
   // add ./include and ./library to the include path
   ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . __DIR__ . '/include' . PATH_SEPARATOR . __DIR__ . '/library' ); 
   
   include_once( 'Auth.class.php' );
   include_once( 'DebugFile.class.php' );
   include_once( 'functions.php' );
   session_start();
   
   global $DEBUG;
   
   if ( isset( $_SESSION['DEBUG'] ) )
      $DEBUG = new DebugFile( $_SESSION['DEBUG']['File Name'], $_SESSION['DEBUG']['level'] );

   if ( ! isset( $loggingIn ) ) {
      // when login has not been called, call it, otherwise just make the DB connection
      if ( ! isset( $_SESSION[ 'authorization information' ]->user_id ) ) {
         header( "Location: login.html?message=Error%20you%20must%20log%20in%20first" );
      } else {
         DBQuery::connect( $_SESSION['database'] );
      }
   }

   
?>