Merge branch 'fix_auth_timeout' into storageareas

This commit is contained in:
Isaac Connor 2016-09-29 10:44:30 -04:00
commit ab8b58ba48
1 changed files with 3 additions and 6 deletions

View File

@ -65,10 +65,7 @@ function userLogin( $username, $password="", $passwordHashed=false ) {
function userLogout() {
global $user;
$username = $user['Username'];
Info( "User \"$username\" logged out" );
Info( 'User "'.$user['Username'].'" logged out' );
unset( $_SESSION['user'] );
unset( $user );
@ -121,9 +118,9 @@ function getAuthUser( $auth ) {
if ( $_SESSION['username'] ) {
# Most of the time we will be logged in already and the session will have our username, so we can significantly speed up our hash testing by only looking at our user.
# Only really important if you have a lot of users.
$sql = "SELECT Username, Password FROM Users WHERE Enabled = 1 AND Username='".$_SESSION['username']."'";
$sql = "SELECT * FROM Users WHERE Enabled = 1 AND Username='".$_SESSION['username']."'";
} else {
$sql = 'SELECT Username, Password FROM Users WHERE Enabled = 1';
$sql = 'SELECT * FROM Users WHERE Enabled = 1';
}
foreach ( dbFetchAll( $sql ) as $user ) {