mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02: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);
|
log_user($user_found['id'], $remember_me);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clear_fake_user_cache();
|
||||||
trigger_notify('login_success', stripslashes($username));
|
trigger_notify('login_success', stripslashes($username));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1409,6 +1410,17 @@ function generate_fake_user()
|
|||||||
return $_SESSION['fake_user_cache'];
|
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.
|
* Performs all the cleanup on user logout.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user