Add user rights 'viewmywatchlist', 'editmywatchlist'
[lhc/web/wiklou.git] / includes / api / ApiQueryInfo.php
index 787057d..017684e 100644 (file)
@@ -353,6 +353,7 @@ class ApiQueryInfo extends ApiQueryBase {
                $dbkey = $title->getDBkey();
 
                $pageInfo['contentmodel'] = $title->getContentModel();
+               $pageInfo['pagelanguage'] = $title->getPageLanguage()->getCode();
 
                if ( $titleExists ) {
                        global $wgDisableCounters;
@@ -668,7 +669,9 @@ class ApiQueryInfo extends ApiQueryBase {
        private function getWatchedInfo() {
                $user = $this->getUser();
 
-               if ( $user->isAnon() || count( $this->everything ) == 0 ) {
+               if ( $user->isAnon() || count( $this->everything ) == 0
+                       || !$user->isAllowed( 'viewmywatchlist' )
+               ) {
                        return;
                }