* able to set their password to this.
*
* @param string $password Desired password
+ * @param string $purpose one of 'login', 'create', 'reset'
* @return Status
* @since 1.23
*/
- public function checkPasswordValidity( $password ) {
+ public function checkPasswordValidity( $password, $purpose = 'login' ) {
global $wgPasswordPolicy;
$upp = new UserPasswordPolicy(
}
if ( $result === false ) {
- $status->merge( $upp->checkUserPassword( $this, $password ) );
+ $status->merge( $upp->checkUserPassword( $this, $password, $purpose ) );
return $status;
} elseif ( $result === true ) {
return $status;
return true;
} elseif ( $wgAuth->strict() ) {
// Auth plugin doesn't allow local authentication
- wfDebugLog( 'AuthPluginStrict', "Authentication denied for {$this->getName()}" );
return false;
} elseif ( $wgAuth->strictUserAuth( $this->getName() ) ) {
// Auth plugin doesn't allow local authentication for this user name