Manual talk:Hooks/UserLoadFromSession

Sample Code
Paul Lustgarten 16:10 2 April 2009 (UTC) Found this sample code very helpful - thanks! Posted some notes on it below, in Sample Code Notes.

And 15:01, 3 February 2009 (UTC) WARNING - there's a problem with user admin rights using this code - bug 17339 submitted and this page will be updated when it's fixed.

And 16:21, 21 January 2009 (UTC) I had some problems getting this to work and would have appreciated a sample, so now that I've done it, here's a bowdlerised version of my code.

Sample Code Notes
Hoping to extend the utility of the sample code graciously contributed above, here are some comments derived from my recent implementation of a similar extension, integrating MediaWiki into my corporation's internal global authentication and single sign-on infrastructure.

Redirects: My PHP installation does not include the (apparently optional extension) for http_redirect. So, instead of the call to that function given above: I tracked down the MediaWiki's own internal functions for HTTP redirects. Using that instead, the above code would look something like the following: