More convenient format for $wgExternalAuthType
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 13 Dec 2009 20:45:10 +0000 (20:45 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 13 Dec 2009 20:45:10 +0000 (20:45 +0000)
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.

includes/DefaultSettings.php
includes/ExternalUser.php
includes/extauth/Hardcoded.php
includes/extauth/MediaWiki.php
includes/extauth/vB.php

index ee0b959..c559897 100644 (file)
@@ -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/.
  */
index 94349c9..09a8d97 100644 (file)
@@ -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;
                }
index 4d63f9d..7330aa1 100644 (file)
@@ -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',
index 14c8d93..4b4553b 100644 (file)
@@ -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',
index 6f00874..81e5bb6 100644 (file)
@@ -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',