From: Roan Kattouw Date: Mon, 27 Oct 2008 12:16:47 +0000 (+0000) Subject: API: Also throw a warning when tokens for missing pages are denied X-Git-Tag: 1.31.0-rc.0~44565 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22config_fonctions%22%2C%20%22image_process=%24process%22%29%20.%20%22?a=commitdiff_plain;h=969761e440c1c1b6c86f60c1f8f988e6fe4a36cc;p=lhc%2Fweb%2Fwiklou.git API: Also throw a warning when tokens for missing pages are denied --- diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index e8b35633db..fbea988ba2 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -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; } }