View Issue Details

IDProjectCategoryView StatusLast Update
0010569mantisbtplug-inspublic2009-06-07 14:13
Reporteraik099 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version1.2.0a3 
Summary0010569: Wrong $g_cache_current_user_id after auth_attempt_login is called
Description

In my plugin I'm attempting to perform some actions using username and plain password of user, that just was logged in. For that purpose I've added new EVENT_AFTER_LOGIN event (could be useful in base code too) and call it at the end of "auth_attempt_login" function. In the actual hook to this new event I use "current_user_is_anonymous" function which returns incorrect result - it tells me, that I'm anonymous, but I'm not.

Inside "current_user_is_anonymous" there is code, that returns current authenticated username - current_user_get_field( 'username' ). At the end "auth_get_current_user_id" function is called and returns globally cached current user id (from $g_cache_current_user_id vaiable). Just after login is made (even before redirect to login_cookie_test.php) this variable is not reset and I still get previously logged/anonymous user id.

I propose to add this:
$g_cache_current_user_id = $t_user_id; // for currentuser* functions

at the end of "auth_attempt_login" function.

TagsNo tags attached.

Activities

vboctor

vboctor

2009-06-07 14:13

manager   ~0022058

Changed category to plug-ins.