Redo WhatLinksHere query and add a *_from_namespace field to link tables
[lhc/web/wiklou.git] / includes / logging / LogEventsList.php
index fda9a20..c88af04 100644 (file)
@@ -68,25 +68,6 @@ class LogEventsList extends ContextSource {
                return $this->getTitle();
        }
 
-       /**
-        * Set page title and show header for this log type
-        * @param array $type
-        * @deprecated since 1.19
-        */
-       public function showHeader( $type ) {
-               wfDeprecated( __METHOD__, '1.19' );
-               // If only one log type is used, then show a special message...
-               $headerType = count( $type ) == 1 ? $type[0] : '';
-               $out = $this->getOutput();
-               if ( LogPage::isLogType( $headerType ) ) {
-                       $page = new LogPage( $headerType );
-                       $out->setPageTitle( $page->getName()->text() );
-                       $out->addHTML( $page->getDescription()->parseAsBlock() );
-               } else {
-                       $out->addHTML( $this->msg( 'alllogstext' )->parse() );
-               }
-       }
-
        /**
         * Show options for the log list
         *
@@ -456,20 +437,19 @@ class LogEventsList extends ContextSource {
         */
        public static function userCanBitfield( $bitfield, $field, User $user = null ) {
                if ( $bitfield & $field ) {
-                       if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
-                               $permission = 'suppressrevision';
-                       } else {
-                               $permission = 'deletedhistory';
-                       }
-                       wfDebug( "Checking for $permission due to $field match on $bitfield\n" );
                        if ( $user === null ) {
                                global $wgUser;
                                $user = $wgUser;
                        }
-
-                       return $user->isAllowed( $permission );
+                       if ( $bitfield & LogPage::DELETED_RESTRICTED ) {
+                               $permissions = array( 'suppressrevision', 'viewsuppressed' );
+                       } else {
+                               $permissions = array( 'deletedhistory' );
+                       }
+                       $permissionlist = implode( ', ', $permissions );
+                       wfDebug( "Checking for $permissionlist due to $field match on $bitfield\n" );
+                       return call_user_func_array( array( $user, 'isAllowedAny' ), $permissions );
                }
-
                return true;
        }