You probably need to call user_load() -- please read through this issue and the issues that it references:
- Marc
Davide Michel 'ZioBudda' Morelli wrote:
Hi all. I need to add some infos to $user variable. I have thinked that hook_user() is my "hook" :)
So I have write a function that add the infos to the $account:
function mw_livelloUtenti_user($op, &$edit, &$account, $category = NULL) { switch ($op) { case "login" : case "load" : if ($account->uid != NULL || $account->uid != 0) {
$tmp = db_query("SELECT mw.* FROM mw_lU AS mw LEFT JOINmw_lU_user AS mwu ON mw.luid = mwu.luid WHERE mwu.uid = %d",$account->uid); $account->level = db_fetch_array($tmp); //print_r($account); //Ok, data are inserted (fields: level, data1, data2) } break; } }
Now, why when one of my other module try to access to $user->account this field is NULL ? Plz help me.
M.