PHP Class Users_auth, 68kb

Modified for our use from: http://www.bramme.net/2008/07/auth-library-for-codeigniter-tutorial/
Mostrar archivo Open project: 68kb/68kb

Public Methods

Method Description
__construct ( ) ------------------------------------------------------------------------
ban_check ( ) : boolean Check if a user is banned
check_role ( $role = NULL ) : boolean Check a role
get_data ( $data ) : mixed Get an item for the user.
logged_in ( ) : boolean Check if a user is logged in
login ( $username = '', $password = '', $remember = 'n', $in_admin = FALSE ) : void Set the mode of the creation
logout ( ) Logout a user
redirect ( $in_admin = FALSE ) Redirect user to page requested

Private Methods

Method Description
_check_cookie ( ) Check Cookie
_check_failed_login ( $username ) Check a failed login attempt
_create_session ( ) Create session data
_get_hash ( ) : void Create a unique hash
_set_cookie ( ) : void Save cookie login
_set_guest ( ) : array Set a user as a guest.

Method Details

__construct() public method

------------------------------------------------------------------------
public __construct ( )

ban_check() public method

This method returns TRUE if they are banned.
public ban_check ( ) : boolean
return boolean

check_role() public method

Check if a user can perform a specific action.
public check_role ( $role = NULL ) : boolean
return boolean

get_data() public method

Get an item for the user.
public get_data ( $data ) : mixed
return mixed

logged_in() public method

First check the session then the cookie.
public logged_in ( ) : boolean
return boolean

login() public method

Set the mode of the creation
public login ( $username = '', $password = '', $remember = 'n', $in_admin = FALSE ) : void
return void

logout() public method

Logout a user
public logout ( )

redirect() public method

Redirect user to page requested
public redirect ( $in_admin = FALSE )