[development] Accessing global $user from login_destination

Timm tim at ideationsllc.com
Sat Jul 29 04:58:14 UTC 2006


Hi,

first post, hope i'm in the right place.

I can't find a way to get the current user->uid while inside a  
function within the login_destination module.
$user->uid is always null, logged in/not, no matter who I'm logged in  
as.  In my other code, this type of call works either with user->uid  
or account->uid.

function login_destination_get_destination() {
	global $user;
	$username = $user->uid;
	//$user->uid is always null.

Can you tell me what I should be looking for, or why I can't globally  
call the $user->id?  Or is there a separate function that will return  
the current user->uid?

Within the user.module, I was able to call $account->uid, and in some  
example code posted to the forum about how to use the module it says  
you can call global $user and pull attributes from there, but it's  
always null.
Any ideas?

thanks!



More information about the development mailing list