r56062 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56061‎ | r56062 | r56063 >
Date:19:39, 8 September 2009
Author:werdna
Status:ok
Tags:
Comment:
Fixes for r55979
* Use getUserPermissionsErrors, which also handles blocking and so on.
* Also check with create action, which also checks for title protection and what-not.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1199,7 +1199,7 @@
12001200 * namespace, show the default message text. To be called from Article::view().
12011201 */
12021202 public function showMissingArticle() {
1203 - global $wgOut, $wgRequest;
 1203+ global $wgOut, $wgRequest, $wgUser;
12041204 # Show delete and move logs
12051205 $this->showLogs();
12061206
@@ -1213,7 +1213,11 @@
12141214 // Use the default message text
12151215 $text = $this->getContent();
12161216 } else {
1217 - if ( $this->mTitle->userCan( 'edit' ) )
 1217+ $createErrors = $this->mTitle->getUserPermissionsErrors( 'create', $wgUser );
 1218+ $editErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser );
 1219+ $errors = array_merge( $createErrors, $editErrors );
 1220+
 1221+ if ( !count($errors) )
12181222 $text = wfMsgNoTrans( 'noarticletext' );
12191223 else
12201224 $text = wfMsgNoTrans( 'noarticletext-nopermission' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55979New message noarticletext-nopermission that does not include misleading link ...churchofemacs16:21, 7 September 2009

Status & tagging log