X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FAuthPlugin.php;h=a3d083765f5694820c6c87f1107eef9c07308cce;hb=72f3df40d2ed32e8d7af94b958210aa57b1152d1;hp=1d95541853e48005b55bc2bb3f2517d155485c43;hpb=7e9ddc0e23a5497cc87495f2673728e2d574d5d6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AuthPlugin.php b/includes/AuthPlugin.php index 1d95541853..a3d083765f 100644 --- a/includes/AuthPlugin.php +++ b/includes/AuthPlugin.php @@ -1,6 +1,5 @@ # http://www.mediawiki.org/ @@ -33,7 +32,6 @@ * This interface is new, and might change a bit before 1.4.0 final is * done... * - * @package MediaWiki */ class AuthPlugin { /** @@ -146,13 +144,18 @@ class AuthPlugin { /** * Set the given password in the authentication database. + * As a special case, the password may be set to null to request + * locking the password to an unusable value, with the expectation + * that it will be set later through a mail reset or other method. + * * Return true if successful. * + * @param $user User object. * @param $password String: password. * @return bool * @public */ - function setPassword( $password ) { + function setPassword( $user, $password ) { return true; } @@ -182,12 +185,14 @@ class AuthPlugin { * Add a user to the external authentication database. * Return true if successful. * - * @param User $user + * @param User $user - only the name should be assumed valid at this point * @param string $password + * @param string $email + * @param string $realname * @return bool * @public */ - function addUser( $user, $password ) { + function addUser( $user, $password, $email='', $realname='' ) { return true; } @@ -205,6 +210,18 @@ class AuthPlugin { return false; } + /** + * Check if a user should authenticate locally if the global authentication fails. + * If either this or strict() returns true, local authentication is not used. + * + * @param $username String: username. + * @return bool + * @public + */ + function strictUserAuth( $username ) { + return false; + } + /** * When creating a user account, optionally fill in preferences and such. * For instance, you might pull the email address or real name from the @@ -214,9 +231,10 @@ class AuthPlugin { * forget the & on your function declaration. * * @param $user User object. + * @param $autocreate bool True if user is being autocreated on login * @public */ - function initUser( &$user ) { + function initUser( $user, $autocreate=false ) { # Override this to do something. } @@ -229,4 +247,4 @@ class AuthPlugin { } } -?> +