# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html
+/**
+ * @defgroup ExternalUser ExternalUser
+ */
+
/**
* A class intended to supplement, and perhaps eventually replace, AuthPlugin.
* See: http://www.mediawiki.org/wiki/ExternalAuth
* assumed to at least support the concept of a user id (possibly not an
* integer), a user name (possibly not meeting MediaWiki's username
* requirements), and a password.
+ *
+ * @ingroup ExternalUser
*/
abstract class ExternalUser {
protected function __construct() {}
}
/**
- * @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;
}
$obj = new $wgExternalAuthType;
- if ( !$obj->initFromCookie( $cookie ) ) {
+ if ( !$obj->initFromCookie() ) {
return false;
}
return $obj;
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;
}