From ff4aab04c59f4454ff756ec1c127158131c7f124 Mon Sep 17 00:00:00 2001 From: Ryan Lane Date: Mon, 13 Oct 2008 19:00:54 +0000 Subject: [PATCH] Adding hook UserLoadAfterLoadFromSession to fix bug 14178 --- RELEASE-NOTES | 1 + docs/hooks.txt | 6 +++++- includes/User.php | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7469a19d14..f7c89890e3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -256,6 +256,7 @@ The following extensions are migrated into MediaWiki 1.14: user can only change his rights * (bug 15846) Categories "leak" from older revisions in certain circumstances * (bug 15928) Special pages dropdown should be inline in non-MonoBook skins +* (bug 14178) Some uses of UserLoadFromSession hook cause segfault === API changes in 1.14 === diff --git a/docs/hooks.txt b/docs/hooks.txt index ee468c23c2..9879ce158e 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1354,7 +1354,11 @@ $user: User to get rights for $user: user object $name: user name -'UserLoadFromSession': called to authenticate users on external/environmental means +'UserLoadFromSession': called to authenticate users on external/environmental means; occurs before session is loaded +$user: user object being loaded +&$result: set this to a boolean value to abort the normal authentification process + +'UserLoadFromSession': called to authenticate users on external/environmental means; occurs after session is loaded $user: user object being loaded &$result: set this to a boolean value to abort the normal authentification process diff --git a/includes/User.php b/includes/User.php index 450ec0fd25..5a6f5e789b 100644 --- a/includes/User.php +++ b/includes/User.php @@ -247,6 +247,7 @@ class User { break; case 'session': $this->loadFromSession(); + wfRunHooks( 'UserLoadAfterLoadFromSession', array( $this, &$result ) ); break; default: throw new MWException( "Unrecognised value for User->mFrom: \"{$this->mFrom}\"" ); -- 2.20.1