aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sessions.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/sessions.php')
-rw-r--r--engine/lib/sessions.php14
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);