Brion Vibber wrote:
John Straffin wrote:
Error: Fatal error: Call to a member function on a non-object in /var/www/html/internal/wiki/includes/Title.php on line 1196
Begin Code: (Note: $_SERVER["REMOTE_USER"] = jcstraff) (in modified User.php) $name = $_SERVER["REMOTE_USER"]; $u = User::newFromName( $name );
[snip]
$t = $wgContLang->ucfirst( $r ); # # # # # # <== LINE 1196
[snip]
Is this mysterious contextless modified User.php code being run before $wgLang and $wgContLang are initialized?
Sorry (re: "contextless"). This is still me trying to get the user identified by $_SERVER["REMOTE_USER"] auto-logged in. The code previously posted by David Cameron on 18 Feb works to do this providing that I do the following:
(1) Comment out the five Title.php lines that relate to line 1196 (2) Comment out the Cookie testing code in User::loadFromSession (3) Comment out the UserUpdate() and $wgDeferredUpdateList line from David's code (apparently legacy code from 1.3.x, I'm using 1.4.x)
With those three changes, MediaWiki successfully logs me in automatically. Ideally, however, I'd like to not have to comment out the Title.php lines and the cookie code, but I'm kinda stuck. It appears that (as you suppose above) the User.php code is being run before $wgLang and $wgContLang are initialized. Is there any way I can juggle this around so as to have these objects initialized (perhaps initializing them in my code block?)
**OR**, conversely, can anyone give a quick "howto" on AuthPlugin.php? Now that I've peeked at it, it appears to be what I should really be using...
- John