X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FExternalUser.php;h=d1eff91633f9f1014c0da9acae6220bd6c6a64df;hb=1c36af4fb08c8557cbb2f6488e2cce56d360cd8a;hp=94349c9ad5dba71ef37ea102d3d4068ccc186057;hpb=3a2d0c4ef9dbff33cbe90cf6aa771ca3e3ec4298;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ExternalUser.php b/includes/ExternalUser.php index 94349c9ad5..d1eff91633 100644 --- a/includes/ExternalUser.php +++ b/includes/ExternalUser.php @@ -1,21 +1,28 @@ initFromName( $name ) ) { return false; } @@ -60,8 +68,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; } @@ -69,17 +76,15 @@ abstract class ExternalUser { } /** - * @param $cookie string * @return mixed ExternalUser, or false on failure */ - public static function newFromCookie( $cookie ) { + public static function newFromCookie() { global $wgExternalAuthType; if ( is_null( $wgExternalAuthType ) ) { return false; } - $class = "ExternalUser_$wgExternalAuthType"; - $obj = new $class; - if ( !$obj->initFromCookie( $cookie ) ) { + $obj = new $wgExternalAuthType; + if ( !$obj->initFromCookie() ) { return false; } return $obj; @@ -134,18 +139,15 @@ abstract class ExternalUser { protected abstract function initFromId( $id ); /** - * Given the user's cookie, initialize this object to the correct user if - * the cookie indicates that the user is logged into the external database. - * If successful, return true. If the external database doesn't support - * cookie-based authentication, or if the cookies don't belong to a - * logged-in user, return false. + * Try to magically initialize the user from cookies or similar information + * so he or she can be logged in on just viewing the wiki. If this is + * impossible to do, just return false. * * TODO: Actually use this. * - * @param $cookie string * @return bool Success? */ - protected function initFromCookie( $cookie ) { + protected function initFromCookie() { return false; }