diff options
author | Sem <sembrestels@riseup.net> | 2012-04-25 19:09:22 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-04-25 19:09:22 +0200 |
commit | 9fe063022e08a4b6fa5f5935f8f185d5d95814a4 (patch) | |
tree | 87377f7b889efc639935508556beb9baf010e821 /engine/lib/sessions.php | |
parent | 24690ed95198c093e6fbb91a94b5d0544c740f89 (diff) | |
download | elgg-9fe063022e08a4b6fa5f5935f8f185d5d95814a4.tar.gz elgg-9fe063022e08a4b6fa5f5935f8f185d5d95814a4.tar.bz2 |
Upgraded to Elgg 1.8.4.
Diffstat (limited to 'engine/lib/sessions.php')
-rw-r--r-- | engine/lib/sessions.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 97a05e2e8..419d36707 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -127,6 +127,10 @@ function elgg_is_admin_user($user_guid) { /** * Perform user authentication with a given username and password. * + * @warning This returns an error message on failure. Use the identical operator to check + * for access: if (true === elgg_authenticate()) { ... }. + * + * * @see login * * @param string $username The username @@ -355,7 +359,7 @@ function logout() { session_destroy(); // starting a default session to store any post-logout messages. - session_init(NULL, NULL, NULL); + _elgg_session_boot(NULL, NULL, NULL); $_SESSION['msg'] = $old_msg; return TRUE; @@ -379,7 +383,7 @@ function logout() { * @return bool * @access private */ -function session_init($event, $object_type, $object) { +function _elgg_session_boot($event, $object_type, $object) { global $DB_PREFIX, $CONFIG; // Use database for sessions @@ -444,8 +448,8 @@ function session_init($event, $object_type, $object) { set_last_action($_SESSION['guid']); } - elgg_register_action("login", '', 'public'); - elgg_register_action("logout"); + elgg_register_action('login', '', 'public'); + elgg_register_action('logout'); // Register a default PAM handler register_pam_handler('pam_auth_userpass'); @@ -655,4 +659,4 @@ function _elgg_session_gc($maxlifetime) { return true; } -elgg_register_event_handler("boot", "system", "session_init", 20); +elgg_register_event_handler('boot', 'system', '_elgg_session_boot', 2); |