Subversion Repositories computer_asset_manager_v2

Rev

Rev 20 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20 Rev 21
Line 1... Line 1...
1
<?php
1
<?php
2
   
2
   
3
   // add ./include and ./library to the include path
3
   $loggingIn = true;
4
   ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . __DIR__ . '/include' . PATH_SEPARATOR . __DIR__ . '/library' ); 
4
   include( 'header.php' );
-
 
5
   
5
   session_start();
6
   global $DEBUG;
6
   
7
   
7
   if ( ! isset( $_SESSION[ 'app directories' ] ) ) {
8
   if ( ! isset( $_SESSION[ 'app directories' ] ) ) {
8
      /*
9
      /*
9
       * Since this file is in the root of the application, which may not be
10
       * Since this file is in the root of the application, which may not be
10
       * the same as DocumentRoot, we'll get the info from here and make it
11
       * the same as DocumentRoot, we'll get the info from here and make it
Line 45... Line 46...
45
      include_once( 'include/config.php' );
46
      include_once( 'include/config.php' );
46
      $_SESSION['database']['username'] = $db_username;
47
      $_SESSION['database']['username'] = $db_username;
47
      $_SESSION['database']['password'] = $db_password;
48
      $_SESSION['database']['password'] = $db_password;
48
      $_SESSION['database']['name'] = $db_name;
49
      $_SESSION['database']['name'] = $db_name;
49
      $_SESSION['database']['host'] = $db_hostname;
50
      $_SESSION['database']['host'] = $db_hostname;
-
 
51
      $_SESSION['DEBUG']['File Name'] = $debug_file;
-
 
52
      $_SESSION['DEBUG']['level'] = $debug_level;
50
   } // if we have not initialized the session
53
   } // if we have not initialized the session
51
 
54
 
52
   include_once( 'functions.php' );
-
 
53
   include_once( 'Auth.class.php' );
-
 
54
   DBQuery::connect( $_SESSION['database'] );
55
   DBQuery::connect( $_SESSION['database'] );
55
   
56
   
-
 
57
   $DEBUG = new DebugFile( $_SESSION['DEBUG']['File Name'], $_SESSION['DEBUG']['level'] );
56
   $debug = array();
58
   
57
   $message = isset( $_REQUEST['message'] ) ? $_REQUEST['message'] : '';
59
   $message = isset( $_REQUEST['message'] ) ? $_REQUEST['message'] : '';
58
   if ( isset( $_REQUEST['login'] ) ) {
60
   if ( isset( $_REQUEST['login'] ) ) {
59
      $debug[] = 'Inside Login';
61
      $DEBUG->writeLog( 1, 'Inside Login' );
60
      $_SESSION["authorization information"] = new Auth( array(  'login page' => $_SERVER['PHP_SELF'] ) );
62
      $auth = new Auth( array(  'login page' => $_SERVER['PHP_SELF'], 'logName' => '/tmp/auth.log', 'logLevel' => 5 ) );
61
      $debug[] = 'created Auth, values ' . print_r( $_SESSION["authorization information"], true );
63
      $DEBUG->writeLog( 3, 'created Auth, values ' . print_r( $auth, true ) );
62
      if ( $_SESSION["authorization information"]->verifyLogin ( $_REQUEST['password'], $_REQUEST['username'] ) ) {
64
      $_SESSION['authorization information'] = $auth->verifyLogin ( $_REQUEST['password'], $_REQUEST['username'] );
-
 
65
      if ( $_SESSION['authorization information'] ) {
63
         header ('Location: ' . $_SESSION[ 'app directories' ]['url system']['app root'] );
66
         header ('Location: ' . $_SESSION[ 'app directories' ]['url system']['app root'] );
64
      } // if we logged in
67
      } // if we logged in
65
      $message = 'Unknown Username or Password';
68
      $message = 'Unknown Username or Password';
66
   } // some username was entered
69
   } // some username was entered
67
   //session_destroy();
70
   session_destroy();
68
   
71
   
69
?>
72
?>
70
 
73
 
71
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
74
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
72
<html>
75
<html>
Line 111... Line 114...
111
         </table>
114
         </table>
112
      </form>
115
      </form>
113
      <h4 align='center'>version <?php echo VERSION . '<BR>' . BUILD_DATE; ?></h4>
116
      <h4 align='center'>version <?php echo VERSION . '<BR>' . BUILD_DATE; ?></h4>
114
      <?php
117
      <?php
115
         print '<pre>';
118
         print '<pre>';
116
         print implode( "\n", $debug );
119
         print_r( $DEBUG );
117
         print_r( $_SESSION );
120
         print_r( $_SESSION );
118
         print "</pre>";
121
         print "</pre>";
119
      ?>
122
      ?>
120
   </body>
123
   </body>
121
</html>
124
</html>