Index: trunk/phase3/includes/api/ApiOpenSearch.php |
— | — | @@ -42,15 +42,15 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | public function execute() { |
46 | | - global $wgEnableOpenSearchSuggest, $wgSearchSuggestCacheExpiry; |
| 46 | + global $wgEnableOpenSearchSuggest, $wgSearchSuggestCacheExpiry, $wgGroupPermissions, $wgUser; |
47 | 47 | $params = $this->extractRequestParams(); |
48 | 48 | $search = $params['search']; |
49 | 49 | $limit = $params['limit']; |
50 | 50 | $namespaces = $params['namespace']; |
51 | 51 | $suggest = $params['suggest']; |
52 | 52 | |
53 | | - // MWSuggest or similar hit |
54 | | - if ( $suggest && !$wgEnableOpenSearchSuggest ) |
| 53 | + // MWSuggest or similar hit, or hit without read rights |
| 54 | + if ( ( $suggest && !$wgEnableOpenSearchSuggest ) || ( !$wgGroupPermissions['*']['read'] && !$wgUser->isAllowed( 'read' ) ) ) |
55 | 55 | $srchres = array(); |
56 | 56 | else { |
57 | 57 | // Open search results may be stored for a very long |
— | — | @@ -108,4 +108,8 @@ |
109 | 109 | public function getVersion() { |
110 | 110 | return __CLASS__ . ': $Id$'; |
111 | 111 | } |
| 112 | + |
| 113 | + public function isReadMode() { |
| 114 | + return false; |
| 115 | + } |
112 | 116 | } |