X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fuser%2FUser.php;h=f1742b321d6e5d1d1e746623399631d95af3dc2c;hb=2b7d97e6a49c46eeb0e1018dd51ae5e79b2f373e;hp=f07db0e1b7908e302585b73e30ada8987b71a0d9;hpb=c253b03fe5799331d34f390d426bd58d20fc50d6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/User.php b/includes/user/User.php index f07db0e1b7..f1742b321d 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -677,7 +677,7 @@ class User implements IDBAccessObject { ); if ( !$row ) { // No user. Create it? - return $options['create'] ? self::createNew( $name ) : null; + return $options['create'] ? self::createNew( $name, [ 'token' => self::INVALID_TOKEN ] ) : null; } $user = self::newFromRow( $row ); @@ -1003,11 +1003,10 @@ class User implements IDBAccessObject { * 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, $purpose = 'login' ) { + public function checkPasswordValidity( $password ) { global $wgPasswordPolicy; $upp = new UserPasswordPolicy( @@ -1024,7 +1023,7 @@ class User implements IDBAccessObject { } if ( $result === false ) { - $status->merge( $upp->checkUserPassword( $this, $password, $purpose ) ); + $status->merge( $upp->checkUserPassword( $this, $password ) ); return $status; } elseif ( $result === true ) { return $status; @@ -1098,20 +1097,6 @@ class User implements IDBAccessObject { return $name; } - /** - * Count the number of edits of a user - * - * @param int $uid User ID to check - * @return int The user's edit count - * - * @deprecated since 1.21 in favour of User::getEditCount - */ - public static function edits( $uid ) { - wfDeprecated( __METHOD__, '1.21' ); - $user = self::newFromId( $uid ); - return $user->getEditCount(); - } - /** * Return a random password. * @@ -2806,7 +2791,7 @@ class User implements IDBAccessObject { * @param string $oname The option to check * @param string $defaultOverride A default value returned if the option does not exist * @param bool $ignoreHidden Whether to ignore the effects of $wgHiddenPrefs - * @return string User's current value for the option + * @return string|null User's current value for the option * @see getBoolOption() * @see getIntOption() */