MediaWiki r35303 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r35302‎ | r35303 (on ViewVC)‎ | r35304 >
Date:00:31, 25 May 2008
Author:aaron
Status:old
Tags:
Comment:
Rename 'hiderevision' to 'suppressrevision'
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php	(revision 35302)
+++ trunk/phase3/includes/Article.php	(revision 35303)
@@ -2019,8 +2019,7 @@
 			$reason = $this->DeleteReason;
 		}
 		# Flag to hide all contents of the archived revisions
-		$suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('deleterevision') 
-			&& $wgUser->isAllowed('hiderevision');
+		$suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('suppressrevision');
 
 		# This code desperately needs to be totally rewritten
 
@@ -2171,7 +2170,7 @@
 		$wgOut->setRobotpolicy( 'noindex,nofollow' );
 		$wgOut->addWikiMsg( 'confirmdeletetext' );
 
-		if( $wgUser->isAllowed( 'deleterevision' ) && $wgUser->isAllowed( 'hiderevision' ) ) {
+		if( $wgUser->isAllowed( 'suppressrevision' ) ) {
 			$suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\"><td></td><td>";
 			$suppress .= Xml::checkLabel( wfMsg( 'revdelete-suppress' ), 'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '2' ) );
 			$suppress .= "</td></tr>";
Index: trunk/phase3/includes/SpecialRevisiondelete.php
===================================================================
--- trunk/phase3/includes/SpecialRevisiondelete.php	(revision 35302)
+++ trunk/phase3/includes/SpecialRevisiondelete.php	(revision 35303)
@@ -80,7 +80,7 @@
 			$oimage->load();
 			// Check if user is allowed to see this file
 			if( !$oimage->userCan(File::DELETED_FILE) ) {
-				$wgOut->permissionRequired( 'hiderevision' );
+				$wgOut->permissionRequired( 'suppressrevision' );
 			} else {
 				$this->showFile( $file );
 			}
@@ -134,7 +134,7 @@
 			$hide_content_name,
 			array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
 			array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER ) );
-		if( $wgUser->isAllowed('hiderevision') ) {
+		if( $wgUser->isAllowed('suppressrevision') ) {
 			$this->checks[] = array( 'revdelete-hide-restricted', 'wpHideRestricted', Revision::DELETED_RESTRICTED );
 		}
 	}
@@ -198,7 +198,7 @@
 				} else if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) {
 				// If a rev is hidden from sysops
 					if( $action != 'submit') {
-						$wgOut->permissionRequired( 'hiderevision' );
+						$wgOut->permissionRequired( 'suppressrevision' );
 						return;
 					}
 					$UserAllowed = false;
@@ -239,7 +239,7 @@
 				} else if( !$revObjs[$timestamp]->userCan(Revision::DELETED_RESTRICTED) ) {
 				// If a rev is hidden from sysops
 					if( $action != 'submit') {
-						$wgOut->permissionRequired( 'hiderevision' );
+						$wgOut->permissionRequired( 'suppressrevision' );
 						return;
 					}
 					$UserAllowed = false;
@@ -344,7 +344,7 @@
 				} else if( !$filesObjs[$archivename]->userCan(File::DELETED_RESTRICTED) ) {
 					// If a rev is hidden from sysops
 					if( $action != 'submit' ) {
-						$wgOut->permissionRequired( 'hiderevision' );
+						$wgOut->permissionRequired( 'suppressrevision' );
 						return;
 					}
 					$UserAllowed = false;
@@ -375,7 +375,7 @@
 				} else if( !$filesObjs[$fileid]->userCan(File::DELETED_RESTRICTED) ) {
 					// If a rev is hidden from sysops
 					if( $action != 'submit' ) {
-						$wgOut->permissionRequired( 'hiderevision' );
+						$wgOut->permissionRequired( 'suppressrevision' );
 						return;
 					}
 					$UserAllowed = false;
@@ -473,7 +473,7 @@
 			} else if( !LogEventsList::userCan( $logRows[$logid],Revision::DELETED_RESTRICTED) ) {
 			// If an event is hidden from sysops
 				if( $action != 'submit') {
-					$wgOut->permissionRequired( 'hiderevision' );
+					$wgOut->permissionRequired( 'suppressrevision' );
 					return;
 				}
 				$UserAllowed = false;
@@ -708,8 +708,8 @@
 		$bitfield = $this->extractBitfield( $request );
 		$comment = $request->getText( 'wpReason' );
 		# Can the user set this field?
-		if( $bitfield & Revision::DELETED_RESTRICTED && !$wgUser->isAllowed('hiderevision') ) {
-			$wgOut->permissionRequired( 'hiderevision' );
+		if( $bitfield & Revision::DELETED_RESTRICTED && !$wgUser->isAllowed('suppressrevision') ) {
+			$wgOut->permissionRequired( 'suppressrevision' );
 			return false;
 		}
 		# If the save went through, go to success message. Otherwise
@@ -844,7 +844,7 @@
 		// Where all revs allowed to be set?
 		if( !$userAllowedAll ) {
 			//FIXME: still might be confusing???
-			$wgOut->permissionRequired( 'hiderevision' );
+			$wgOut->permissionRequired( 'suppressrevision' );
 			return false;
 		}
 
@@ -914,7 +914,7 @@
 		}
 		// Where all revs allowed to be set?
 		if( !$userAllowedAll ) {
-			$wgOut->permissionRequired( 'hiderevision' );
+			$wgOut->permissionRequired( 'suppressrevision' );
 			return false;
 		}
 
@@ -1006,7 +1006,7 @@
 		}
 		// Where all revs allowed to be set?
 		if( !$userAllowedAll ) {
-			$wgOut->permissionRequired( 'hiderevision' );
+			$wgOut->permissionRequired( 'suppressrevision' );
 			return false;
 		}
 
@@ -1062,7 +1062,7 @@
 		}
 		// Where all revs allowed to be set?
 		if( !$userAllowedAll ) {
-			$wgOut->permissionRequired( 'hiderevision' );
+			$wgOut->permissionRequired( 'suppressrevision' );
 			return false;
 		}
 
@@ -1121,7 +1121,7 @@
 		}
 		// Were all revs allowed to be set?
 		if( !$userAllowedAll ) {
-			$wgOut->permissionRequired( 'hiderevision' );
+			$wgOut->permissionRequired( 'suppressrevision' );
 			return false;
 		}
 
Index: trunk/phase3/includes/filerepo/OldLocalFile.php
===================================================================
--- trunk/phase3/includes/filerepo/OldLocalFile.php	(revision 35302)
+++ trunk/phase3/includes/filerepo/OldLocalFile.php	(revision 35303)
@@ -166,7 +166,7 @@
 		if( isset($this->deleted) && ($this->deleted & $field) == $field ) {
 			global $wgUser;
 			$permission = ( $this->deleted & File::DELETED_RESTRICTED ) == File::DELETED_RESTRICTED
-				? 'hiderevision'
+				? 'suppressrevision'
 				: 'deleterevision';
 			wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" );
 			return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/filerepo/ArchivedFile.php
===================================================================
--- trunk/phase3/includes/filerepo/ArchivedFile.php	(revision 35302)
+++ trunk/phase3/includes/filerepo/ArchivedFile.php	(revision 35303)
@@ -333,7 +333,7 @@
 		if( ($this->deleted & $field) == $field ) {
 			global $wgUser;
 			$permission = ( $this->deleted & File::DELETED_RESTRICTED ) == File::DELETED_RESTRICTED
-				? 'hiderevision'
+				? 'suppressrevision'
 				: 'deleterevision';
 			wfDebug( "Checking for $permission due to $field match on $this->deleted\n" );
 			return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/LogEventsList.php
===================================================================
--- trunk/phase3/includes/LogEventsList.php	(revision 35302)
+++ trunk/phase3/includes/LogEventsList.php	(revision 35303)
@@ -338,7 +338,7 @@
 		if( ( $row->log_deleted & $field ) == $field ) {
 			global $wgUser;
 			$permission = ( $row->log_deleted & LogPage::DELETED_RESTRICTED ) == LogPage::DELETED_RESTRICTED
-				? 'hiderevision'
+				? 'suppressrevision'
 				: 'deleterevision';
 			wfDebug( "Checking for $permission due to $field match on $row->log_deleted\n" );
 			return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/Revision.php
===================================================================
--- trunk/phase3/includes/Revision.php	(revision 35302)
+++ trunk/phase3/includes/Revision.php	(revision 35303)
@@ -890,7 +890,7 @@
 		if( ( $this->mDeleted & $field ) == $field ) {
 			global $wgUser;
 			$permission = ( $this->mDeleted & self::DELETED_RESTRICTED ) == self::DELETED_RESTRICTED
-				? 'hiderevision'
+				? 'suppressrevision'
 				: 'deleterevision';
 			wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" );
 			return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/ChangesList.php
===================================================================
--- trunk/phase3/includes/ChangesList.php	(revision 35302)
+++ trunk/phase3/includes/ChangesList.php	(revision 35303)
@@ -288,7 +288,7 @@
 		if( ( $rc->mAttribs['rc_deleted'] & $field ) == $field ) {
 			global $wgUser;
 			$permission = ( $rc->mAttribs['rc_deleted'] & Revision::DELETED_RESTRICTED ) == Revision::DELETED_RESTRICTED
-				? 'hiderevision'
+				? 'suppressrevision'
 				: 'deleterevision';
 			wfDebug( "Checking for $permission due to $field match on $rc->mAttribs['rc_deleted']\n" );
 			return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/SpecialUndelete.php
===================================================================
--- trunk/phase3/includes/SpecialUndelete.php	(revision 35302)
+++ trunk/phase3/includes/SpecialUndelete.php	(revision 35303)
@@ -588,7 +588,7 @@
 		$this->mPreview = $request->getCheck( 'preview' ) && $posted;
 		$this->mDiff = $request->getCheck( 'diff' );
 		$this->mComment = $request->getText( 'wpComment' );
-		$this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $wgUser->isAllowed( 'hiderevision' );
+		$this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $wgUser->isAllowed( 'suppressrevision' );
 
 		if( $par != "" ) {
 			$this->mTarget = $par;
@@ -653,7 +653,7 @@
 			$file = new ArchivedFile( $this->mTargetObj, '', $this->mFile );
 			// Check if user is allowed to see this file
 			if( !$file->userCan( File::DELETED_FILE ) ) {
-				$wgOut->permissionRequired( 'hiderevision' );
+				$wgOut->permissionRequired( 'suppressrevision' );
 				return false;
 			} else {
 				return $this->showFile( $this->mFile );
@@ -967,13 +967,13 @@
 		if( $this->mAllowed && ( $haveRevisions || $haveFiles ) ) {
 			# Format the user-visible controls (comment field, submission button)
 			# in a nice little table
-			if( $wgUser->isAllowed( 'hiderevision' ) ) {
+			if( $wgUser->isAllowed( 'suppressrevision' ) ) {
 				$unsuppressBox =
 					"<tr>
 						<td>&nbsp;</td>
 						<td class='mw-input'>" .
 							Xml::checkLabel( wfMsg('revdelete-unsuppress'), 'wpUnsuppress',
-								'mw-undelete-unsupress', $this->mUnsuppress ).
+								'mw-undelete-unsuppress', $this->mUnsuppress ).
 						"</td>
 					</tr>";
 			} else {
Index: trunk/phase3/includes/FileDeleteForm.php
===================================================================
--- trunk/phase3/includes/FileDeleteForm.php	(revision 35302)
+++ trunk/phase3/includes/FileDeleteForm.php	(revision 35303)
@@ -45,8 +45,7 @@
 		$this->oldimage = $wgRequest->getText( 'oldimage', false );
 		$token = $wgRequest->getText( 'wpEditToken' );
 		# Flag to hide all contents of the archived revisions
-		$suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('deleterevision') 
-			&& $wgUser->isAllowed('hiderevision');
+		$suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('suppressrevision');
 
 		if( $this->oldimage && !self::isValidOldSpec($this->oldimage) ) {
 			$wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars( $this->oldimage ) );
@@ -127,7 +126,7 @@
 		global $wgOut, $wgUser, $wgRequest, $wgContLang;
 		$align = $wgContLang->isRtl() ? 'left' : 'right';
 
-		if( $wgUser->isAllowed( 'deleterevision' ) && $wgUser->isAllowed( 'hiderevision' ) ) {
+		if( $wgUser->isAllowed( 'suppressrevision' ) ) {
 			$suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\"><td></td><td>";
 			$suppress .= Xml::checkLabel( wfMsg( 'revdelete-suppress' ), 'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '2' ) );
 			$suppress .= "</td></tr>";

Follow-up revisions

Rev.Commit summaryAuthorDate
r35363* Core: Rename 'right-hiderevison' to 'right-suppressrevision' per change in ...raymond15:06, 26 May 2008

Status & tagging log

  • 15:27, 12 September 2011 Meno25 (Talk | contribs) changed the status of r35303 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox