[phpMP-CVS] CVS: phpMP/includes auth.php,1.24,1.25 user.php,1.4,1.5
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-12-04 00:18:56
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv1110/includes Modified Files: auth.php user.php Log Message: Continued work on the Auth system. Index: auth.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/auth.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** auth.php 2 Dec 2002 22:21:03 -0000 1.24 --- auth.php 4 Dec 2002 00:18:52 -0000 1.25 *************** *** 5,26 **** var $curr_user; function Auth() { // Session ID is contained in the URL. ! if( isset( $_GET[SESSID] ) { } ! // We're using the session cookie set by the previous session. elseif( isset( $_COOKIE[COOKIE_NAME] ) { ! $cookie_data = $_COOKIE[COOKIE_NAME]; } // Set up cookie/url procedures and such. } --- 5,58 ---- var $curr_user; + var $SESSID; function Auth() { + global $DB; + // Session ID is contained in the URL. ! if( isset( $_GET['SESSID'] ) { + define("SESSID_LOC", 1); + + $session_id = $_GET['SESSID']; } ! // We're using the cookie set by the previous session. elseif( isset( $_COOKIE[COOKIE_NAME] ) { ! define("SESSID_LOC", 2); ! ! $session_id = $_COOKIE[COOKIE_NAME]; } + $sql = "SELECT * FROM " . SESSIONS_TABLE . " WHERE sessid=" . $session_id . " AND expiry<" . time(); + $result = $DB->query($sql); + + $numrows = $DB->numRows($result); + + if($numrows >= 1) + { + + $sess_data = $DB->fetchArray($result); + + } + else // The session doesn't exist or has expired. + { + + die("Your session has expired."); + + } + + if( SESSID_LOC == 2 ) // We need to set up the cookie. + { + + // Set up cookie/url procedures and such. + + } } Index: user.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** user.php 3 Dec 2002 11:17:42 -0000 1.4 --- user.php 4 Dec 2002 00:18:52 -0000 1.5 *************** *** 20,24 **** if( $val != '' ) { ! define( "U_" . $key, $val ); } } --- 20,24 ---- if( $val != '' ) { ! define( "U_" . strtoupper($key), $val ); } } |