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.

is_logged_in

Summary

Checks if a specific user is logged in.

Usage

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

Parameters

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

Returns

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

Description

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.

Examples

Example 1

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

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)


Comments

There are no comments.