* someone logs in who can be authenticated externally.
*/
class AuthPlugin {
+
+ /**
+ * @var string
+ */
+ protected $domain;
+
/**
* Check whether there exists a user account with the given name.
* The name will be normalized to MediaWiki's requirements, so
* Modify options in the login template.
*
* @param $template UserLoginTemplate object.
- * @param $type String 'signup' or 'login'.
+ * @param $type String 'signup' or 'login'. Added in 1.16.
*/
public function modifyUITemplate( &$template, &$type ) {
# Override this!
$this->domain = $domain;
}
+ /**
+ * Get the user's domain
+ *
+ * @return string
+ */
+ public function getDomain() {
+ if ( isset( $this->domain ) ) {
+ return $this->domain;
+ } else {
+ return 'invaliddomain';
+ }
+ }
+
/**
* Check to see if the specific domain is a valid domain.
*
* forget the & on your function declaration.
*
* @param $user User object
+ * @return bool
*/
public function updateUser( &$user ) {
# Override this and do something
/**
* If you want to munge the case of an account name before the final
* check, now is your chance.
+ * @param $username string
+ * @return string
*/
public function getCanonicalName( $username ) {
return $username;
public function getUserInstance( User &$user ) {
return new AuthPluginUser( $user );
}
+
+ /**
+ * Get a list of domains (in HTMLForm options format) used.
+ *
+ * @return array
+ */
+ public function domainList() {
+ return array();
+ }
}
class AuthPluginUser {