PHP Class Kohana_Auth_ORM, php-framework-benchmarks

[!!] this Auth driver does not support roles nor autologin.
Author: Kohana Team
Inheritance: extends Auth
Show file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
auto_login ( ) : mixed Logs a user in, based on the authautologin cookie.
check_password ( string $password ) : boolean Compare password with original (hashed). Works for current (logged in) user
force_login ( $user, $mark_session_as_forced = FALSE ) : boolean Forces a user to be logged in, without specifying a password.
get_user ( ) : mixed Gets the currently logged in user from the session (with auto_login check).
logged_in ( $role = NULL, $all_required = TRUE ) : boolean Checks if a session is active.
logout ( $destroy = FALSE, $logout_all = FALSE ) : boolean Log a user out and remove any autologin cookies.
password ( $user ) : string Get the stored password for a username.
remember ( Model_User $user = NULL ) : boolean Remember user (create token and save it in cookie)

Protected Methods

Method Description
_login ( $user, $password, $remember ) : boolean Logs a user in.
complete_login ( $user ) : void Complete the login for a user by incrementing the logins and setting session data: user_id, username, roles.

Method Details

_login() protected method

Logs a user in.
protected _login ( $user, $password, $remember ) : boolean
return boolean

auto_login() public method

Logs a user in, based on the authautologin cookie.
public auto_login ( ) : mixed
return mixed

check_password() public method

Compare password with original (hashed). Works for current (logged in) user
public check_password ( string $password ) : boolean
$password string
return boolean

complete_login() protected method

Complete the login for a user by incrementing the logins and setting session data: user_id, username, roles.
protected complete_login ( $user ) : void
return void

force_login() public method

Forces a user to be logged in, without specifying a password.
public force_login ( $user, $mark_session_as_forced = FALSE ) : boolean
return boolean

get_user() public method

Returns FALSE if no user is currently logged in.
public get_user ( ) : mixed
return mixed

logged_in() public method

Checks if a session is active.
public logged_in ( $role = NULL, $all_required = TRUE ) : boolean
return boolean

logout() public method

Log a user out and remove any autologin cookies.
public logout ( $destroy = FALSE, $logout_all = FALSE ) : boolean
return boolean

password() public method

Get the stored password for a username.
public password ( $user ) : string
return string

remember() public method

Remember user (create token and save it in cookie)
public remember ( Model_User $user = NULL ) : boolean
$user Model_User
return boolean