API: Also throw a warning when tokens for missing pages are denied
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 27 Oct 2008 12:16:47 +0000 (12:16 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 27 Oct 2008 12:16:47 +0000 (12:16 +0000)
includes/api/ApiQueryInfo.php

index e8b3563..fbea988 100644 (file)
@@ -480,7 +480,9 @@ class ApiQueryInfo extends ApiQueryBase {
                                        foreach($params['token'] as $t)
                                        {
                                                $val = call_user_func($tokenFunctions[$t], $pageid, $title);
-                                               if($val !== false)
+                                               if($val === false)
+                                                       $this->setWarning("Action '$t' is not allowed for the current user");
+                                               else
                                                        $res['query']['pages'][$pageid][$t . 'token'] = $val;
                                        }
                                }