Public Method Details |
pxdb_auth |
public void pxdb_auth([ string $auth_key ])
|
|
|
Parameter |
|
string |
$auth_key |
= >>'auth'<< |
|
A unique identifier to use for this authentication / session. |
|
Returns |
void |
|
&singleton |
public object pxdb_auth &singleton([ string $auth_key ])
|
|
Will create a new auth class only if one does not already exist.
|
Parameter |
|
string |
$auth_key |
= >>'auth'<< |
|
A unique identifier to use for this authentication / session. |
|
Returns |
object pxdb_auth |
|
import |
public void import([ array $source ])
|
|
Sub-classes that override this method should always provide this minimal function signature and should begin by invoke the parent import() method.
|
Parameter |
|
array |
$source |
= >>null<< |
|
The source values to import. |
|
Returns |
void |
|
allow |
public void allow(string $page)
|
|
This is important if you have some pages that should be visible to an un-authenticated user Some examples might include: - an overview / landing (not login) page - a "forgot my password" page.
|
Parameter |
|
string |
$page |
|
|
Relative URL to match for pages that are allowed through. |
|
Returns |
void |
|
is_allowed |
public boolean is_allowed([ string $page ])
|
|
By default (if no page is specified), it will check to see if $_SERVER[PHP_SELF] is in the $open_pages array.
|
Parameter |
|
string |
$page |
= >>null<< |
|
The page we are checking for. |
|
Returns |
boolean |
|
set_username_field |
public mixed set_username_field(string $field)
|
|
Looks up the column name corresponding to passed identifer or fname.
|
Parameter |
|
string |
$field |
|
|
The identifer/fname/id of field to use for username. |
|
Returns |
mixed |
|
set_password_field |
public mixed set_password_field(string $field)
|
|
Looks up the column name corresponding to passed identifer or fname.
|
Parameter |
|
string |
$field |
|
|
The identifer/fname/id of field to use for username. |
|
Returns |
mixed |
|
&authenticate |
public mixed &authenticate()
|
|
This function uses PHP 4 sessions to store hash based on logged-in user. This function will try 1) to find an existing session 2) to login based on entered_username and entered_password in the $_imported array. After user is logged-in, this function will ensure that they have privs necessary to view current page, and then it will unpack the preserved GET & POST vars.
|
Returns |
mixed A new pxdb_user object or false if they are not logged in. |
|
restrict |
public void restrict(mixed $groups)
|
|
Sets the $restrict_groups attribute to the array of group names.
|
Parameter |
|
mixed |
$groups |
|
|
An array or delimited string of group *names* |
|
Returns |
void |
|
&user |
public object A &user(mixed $user, [ string $sql_enc_func ])
|
|
|
Parameter |
|
mixed |
$user |
|
|
The username or ID of user to log in. |
|
|
string |
$sql_enc_func |
= >>null<< |
|
The SQL encryption function to use to test the passed value. (e.g. 'MD5')
This is used by the authenticate() method, since values are stored in the session
encrypted with MD5. |
|
Returns |
object A new pxdb_user object. |
|
set_datatypes |
public void set_datatypes(string $dt)
|
|
|
Parameter |
|
|
Returns |
void |
|
&login |
public mixed &login()
|
|
|
Returns |
mixed The pxdb_user object or false if not able to authenticate user. |
|
logout |
public void logout()
|
|
Deletes the session variable and destroys (as of 0.0.4) the pxdb_user singleton.
|
Returns |
void |
|
showlogin |
public void showlogin([ string $template, array $additional_vars ])
|
|
This method outputs the processed template to the buffer.
|
Parameter |
|
string |
$template |
= >>null<< |
|
Template path for login form. |
|
|
array |
$additional_vars |
= >>null<< |
|
Hash of additional vars that should be set for the template to use. |
|
Returns |
void |
|