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
@@ -2019,8 +2019,7 @@
20202020 $reason = $this->DeleteReason;
20212021 }
20222022 # Flag to hide all contents of the archived revisions
2023 - $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('deleterevision')
2024 - && $wgUser->isAllowed('hiderevision');
 2023+ $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('suppressrevision');
20252024
20262025 # This code desperately needs to be totally rewritten
20272026
@@ -2171,7 +2170,7 @@
21722171 $wgOut->setRobotpolicy( 'noindex,nofollow' );
21732172 $wgOut->addWikiMsg( 'confirmdeletetext' );
21742173
2175 - if( $wgUser->isAllowed( 'deleterevision' ) && $wgUser->isAllowed( 'hiderevision' ) ) {
 2174+ if( $wgUser->isAllowed( 'suppressrevision' ) ) {
21762175 $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\"><td></td><td>";
21772176 $suppress .= Xml::checkLabel( wfMsg( 'revdelete-suppress' ), 'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '2' ) );
21782177 $suppress .= "</td></tr>";
Index: trunk/phase3/includes/SpecialRevisiondelete.php
@@ -80,7 +80,7 @@
8181 $oimage->load();
8282 // Check if user is allowed to see this file
8383 if( !$oimage->userCan(File::DELETED_FILE) ) {
84 - $wgOut->permissionRequired( 'hiderevision' );
 84+ $wgOut->permissionRequired( 'suppressrevision' );
8585 } else {
8686 $this->showFile( $file );
8787 }
@@ -134,7 +134,7 @@
135135 $hide_content_name,
136136 array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
137137 array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER ) );
138 - if( $wgUser->isAllowed('hiderevision') ) {
 138+ if( $wgUser->isAllowed('suppressrevision') ) {
139139 $this->checks[] = array( 'revdelete-hide-restricted', 'wpHideRestricted', Revision::DELETED_RESTRICTED );
140140 }
141141 }
@@ -198,7 +198,7 @@
199199 } else if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) {
200200 // If a rev is hidden from sysops
201201 if( $action != 'submit') {
202 - $wgOut->permissionRequired( 'hiderevision' );
 202+ $wgOut->permissionRequired( 'suppressrevision' );
203203 return;
204204 }
205205 $UserAllowed = false;
@@ -239,7 +239,7 @@
240240 } else if( !$revObjs[$timestamp]->userCan(Revision::DELETED_RESTRICTED) ) {
241241 // If a rev is hidden from sysops
242242 if( $action != 'submit') {
243 - $wgOut->permissionRequired( 'hiderevision' );
 243+ $wgOut->permissionRequired( 'suppressrevision' );
244244 return;
245245 }
246246 $UserAllowed = false;
@@ -344,7 +344,7 @@
345345 } else if( !$filesObjs[$archivename]->userCan(File::DELETED_RESTRICTED) ) {
346346 // If a rev is hidden from sysops
347347 if( $action != 'submit' ) {
348 - $wgOut->permissionRequired( 'hiderevision' );
 348+ $wgOut->permissionRequired( 'suppressrevision' );
349349 return;
350350 }
351351 $UserAllowed = false;
@@ -375,7 +375,7 @@
376376 } else if( !$filesObjs[$fileid]->userCan(File::DELETED_RESTRICTED) ) {
377377 // If a rev is hidden from sysops
378378 if( $action != 'submit' ) {
379 - $wgOut->permissionRequired( 'hiderevision' );
 379+ $wgOut->permissionRequired( 'suppressrevision' );
380380 return;
381381 }
382382 $UserAllowed = false;
@@ -473,7 +473,7 @@
474474 } else if( !LogEventsList::userCan( $logRows[$logid],Revision::DELETED_RESTRICTED) ) {
475475 // If an event is hidden from sysops
476476 if( $action != 'submit') {
477 - $wgOut->permissionRequired( 'hiderevision' );
 477+ $wgOut->permissionRequired( 'suppressrevision' );
478478 return;
479479 }
480480 $UserAllowed = false;
@@ -708,8 +708,8 @@
709709 $bitfield = $this->extractBitfield( $request );
710710 $comment = $request->getText( 'wpReason' );
711711 # Can the user set this field?
712 - if( $bitfield & Revision::DELETED_RESTRICTED && !$wgUser->isAllowed('hiderevision') ) {
713 - $wgOut->permissionRequired( 'hiderevision' );
 712+ if( $bitfield & Revision::DELETED_RESTRICTED && !$wgUser->isAllowed('suppressrevision') ) {
 713+ $wgOut->permissionRequired( 'suppressrevision' );
714714 return false;
715715 }
716716 # If the save went through, go to success message. Otherwise
@@ -844,7 +844,7 @@
845845 // Where all revs allowed to be set?
846846 if( !$userAllowedAll ) {
847847 //FIXME: still might be confusing???
848 - $wgOut->permissionRequired( 'hiderevision' );
 848+ $wgOut->permissionRequired( 'suppressrevision' );
849849 return false;
850850 }
851851
@@ -914,7 +914,7 @@
915915 }
916916 // Where all revs allowed to be set?
917917 if( !$userAllowedAll ) {
918 - $wgOut->permissionRequired( 'hiderevision' );
 918+ $wgOut->permissionRequired( 'suppressrevision' );
919919 return false;
920920 }
921921
@@ -1006,7 +1006,7 @@
10071007 }
10081008 // Where all revs allowed to be set?
10091009 if( !$userAllowedAll ) {
1010 - $wgOut->permissionRequired( 'hiderevision' );
 1010+ $wgOut->permissionRequired( 'suppressrevision' );
10111011 return false;
10121012 }
10131013
@@ -1062,7 +1062,7 @@
10631063 }
10641064 // Where all revs allowed to be set?
10651065 if( !$userAllowedAll ) {
1066 - $wgOut->permissionRequired( 'hiderevision' );
 1066+ $wgOut->permissionRequired( 'suppressrevision' );
10671067 return false;
10681068 }
10691069
@@ -1121,7 +1121,7 @@
11221122 }
11231123 // Were all revs allowed to be set?
11241124 if( !$userAllowedAll ) {
1125 - $wgOut->permissionRequired( 'hiderevision' );
 1125+ $wgOut->permissionRequired( 'suppressrevision' );
11261126 return false;
11271127 }
11281128
Index: trunk/phase3/includes/filerepo/OldLocalFile.php
@@ -166,7 +166,7 @@
167167 if( isset($this->deleted) && ($this->deleted & $field) == $field ) {
168168 global $wgUser;
169169 $permission = ( $this->deleted & File::DELETED_RESTRICTED ) == File::DELETED_RESTRICTED
170 - ? 'hiderevision'
 170+ ? 'suppressrevision'
171171 : 'deleterevision';
172172 wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" );
173173 return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/filerepo/ArchivedFile.php
@@ -333,7 +333,7 @@
334334 if( ($this->deleted & $field) == $field ) {
335335 global $wgUser;
336336 $permission = ( $this->deleted & File::DELETED_RESTRICTED ) == File::DELETED_RESTRICTED
337 - ? 'hiderevision'
 337+ ? 'suppressrevision'
338338 : 'deleterevision';
339339 wfDebug( "Checking for $permission due to $field match on $this->deleted\n" );
340340 return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/LogEventsList.php
@@ -338,7 +338,7 @@
339339 if( ( $row->log_deleted & $field ) == $field ) {
340340 global $wgUser;
341341 $permission = ( $row->log_deleted & LogPage::DELETED_RESTRICTED ) == LogPage::DELETED_RESTRICTED
342 - ? 'hiderevision'
 342+ ? 'suppressrevision'
343343 : 'deleterevision';
344344 wfDebug( "Checking for $permission due to $field match on $row->log_deleted\n" );
345345 return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/Revision.php
@@ -890,7 +890,7 @@
891891 if( ( $this->mDeleted & $field ) == $field ) {
892892 global $wgUser;
893893 $permission = ( $this->mDeleted & self::DELETED_RESTRICTED ) == self::DELETED_RESTRICTED
894 - ? 'hiderevision'
 894+ ? 'suppressrevision'
895895 : 'deleterevision';
896896 wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" );
897897 return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/ChangesList.php
@@ -288,7 +288,7 @@
289289 if( ( $rc->mAttribs['rc_deleted'] & $field ) == $field ) {
290290 global $wgUser;
291291 $permission = ( $rc->mAttribs['rc_deleted'] & Revision::DELETED_RESTRICTED ) == Revision::DELETED_RESTRICTED
292 - ? 'hiderevision'
 292+ ? 'suppressrevision'
293293 : 'deleterevision';
294294 wfDebug( "Checking for $permission due to $field match on $rc->mAttribs['rc_deleted']\n" );
295295 return $wgUser->isAllowed( $permission );
Index: trunk/phase3/includes/SpecialUndelete.php
@@ -588,7 +588,7 @@
589589 $this->mPreview = $request->getCheck( 'preview' ) && $posted;
590590 $this->mDiff = $request->getCheck( 'diff' );
591591 $this->mComment = $request->getText( 'wpComment' );
592 - $this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $wgUser->isAllowed( 'hiderevision' );
 592+ $this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $wgUser->isAllowed( 'suppressrevision' );
593593
594594 if( $par != "" ) {
595595 $this->mTarget = $par;
@@ -653,7 +653,7 @@
654654 $file = new ArchivedFile( $this->mTargetObj, '', $this->mFile );
655655 // Check if user is allowed to see this file
656656 if( !$file->userCan( File::DELETED_FILE ) ) {
657 - $wgOut->permissionRequired( 'hiderevision' );
 657+ $wgOut->permissionRequired( 'suppressrevision' );
658658 return false;
659659 } else {
660660 return $this->showFile( $this->mFile );
@@ -967,13 +967,13 @@
968968 if( $this->mAllowed && ( $haveRevisions || $haveFiles ) ) {
969969 # Format the user-visible controls (comment field, submission button)
970970 # in a nice little table
971 - if( $wgUser->isAllowed( 'hiderevision' ) ) {
 971+ if( $wgUser->isAllowed( 'suppressrevision' ) ) {
972972 $unsuppressBox =
973973 "<tr>
974974 <td>&nbsp;</td>
975975 <td class='mw-input'>" .
976976 Xml::checkLabel( wfMsg('revdelete-unsuppress'), 'wpUnsuppress',
977 - 'mw-undelete-unsupress', $this->mUnsuppress ).
 977+ 'mw-undelete-unsuppress', $this->mUnsuppress ).
978978 "</td>
979979 </tr>";
980980 } else {
Index: trunk/phase3/includes/FileDeleteForm.php
@@ -45,8 +45,7 @@
4646 $this->oldimage = $wgRequest->getText( 'oldimage', false );
4747 $token = $wgRequest->getText( 'wpEditToken' );
4848 # Flag to hide all contents of the archived revisions
49 - $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('deleterevision')
50 - && $wgUser->isAllowed('hiderevision');
 49+ $suppress = $wgRequest->getVal( 'wpSuppress' ) && $wgUser->isAllowed('suppressrevision');
5150
5251 if( $this->oldimage && !self::isValidOldSpec($this->oldimage) ) {
5352 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars( $this->oldimage ) );
@@ -127,7 +126,7 @@
128127 global $wgOut, $wgUser, $wgRequest, $wgContLang;
129128 $align = $wgContLang->isRtl() ? 'left' : 'right';
130129
131 - if( $wgUser->isAllowed( 'deleterevision' ) && $wgUser->isAllowed( 'hiderevision' ) ) {
 130+ if( $wgUser->isAllowed( 'suppressrevision' ) ) {
132131 $suppress = "<tr id=\"wpDeleteSuppressRow\" name=\"wpDeleteSuppressRow\"><td></td><td>";
133132 $suppress .= Xml::checkLabel( wfMsg( 'revdelete-suppress' ), 'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '2' ) );
134133 $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]