r25374 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25373‎ | r25374 | r25375 >
Date:19:44, 31 August 2007
Author:aaron
Status:old
Tags:
Comment:
*Don't show the whole edit form if they are not allowed to create pages. Display permission error. (bug 11140)
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -319,6 +319,8 @@
320320 }
321321
322322 $permErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser);
 323+ if( !$this->mTitle->exists() )
 324+ $permErrors += $this->mTitle->getUserPermissionsErrors( 'create', $wgUser);
323325
324326 # Ignore some permissions errors.
325327 $remove = array();
@@ -342,7 +344,7 @@
343345 # array_diff returns elements in $permErrors that are not in $remove.
344346 $permErrors = array_diff( $permErrors, $remove );
345347
346 - if ($permErrors != array())
 348+ if ( !empty($permErrors) )
347349 {
348350 wfDebug( "$fname: User can't edit\n" );
349351 $wgOut->readOnlyPage( $this->getContent(), true, $permErrors );

Follow-up revisions

RevisionCommit summaryAuthorDate
r25415Merged revisions 25372-25414 via svnmerge from...david21:15, 2 September 2007

Status & tagging log