PHP Class Users_auth, 68kb

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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

ban_check() public méthode

This method returns TRUE if they are banned.
public ban_check ( ) : boolean
Résultat boolean

check_role() public méthode

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

get_data() public méthode

Get an item for the user.
public get_data ( $data ) : mixed
Résultat mixed

logged_in() public méthode

First check the session then the cookie.
public logged_in ( ) : boolean
Résultat boolean

login() public méthode

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

logout() public méthode

Logout a user
public logout ( )

redirect() public méthode

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