From a407c677d9bd2fc6e7a1b8a47fa7bc5eab9311d6 Mon Sep 17 00:00:00 2001 From: stan Date: Wed, 21 Jan 2004 14:20:33 +0000 Subject: [PATCH] Fixed bogus login problem. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@758 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_funcs.php | 6 +++--- web/zm_html.php | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/web/zm_funcs.php b/web/zm_funcs.php index 97e8baf39..4e390fb9e 100644 --- a/web/zm_funcs.php +++ b/web/zm_funcs.php @@ -28,13 +28,13 @@ function userLogin( $username, $password ) echo mysql_error(); $HTTP_SESSION_VARS['username'] = $username; $HTTP_SESSION_VARS['password'] = $password; - if ( $user = mysql_fetch_assoc( $result ) ) + if ( $db_user = mysql_fetch_assoc( $result ) ) { - $HTTP_SESSION_VARS['user'] = $user; + $HTTP_SESSION_VARS['user'] = $user = $db_user; } else { - $HTTP_SESSION_VARS['user'] = array(); + unset( $user ); } session_write_close(); } diff --git a/web/zm_html.php b/web/zm_html.php index 8a38b316f..910f41ce1 100644 --- a/web/zm_html.php +++ b/web/zm_html.php @@ -37,6 +37,10 @@ if ( ZM_OPT_USE_AUTH ) $user = $HTTP_SESSION_VARS['user']; define( "ZMU_COMMAND", ZMU_PATH." -U ".$HTTP_SESSION_VARS['username']." -P ".$HTTP_SESSION_VARS['password'] ); } + else + { + unset( $user ); + } } else {