Hello,

I want to install XiTi Pro statistics.
I can create some variables to specify in stats consultation which departement users connected consult the page X.

To do this, I need to stock in the $user global variable the departement of profil, but, I don't know where this object $user is created at the connection.

The user_login_submit() function generate the session if nobody was connected before, but that's not this function whose create $user globale variable.

Can you help me ?

Thank you.

Comments

yelvington’s picture

$user always exists but may not include all the information you seek. If you need profile information added to it, call profile_load_profile($user) in your page context.

meinsier’s picture

Thank you, but I don't use profile module, but profile node, so, my field is in {node} table and I would like to access this value anywhere in my templates, with the $user session object.

Is it possible ?

I can make a function whose select the value of the good field in {node} table, but how to make this in the $user session object ?