Skip to the content
Documentation

current_user

No ratings yet

Summary

Fetches the user that is currently logged in.

Usage

fetch( 'user', 'current_user' )

Returns

An ezuser object.

Description

This function fetches the user object for the user that is currently logged in. If no user is logged in, the anonymous user will be returned. In both cases, the function will return an ezuser object.

Examples

Example 1

{def $user=fetch( 'user', 'current_user' )}
User:     {$user.contentobject.name} <br />
E-mail:   {$user.email} <br />
Username: {$user.login} <br />
Group(s): {$user.groups|implode(', ')} <br />

Outputs miscellaneous information about the user that is currently logged in.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.