Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.



Checks if a specific user is logged in.


fetch( 'user', 'is_logged_in', hash( 'user_id', user_id ) )


user_id integer The ID number of the user that should be checked. Yes.


TRUE if the specified user is logged in, FALSE otherwise.


This function checks if a user is logged in or not. The desired user's ID number must be specified using the "user_id" parameter. The ID number of a user is the same as the ID number of the content object that represents that user. A user is considered to be active / logged in if the last access time is within the range of the activity timeout. The timeout can be set using the "ActivityTimeout" directive in a configuration override for "site.ini". The default timeout is one hour.


Example 1

{def $test=fetch( 'user', 'is_logged_in', hash( 'user_id', 256 ) )}
{if $test}
    User number 256 is currently logged in.
    User number 256 is not logged in.

Outputs information that reveals whether user number 256 is logged in or not.

Balazs Halasy (01/06/2004 3:38 pm)

Balazs Halasy (06/06/2005 11:51 am)


There are no comments.