mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
issue #2440 clear fake user cache on successful login
Added a call to clear_fake_user_cache() in pwg_login to ensure the fake user cache is reset after a successful login. Also introduced the clear_fake_user_cache() function for this purpose.
This commit is contained in:
@@ -1330,6 +1330,7 @@ function pwg_login($success, $username, $password, $remember_me)
|
||||
log_user($user_found['id'], $remember_me);
|
||||
}
|
||||
|
||||
clear_fake_user_cache();
|
||||
trigger_notify('login_success', stripslashes($username));
|
||||
return true;
|
||||
}
|
||||
@@ -1409,6 +1410,17 @@ function generate_fake_user()
|
||||
return $_SESSION['fake_user_cache'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear current session fake user cache
|
||||
*
|
||||
* @since 16
|
||||
* @return void
|
||||
*/
|
||||
function clear_fake_user_cache()
|
||||
{
|
||||
unset($_SESSION['fake_user_cache']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs all the cleanup on user logout.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user