From ed21293445f970b9cab6f7cb5c95c6f7128ce6ef Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Tue, 20 Dec 2005 21:25:54 +0000 Subject: [PATCH] AutoAuthenticate hook for external User suppliers --- docs/hooks.txt | 3 +++ includes/Setup.php | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 1197f43862..8ebddc85e7 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -285,6 +285,9 @@ $isminor: minor flag $iswatch: watch flag $section: section # +'AutoAuthenticate': called to authenticate users on external/environmental means +$user: writes user object to this parameter + 'BlockIp': before an IP address or user is blocked $block: the Block object about to be saved $user: the user _doing_ the block (not the one being blocked) diff --git a/includes/Setup.php b/includes/Setup.php index c8bb810e96..c566226545 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -206,7 +206,11 @@ if( $wgCommandLineMode ) { # Prevent loading User settings from the DB. $wgUser->setLoaded( true ); } else { - $wgUser = User::loadFromSession(); + $wgUser = null; + wfRunHooks('AutoAuthenticate',array(&$wgUser)); + if ($wgUser === null) { + $wgUser = User::loadFromSession(); + } } wfProfileOut( $fname.'-User' ); -- 2.20.1