r114284 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114283‎ | r114284 | r114285 >
Date:17:23, 20 March 2012
Author:yaron
Status:deferred
Tags:
Comment:
Added handling for $wgReadOnly and $wgReadOnlyFile - fix for bug 35286
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -397,6 +397,12 @@
398398 if ( !$is_query ) {
399399 // $userCanEditPage = ( $wgUser->isAllowed( 'edit' ) && $this->mPageTitle->userCan( 'edit' ) );
400400 $permissionErrors = $this->mPageTitle->getUserPermissionsErrors( 'edit', $wgUser );
 401+ // The handling of $wgReadOnly and $wgReadOnlyFile
 402+ // has to be done separately.
 403+ if ( wfReadOnly() ) {
 404+ global $wgReadOnly;
 405+ $permissionErrors = array( array( 'readonlytext', array ( wfReadOnlyReason() ) ) );
 406+ }
401407 $userCanEditPage = count( $permissionErrors ) == 0;
402408 wfRunHooks( 'sfUserCanEditPage', array( $this->mPageTitle, &$userCanEditPage ) );
403409 }

Status & tagging log