From: Aryeh Gregor Date: Sun, 13 Dec 2009 20:45:10 +0000 (+0000) Subject: More convenient format for $wgExternalAuthType X-Git-Tag: 1.31.0-rc.0~38547 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=5702a0fe30bf675fe5a91f7579438abbb7bbc603;p=lhc%2Fweb%2Fwiklou.git More convenient format for $wgExternalAuthType Now is the whole class name, not a suffix. This allows you to do things like $wgExternalAuthType::someStaticMethod() instead of having to fiddle with temporary variables. This will obviously break anything that has $wgExternalAuthType already configured, so if that's anyone but me, make sure to fix your configs. This is still experimental. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ee0b959d40..c559897efa 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4148,8 +4148,8 @@ $wgPoolCounterConf = null; * be specified. * * null indicates no external authentication is to be used. Otherwise, - * "ExternalUser_$wgExternalAuthType" must be the name of a non-abstract class - * that extends ExternalUser. + * $wgExternalAuthType must be the name of a non-abstract class that extends + * ExternalUser. * * Core authentication modules can be found in includes/extauth/. */ diff --git a/includes/ExternalUser.php b/includes/ExternalUser.php index 94349c9ad5..09a8d97290 100644 --- a/includes/ExternalUser.php +++ b/includes/ExternalUser.php @@ -43,8 +43,7 @@ abstract class ExternalUser { if ( is_null( $wgExternalAuthType ) ) { return false; } - $class = "ExternalUser_$wgExternalAuthType"; - $obj = new $class; + $obj = new $wgExternalAuthType; if ( !$obj->initFromName( $name ) ) { return false; } @@ -60,8 +59,7 @@ abstract class ExternalUser { if ( is_null( $wgExternalAuthType ) ) { return false; } - $class = "ExternalUser_$wgExternalAuthType"; - $obj = new $class; + $obj = new $wgExternalAuthType; if ( !$obj->initFromId( $id ) ) { return false; } @@ -77,8 +75,7 @@ abstract class ExternalUser { if ( is_null( $wgExternalAuthType ) ) { return false; } - $class = "ExternalUser_$wgExternalAuthType"; - $obj = new $class; + $obj = new $wgExternalAuthType; if ( !$obj->initFromCookie( $cookie ) ) { return false; } diff --git a/includes/extauth/Hardcoded.php b/includes/extauth/Hardcoded.php index 4d63f9d17b..7330aa14bd 100644 --- a/includes/extauth/Hardcoded.php +++ b/includes/extauth/Hardcoded.php @@ -21,7 +21,7 @@ * This class supports external authentication from a literal array dumped in * LocalSettings.php. It's mostly useful for testing. Example configuration: * - * $wgExternalAuthType = 'Hardcoded'; + * $wgExternalAuthType = 'ExternalUser_Hardcoded'; * $wgExternalAuthConf = array( * 'Bob Smith' => array( * 'password' => 'literal string', diff --git a/includes/extauth/MediaWiki.php b/includes/extauth/MediaWiki.php index 14c8d93401..4b4553bd8b 100644 --- a/includes/extauth/MediaWiki.php +++ b/includes/extauth/MediaWiki.php @@ -21,7 +21,7 @@ * This class supports authentication against an external MediaWiki database, * probably any version back to 1.5 or something. Example configuration: * - * $wgExternalAuthType = 'MediaWiki'; + * $wgExternalAuthType = 'ExternalUser_MediaWiki'; * $wgExternalAuthConf = array( * 'DBtype' => 'mysql', * 'DBserver' => 'localhost', diff --git a/includes/extauth/vB.php b/includes/extauth/vB.php index 6f00874c89..81e5bb6c34 100644 --- a/includes/extauth/vB.php +++ b/includes/extauth/vB.php @@ -23,7 +23,7 @@ * code, only reads from the database. Example lines to put in * LocalSettings.php: * - * $wgExternalAuthType = 'vB'; + * $wgExternalAuthType = 'ExternalUser_vB'; * $wgExternalAuthConf = array( * 'server' => 'localhost', * 'username' => 'forum',