Authentication Variables

When a user is logged in, certain variables will be available to the views, controller, and as config items, because they are loaded by Auth_Controller.

Variables Accessible in views

// The logged in user's user ID
$auth_user_id

// The logged in user's username
$auth_username

// The logged in user's account level by number
$auth_level

// The logged in user's account level by name
$auth_role

// The logged in user's email address
$auth_email

// Any ACL permissions applied to the user
$acl

Variables Accessible in Controller

// The logged in user's user ID
$this->auth_user_id

// The logged in user's username
$this->auth_username

// The logged in user's account level by number
$this->auth_level

// The logged in user's account level by name
$this->auth_role

// The logged in user's email address
$this->auth_email

// Any ACL permissions applied to the user
$this->acl

Variables Accessible as Config Items

// The logged in user's user ID
config_item('auth_user_id')

// The logged in user's username
config_item('auth_username')

// The logged in user's account level by number
config_item('auth_level')

// The logged in user's account level by name
config_item('auth_role')

// The logged in user's email address
config_item('auth_email')

// Any ACL permissions applied to the user
config_item('acl')