User::edits() was removed
[lhc/web/wiklou.git] / includes / user / User.php
index 789c55c..df9dd3e 100644 (file)
@@ -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.
         *
@@ -1649,7 +1634,7 @@ class User implements IDBAccessObject {
                                        // If the block is not valid, clear the block cookie (but don't delete it,
                                        // because it needs to be cleared from LocalStorage as well and an empty string
                                        // value is checked for in the mediawiki.user.blockcookie module).
-                                       $block->setCookie( $this->getRequest()->response(), true );
+                                       $tmpBlock->setCookie( $this->getRequest()->response(), true );
                                }
                        }
                }
@@ -5066,13 +5051,27 @@ class User implements IDBAccessObject {
        /**
         * Get the description of a given right
         *
+        * @since 1.29
         * @param string $right Right to query
         * @return string Localized description of the right
         */
        public static function getRightDescription( $right ) {
                $key = "right-$right";
                $msg = wfMessage( $key );
-               return $msg->isBlank() ? $right : $msg->text();
+               return $msg->isDisabled() ? $right : $msg->text();
+       }
+
+       /**
+        * Get the name of a given grant
+        *
+        * @since 1.29
+        * @param string $grant Grant to query
+        * @return string Localized name of the grant
+        */
+       public static function getGrantName( $grant ) {
+               $key = "grant-$grant";
+               $msg = wfMessage( $key );
+               return $msg->isDisabled() ? $grant : $msg->text();
        }
 
        /**