FUEL CMS User Guide : Version 1.5.2


Fuel Auth Class

This class extends the Fuel_base_library class.

Properties Reference

Property Default Value Description
protected
_user_perms N/A Cached values of user permissions

Function Reference [+]

$this->fuel->auth->login('$user', '$pwd')

Logs a user into the CMS.

Returns

boolean

Parameters

(string) $user User name
(string) $pwd Password

$this->fuel->auth->set_valid_user($valid_user)

Sets the valid user to the session (used by login method as well).

Returns

void

Parameters

(array) $valid_user User data to save to the session

$this->fuel->auth->valid_user()

Returns an array of user information for the current logged in user.

Returns

array

$this->fuel->auth->set_user_data('$key', '$value')

Sets session data for the currently logged in user.

Returns

void

$this->fuel->auth->user_data(['$key'=NULL])

Returns either an array of the logged in users session data or a single value of the data if a $key parameter is passed.

Returns

mixed

Parameters

(string) $key The session key value you want access to (optional)

$this->fuel->auth->get_session_namespace()

Returns the sessions namespace which helps distinguish it from other FUEL installs (it's based on the site_name config parameter).

Returns

string

Returns the cookie name used on the front end to trigger the inline editing toolbar.

Returns

string

$this->fuel->auth->can_access()

Checks the FUEL configuration for any IP restrictions.

Returns

boolean

$this->fuel->auth->check_valid_ip('$ips')

Returns whether the browsers users remote address matches.

Returns

boolean

Parameters

(mixed) $ips a single IP address, an array of IP addresses or the starting IP address range

$this->fuel->auth->is_logged_in()

Checks if the current user is logged in.

Returns

boolean

$this->fuel->auth->has_permission('$permission', ['$type'=''])

Checks the users permissions for a particular permission.

Returns

boolean

Parameters

(string) $permission The name of the permission (usually the module's name)
(string) $type The type of permission (e.g. 'edit', 'delete'). A user that just has the permission (e.g. my_module) without the type (e.g. my_module_edit) will be given access (optional)

$this->fuel->auth->accessible_module('$module')

Determines if a user can access a certain module.

Returns

boolean

Parameters

(string) $module The name of the module

$this->fuel->auth->get_permissions()

Returns an array of permissions values for the currently logged in user.

Returns

array

$this->fuel->auth->is_super_admin()

Determines if the currently logged in user is a 'super admin'.

Returns

boolean

$this->fuel->auth->module_has_action('$action')

Checks that a module has a specific type of action (e.g. edit, delete).

Returns

boolean

Parameters

(string) $action The name of the action

$this->fuel->auth->is_fuelified()

Determines if a user is logged in and can make inline editing changes.

Returns

boolean

$this->fuel->auth->user_lang()

Returns the currently logged in users language preference.

Returns

string

$this->fuel->auth->logout()

Logs a user out of the CMS.

Returns

void