ez.no / exponential / documentation / reference / data fetching / user / logged_in_users
fetch( 'user', 'logged_in_users',
hash( [ 'sort_by', sort_by,]
[ 'offset', offset, ]
[ 'limit', limit ] ) )
| Name | Type | Description | Required |
|---|---|---|---|
| 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. |
An array with users who are logged-in
Will return an array with logged-in users who are considered active.
Each element is an eZUser object.
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
Note: It is usually a good idea to include a limit since the number of users can get long.
See also logged_in_list which does the same but returns just the name and ID.
The current users are logged in to the system {section var=user loop=fetch( 'user', 'logged_in_users', hash( 'limit', 10 ) )} {$user.name} {/section}
Comments