Auth Class Reference

User authentication and authorization library. More...

Inheritance diagram for Auth:
Auth_NoAuth

Public Member Functions

 __construct (array $config=array())
 logged_in ()
 Check if there is an user logged in.
 get_user ()
 Returns the currently logged in user, or NoAuth user.
 login ($username, $password, $auth_method=false)
 Attempt to log in a user by using an ORM object and plain-text password.
 verify_password ($user, $password)
 Verify password for a logged in user.
 authorized_for ($authorization_point)
 Returns true if current session has access for a given authorization point.
 get_default_auth ()
 Returns name of default authentication method.
 force_user (User_Model $user)
 Take an User_Model object, and force the auth module to recognize it as the currently logged in user.

Static Public Member Functions

static factory (array $config=array())
 Create an instance of Auth.
static get_groups_without_rights (array $rights_to_exclude)
static instance ($config=array())
 Return a static instance of Auth.
static disable_auth_subsystem ()
 Register noauth as auth subsystem, so we can't login, logout or anything.

Detailed Description

User authentication and authorization library.


Constructor & Destructor Documentation

Auth::__construct ( array $  config = array()  ) 
Parameters:
$config array Optional method config

Member Function Documentation

Auth::authorized_for ( authorization_point  ) 

Returns true if current session has access for a given authorization point.

Parameters:
$authorization_point string authorization point
Returns:
boolean true if access

Reimplemented in Auth_NoAuth.

static Auth::disable_auth_subsystem (  )  [static]

Register noauth as auth subsystem, so we can't login, logout or anything.

This effectivly reduces possibilities for auth-related errors. Because lot of things depend on auth, even when rendering, this is needed to be loaded when displaying error pages.

static Auth::factory ( array $  config = array()  )  [static]

Create an instance of Auth.

Returns:
object
Auth::get_default_auth (  ) 

Returns name of default authentication method.

Returns:
string default authentication method
static Auth::get_groups_without_rights ( array $  rights_to_exclude  )  [static]
Parameters:
$rights_to_exclude array
Returns:
array
Auth::get_user (  ) 

Returns the currently logged in user, or NoAuth user.

Returns:
mixed

Reimplemented in Auth_NoAuth.

static Auth::instance ( config = array()  )  [static]

Return a static instance of Auth.

Returns:
object
Auth::logged_in (  ) 

Check if there is an user logged in.

Returns:
boolean
Auth::login ( username,
password,
auth_method = false 
)

Attempt to log in a user by using an ORM object and plain-text password.

Parameters:
$username string username to log in
$password string password to check against
$auth_method mixed Which auth method to use
Returns:
boolean True on success

Reimplemented in Auth_NoAuth.

Auth::verify_password ( user,
password 
)

Verify password for a logged in user.

Usable for form validation of critical user data, for example validate a password change.

This method doesn't use APC

Parameters:
$user User_Model User object to verify
$password string Password to test
Returns:
boolean true if password is ok

Reimplemented in Auth_NoAuth.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 19 Dec 2018 for ninja by  doxygen 1.6.1