Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -790,13 +790,10 @@ |
791 | 791 | $types = ($types === '') ? array() : (array)$types; |
792 | 792 | // Don't even show header for private logs; don't recognize it... |
793 | 793 | foreach ( $types as $type ) { |
794 | | - if( isset( $wgLogRestrictions[$type] ) |
795 | | - && !$wgUser->isAllowed($wgLogRestrictions[$type]) |
796 | | - ) { |
| 794 | + if( isset( $wgLogRestrictions[$type] ) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) { |
797 | 795 | $types = array_diff( $types, array( $type ) ); |
798 | 796 | } |
799 | 797 | } |
800 | | - $this->types = $types; |
801 | 798 | // Don't show private logs to unprivileged users. |
802 | 799 | // Also, only show them upon specific request to avoid suprises. |
803 | 800 | $audience = $types ? 'user' : 'public'; |
— | — | @@ -805,6 +802,7 @@ |
806 | 803 | $this->mConds[] = $hideLogs; |
807 | 804 | } |
808 | 805 | if( count($types) ) { |
| 806 | + $this->types = $types; |
809 | 807 | $this->mConds['log_type'] = $types; |
810 | 808 | // Set typeCGI; used in url param for paging |
811 | 809 | if( count($types) == 1 ) $this->typeCGI = $types[0]; |
— | — | @@ -892,25 +890,18 @@ |
893 | 891 | $tables = array( 'logging', 'user' ); |
894 | 892 | $this->mConds[] = 'user_id = log_user'; |
895 | 893 | $groupBy = false; |
896 | | - $index = array(); |
897 | 894 | # Add log_search table if there are conditions on it |
898 | 895 | if( array_key_exists('ls_field',$this->mConds) ) { |
899 | 896 | $tables[] = 'log_search'; |
900 | | - $index['log_search'] = 'ls_field_val'; |
901 | | - $index['logging'] = 'PRIMARY'; |
| 897 | + $index = array( 'log_search' => 'ls_field_val', 'logging' => 'PRIMARY' ); |
902 | 898 | $groupBy = 'ls_log_id'; |
903 | | - # Avoid usage of the wrong index by limiting |
904 | | - # the choices of available indexes. This mainly |
905 | | - # avoids site-breaking filesorts. |
| 899 | + # Don't use the wrong logging index |
906 | 900 | } else if( $this->title || $this->pattern || $this->user ) { |
907 | | - $index['logging'] = array( 'page_time', 'user_time' ); |
908 | | - if( count($this->types) == 1 ) { |
909 | | - $index['logging'][] = array( 'log_user_type_time' ); |
910 | | - } |
911 | | - } else if( count($this->types) == 1 ) { |
912 | | - $index['logging'] = 'type_time'; |
| 901 | + $index = array( 'logging' => array('page_time','user_time') ); |
| 902 | + } else if( $this->types ) { |
| 903 | + $index = array( 'logging' => 'type_time' ); |
913 | 904 | } else { |
914 | | - $index['logging'] = 'times'; |
| 905 | + $index = array( 'logging' => 'times' ); |
915 | 906 | } |
916 | 907 | $options = array( 'USE INDEX' => $index ); |
917 | 908 | # Don't show duplicate rows when using log_search |