Merge "Allow patrol of uploads"
[lhc/web/wiklou.git] / includes / user / User.php
index c6d215d..b406bac 100644 (file)
@@ -895,7 +895,6 @@ class User implements IDBAccessObject {
                return $this->getPasswordValidity( $password ) === true;
        }
 
-
        /**
         * Given unvalidated password input, return error message on failure.
         *
@@ -3310,6 +3309,18 @@ class User implements IDBAccessObject {
                );
        }
 
+       /**
+        * Check whether to enable new files patrol features for this user
+        * @return bool True or false
+        */
+       public function useFilePatrol() {
+               global $wgUseRCPatrol, $wgUseFilePatrol;
+               return (
+                       ( $wgUseRCPatrol || $wgUseFilePatrol )
+                               && ( $this->isAllowedAny( 'patrol', 'patrolmarks' ) )
+               );
+       }
+
        /**
         * Get the WebRequest object to use with this object
         *
@@ -3324,17 +3335,6 @@ class User implements IDBAccessObject {
                }
        }
 
-       /**
-        * Get the current skin, loading it if required
-        * @return Skin The current skin
-        * @todo FIXME: Need to check the old failback system [AV]
-        * @deprecated since 1.18 Use ->getSkin() in the most relevant outputting context you have
-        */
-       public function getSkin() {
-               wfDeprecated( __METHOD__, '1.18' );
-               return RequestContext::getMain()->getSkin();
-       }
-
        /**
         * Get a WatchedItem for this user and $title.
         *
@@ -4115,19 +4115,6 @@ class User implements IDBAccessObject {
                }
        }
 
-       /**
-        * Alias for getEditToken.
-        * @deprecated since 1.19, use getEditToken instead.
-        *
-        * @param string|array $salt Array of Strings Optional function-specific data for hashing
-        * @param WebRequest|null $request WebRequest object to use or null to use $wgRequest
-        * @return string The new edit token
-        */
-       public function editToken( $salt = '', $request = null ) {
-               wfDeprecated( __METHOD__, '1.19' );
-               return $this->getEditToken( $salt, $request );
-       }
-
        /**
         * Internal implementation for self::getEditToken() and
         * self::matchEditToken().
@@ -4228,7 +4215,7 @@ class User implements IDBAccessObject {
                        $salt, $request ?: $this->getRequest(), $timestamp
                );
 
-               if ( $val != $sessionToken ) {
+               if ( !hash_equals( $sessionToken, $val ) ) {
                        wfDebug( "User::matchEditToken: broken session data\n" );
                }