View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0010569 | mantisbt | plug-ins | public | 2009-06-07 09:54 | 2009-06-07 14:13 | 
| Reporter | aik099 | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always | 
| Status | new | Resolution | open | ||
| Product Version | 1.2.0a3 | ||||
| Summary | 0010569: 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: at the end of "auth_attempt_login" function.  | ||||
| Tags | No tags attached. | ||||