[Mediawiki-l] AuthPlugin examples for Single Sign-on?

Platonides Platonides at gmail.com
Fri Aug 27 22:11:17 UTC 2010


Owen B. Mehegan wrote:
> I've taken this example and tried to adapt it to my code. But when I
> call the function I've created that uses it, I get:
> 
> Fatal error: Call to a member function ucfirst() on a non-object in
> /usr/share/mediawiki/includes/User.php on line 653
> 
> My attempts at debugging seem to indicate that this happens when I
> call:
> 
> $username = "TestUser";
> $u = User::newFromName($username);
> 
> I looked at User.php, this is the section in question:
> 
> 650        static function getCanonicalName( $name, $validate = 'valid'
> ) {
> 651                # Force usernames to capital
> 652                global $wgContLang;
> 653                $name = $wgContLang->ucfirst( $name );
> 
> I don't really know where to go from here...

You haven't initialised $wgContLang
Before calling User::newFromName you can do:
$wgContLang = Language::factory( 'en' );
(assuming the wiki language is English...)




More information about the MediaWiki-l mailing list