Fetch current user instead of using a global variable

Fixes regression in EZP-22193, where $current_user isn't set in legacy callbacks.