Adding hook UserLoadAfterLoadFromSession to fix bug 14178
authorRyan Lane <laner@users.mediawiki.org>
Mon, 13 Oct 2008 19:00:54 +0000 (19:00 +0000)
committerRyan Lane <laner@users.mediawiki.org>
Mon, 13 Oct 2008 19:00:54 +0000 (19:00 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/User.php

index 7469a19..f7c8989 100644 (file)
@@ -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 ===
 
index ee468c2..9879ce1 100644 (file)
@@ -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
 
index 450ec0f..5a6f5e7 100644 (file)
@@ -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}\"" );