[support] Add some info to $user
Davide Michel 'ZioBudda' Morelli
michel at ziobudda.net
Wed Mar 5 16:31:49 UTC 2008
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 JOIN
mw_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.
--
Michel 'ZioBudda' Morelli michel at ziobudda.net
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 -- Fax: +39-0291390660
http://www.ziobudda.net ICQ: 58351764
http://www.ziobuddalabs.it Skype: zio_budda
http://www.ajaxblog.it MSN: michel at ziobuddalabs.it
JABBER: michel at gmail.com
More information about the support
mailing list