API: Big change: Removed all userCanRead() checks per IRC discussion. Only rvprop...
[lhc/web/wiklou.git] / includes / api / ApiQueryAllLinks.php
index a7803b0..a9a27ff 100644 (file)
@@ -29,7 +29,7 @@ if (!defined('MEDIAWIKI')) {
 }
 
 /**
- * Query module to enumerate all available pages.
+ * Query module to enumerate links from all pages together.
  * 
  * @addtogroup API
  */
@@ -51,7 +51,6 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
 
                $db = $this->getDB();
                $params = $this->extractRequestParams();
-               $this->debugPrint($params);
 
                $prop = array_flip($params['prop']);
                $fld_ids = isset($prop['ids']);
@@ -102,17 +101,15 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                        }
 
                        if (is_null($resultPageSet)) {
-                               $title = Title :: makeTitle($row->pl_namespace, $row->pl_title);
-                               if ($title->userCanRead()) {
-                                       $vals = array();
-                                       if ($fld_ids)
-                                               $vals['fromid'] = intval($row->pl_from);
-                                       if ($fld_title) {
-                                               $vals['ns'] = intval($title->getNamespace());
-                                               $vals['title'] = $title->getPrefixedText();
-                                       }
-                                       $data[] = $vals;
+                               $vals = array();
+                               if ($fld_ids)
+                                       $vals['fromid'] = intval($row->pl_from);
+                               if ($fld_title) {
+                                       $title = Title :: makeTitle($row->pl_namespace, $row->pl_title);
+                                       $vals['ns'] = intval($title->getNamespace());
+                                       $vals['title'] = $title->getPrefixedText();
                                }
+                               $data[] = $vals;
                        } else {
                                $pageids[] = $row->pl_from;
                        }
@@ -160,13 +157,14 @@ class ApiQueryAllLinks extends ApiQueryGeneratorBase {
                        'from' => 'The page title to start enumerating from.',
                        'prefix' => 'Search for all page titles that begin with this value.',
                        'unique' => 'Only show unique links. Cannot be used with generator or prop=ids',
+                       'prop' => 'What pieces of information to include',
                        'namespace' => 'The namespace to enumerate.',
                        'limit' => 'How many total links to return.'
                );
        }
 
        protected function getDescription() {
-               return 'Enumerate all pages sequentially in a given namespace';
+               return 'Enumerate all links that point to a given namespace';
        }
 
        protected function getExamples() {