Path

ez.no / exponential / documentation / reference / data fetching / user / logged_in_list


logged_in_list

Summary

Lists the names of all logged-in users

Usage

fetch( 'user', 'logged_in_list',
       hash( [ 'sort_by', sort_by,]
             [ 'offset', offset, ]
             [ 'limit', limit ] ) )

Parameters

NameTypeDescriptionRequired
sort_by mixed Which field to sort by No.
offset integer Which offset to start fetching from No.
limit integer The maximum number of users to fetch No.

Returns

An associative array with users who are logged-in

Description

Will return an associative array with logged-in users who are considered active.
The key in the array will be the user ID and the value will be the user name.

A user is considered active if the last access time is less than the activity timeout, the default is 1 hour and can be configured in site.ini ( ActivityTimeout).

The sort_by is an array with sorting types, each type is an array with the first element being the sort field and the second being the direction (boolean).
The following sorting fields are currently supported

  • user_id
  • login
  • activity
  • email

Note: It is usually a good idea to include a limit since the number of users can get long.

See also logged_in_users which does the same but returns an array with eZUser objects.

Examples

The current users are logged in to the system

{section var=user loop=fetch( 'user', 'logged_in_list',

                              hash( 'limit', 10 ) )}

   {$user}

{/section}

Comments

Contents

Reference

Database diagram
Template operators
Template functions
Data fetching
    Class
    Content
    Collaboration
    Layout
    Notification
    Package
    Section
    Shop
    URL
    User
       anonymous_count
       current_user
       is_logged_in
       logged_in_count
       logged_in_list
       logged_in_users
       member_of
       user_role
Modules
XML tags


Created

01/06/2004
6:09:13 pm
by Jan Borsodi

Last updated

01/06/2004
6:33:01 pm
by Jan Borsodi

Authors

Jan Borsodi



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.