Procedural File: authentication_api.php
Source Location: /core/authentication_api.php
Page Details:
Authentication API
Tags:
Includes:
array $g_cache_anonymous_user_cookie_string [line 41]
array $g_cache_cookie_valid [line 47]
array $g_cache_current_user_id [line 53]
array $g_script_login_cookie [line 35]
auth_attempt_login [line 179]
bool auth_attempt_login(
string $p_username, string $p_password, [bool $p_perm_login = false])
|
|
Attempt to login the user with the given password If the user fails validation, false is returned If the user passes validation, the cookies are set and true is returned. If $p_perm_login is true, the long-term cookie is created.
Tags:
Parameters
string |
$p_username |
a prepared username |
string |
$p_password |
a prepared password |
bool |
$p_perm_login |
whether to create a long-term cookie |
auth_attempt_script_login [line 256]
bool auth_attempt_script_login(
string $p_username, [string $p_password = null])
|
|
Allows scripts to login using a login name or ( login name + password )
Tags:
Parameters
string |
$p_username |
username |
string |
$p_password |
username |
auth_automatic_logon_bypass_form [line 323]
bool auth_automatic_logon_bypass_form(
)
|
|
Identicates whether to bypass logon form e.g. when using http auth
Tags:
auth_clear_cookies [line 475]
bool auth_clear_cookies(
)
|
|
Clear login cookies, return true if they were cleared
Tags:
auth_does_password_match [line 339]
bool auth_does_password_match(
int $p_user_id, string $p_test_password)
|
|
Return true if the password for the user id given matches the given password (taking into account the global login method)
Tags:
Parameters
int |
$p_user_id |
User id to check password against |
string |
$p_test_password |
Password |
auth_ensure_user_authenticated [line 64]
void auth_ensure_user_authenticated(
[string $p_return_page = ''])
|
|
Check that there is a user logged-in and authenticated If the user's account is disabled they will be logged out If there is no user logged in, redirect to the login page If parameter is given it is used as a URL to redirect to following successful login. If none is given, the URL of the current page is used
Tags:
Parameters
string |
$p_return_page |
Page to redirect to following successful logon, defaults to current page |
auth_generate_confirm_hash [line 439]
string auth_generate_confirm_hash(
int $p_user_id)
|
|
Generate a confirm_hash 12 character to valide the password reset request
Tags:
Parameters
auth_generate_cookie_string [line 501]
string auth_generate_cookie_string(
)
|
|
Generate a string to use as the identifier for the login cookie It is not guaranteed to be unique and should be checked The string returned should be 64 characters in length
Tags:
auth_generate_random_password [line 426]
string auth_generate_random_password(
string $p_email)
|
|
Generate a random 12 character password
Tags:
Parameters
auth_generate_unique_cookie_string [line 513]
string auth_generate_unique_cookie_string(
)
|
|
Generate a UNIQUE string to use as the identifier for the login cookie The string returned should be 64 characters in length
Tags:
auth_get_current_user_cookie [line 558]
string auth_get_current_user_cookie(
[boolean $p_login_anonymous = true])
|
|
Return the current user login cookie string, note that the cookie cached by a script login superceeds the cookie provided by the browser. This shouldn't normally matter, except that the password verification uses this routine to bypass the normal authentication, and can get confused when a normal user logs in, then runs the verify script. the act of fetching config variables may get the wrong userid. if no user is logged in and anonymous login is enabled, returns cookie for anonymous user otherwise returns '' (an empty string)
Tags:
Parameters
boolean |
$p_login_anonymous |
auto-login anonymous user |
auth_get_current_user_id [line 775]
int auth_get_current_user_id(
)
|
|
Retrieve user id of current user
Tags:
auth_http_is_logout_pending [line 851]
bool auth_http_is_logout_pending(
)
|
|
Tags:
auth_http_prompt [line 817]
auth_http_set_logout_pending [line 835]
void auth_http_set_logout_pending(
bool $p_pending)
|
|
Tags:
Parameters
auth_is_cookie_string_unique [line 528]
bool auth_is_cookie_string_unique(
string $p_cookie_string)
|
|
Return true if the cookie login identifier is unique, false otherwise
Tags:
Parameters
auth_is_cookie_valid [line 731]
bool auth_is_cookie_valid(
string $p_cookie_string)
|
|
is cookie valid?
Tags:
Parameters
auth_is_user_authenticated [line 92]
bool auth_is_user_authenticated(
[boolean 0 = auto-login anonymous user])
|
|
Return true if there is a currently logged in and authenticated user, false otherwise
Tags:
Parameters
boolean |
0 |
auto-login anonymous user |
auth_logout [line 298]
Logout the current user and remove any remaining cookies from their browser Returns true on success, false otherwise
Tags:
auth_prepare_password [line 140]
string auth_prepare_password(
string $p_password)
|
|
prepare/override the password provided from logon form (if necessary)
Tags:
Parameters
auth_prepare_username [line 108]
string auth_prepare_username(
string $p_username)
|
|
prepare/override the username provided from logon form (if necessary)
Tags:
Parameters
auth_process_plain_password [line 392]
string auth_process_plain_password(
string $p_password, [string $p_salt = null], [string $p_method = null])
|
|
Encrypt and return the plain password given, as appropriate for the current global login method. When generating a new password, no salt should be passed in. When encrypting a password to compare to a stored password, the stored password should be passed in as salt. If the auth method is CRYPT then crypt() will extract the appropriate portion of the stored password as its salt
Tags:
Parameters
string |
$p_password |
|
string |
$p_salt |
salt, defaults to null |
string |
$p_method |
logon method, defaults to null (use config login method) |
auth_reauthenticate [line 619]
bool auth_reauthenticate(
)
|
|
Check for authentication tokens, and display re-authentication page if needed. Currently, if using BASIC or HTTP authentication methods, or if logged in anonymously, this function will always "authenticate" the user (do nothing).
Tags:
auth_reauthenticate_page [line 651]
bool auth_reauthenticate_page(
integer $p_user_id, string $p_username)
|
|
Generate the intermediate authentication page.
Tags:
Parameters
integer |
$p_user_id |
User ID |
string |
$p_username |
Username |
auth_set_cookies [line 456]
void auth_set_cookies(
int $p_user_id, [bool $p_perm_login = false])
|
|
Set login cookies for the user If $p_perm_login is true, a long-term cookie is created
Tags:
Parameters
int |
$p_user_id |
user id |
bool |
$p_perm_login |
indicates whether to generate a long-term cookie |
auth_set_tokens [line 602]
void auth_set_tokens(
integer $p_user_id)
|
|
Set authentication tokens for secure session.
Tags:
Parameters
integer |
$p_user_id |
User ID |
|