r93198 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93197‎ | r93198 | r93199 >
Date:16:10, 26 July 2011
Author:kipcool
Status:deferred
Tags:
Comment:
Prevent blocked users from editing Wikidata namespaces
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Wikidata.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/Wikidata.php
@@ -141,17 +141,21 @@
142142 * @return true if permission to edit, false if not
143143 **/
144144 public function edit() {
145 - global
146 - $wgOut, $wgRequest, $wgUser;
147 -
 145+ global $wgOut, $wgRequest, $wgUser;
 146+
148147 $wgOut->enableClientCache( false );
149148
 149+ if ( $wgUser->isBlockedFrom( $this->getTitle(), false ) ) {
 150+ $wgOut->blockedPage() ;
 151+ return false;
 152+ }
 153+
150154 $dc = wdGetDataSetContext();
151 - if ( !$wgUser->isAllowed( 'editwikidata-' . $dc ) ) {
152 - $wgOut->addWikiText( wfMsgSc( "noedit", $dc->fetchName() ) );
 155+ if ( !$wgUser->isAllowed( 'editwikidata-' . $dc ) ) {
 156+ $wgOut->addWikiText( wfMsgSc( "noedit", $dc->fetchName() ) );
153157 $wgOut->setPageTitle( wfMsgSc( "noedit_title" ) );
154 - return false;
155 - }
 158+ return false;
 159+ }
156160
157161 if ( $wgRequest->getText( 'save' ) != '' )
158162 $this->saveWithinTransaction();

Status & tagging log