Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -800,7 +800,7 @@ |
801 | 801 | } |
802 | 802 | } else { |
803 | 803 | //article doesn't exist or is deleted |
804 | | - if( $wgUser->isAllowed( 'deletedhistory' ) && $wgUser->isAllowed( 'undelete' ) ) { |
| 804 | + if( $wgUser->isAllowed( 'deletedhistory' ) && $wgUser->isAllowed( 'deletedcontent' ) ) { |
805 | 805 | if( $n = $this->mTitle->isDeleted() ) { |
806 | 806 | $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); |
807 | 807 | $content_actions['undelete'] = array( |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1353,6 +1353,7 @@ |
1354 | 1354 | $wgGroupPermissions['sysop']['delete'] = true; |
1355 | 1355 | $wgGroupPermissions['sysop']['bigdelete'] = true; // can be separately configured for pages with > $wgDeleteRevisionsLimit revs |
1356 | 1356 | $wgGroupPermissions['sysop']['deletedhistory'] = true; // can view deleted history entries, but not see or restore the text |
| 1357 | +$wgGroupPermissions['sysop']['deletedcontent'] = true; // can view deleted content |
1357 | 1358 | $wgGroupPermissions['sysop']['undelete'] = true; |
1358 | 1359 | $wgGroupPermissions['sysop']['editinterface'] = true; |
1359 | 1360 | $wgGroupPermissions['sysop']['editusercss'] = true; |
Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -552,7 +552,7 @@ |
553 | 553 | */ |
554 | 554 | class UndeleteForm { |
555 | 555 | var $mAction, $mTarget, $mTimestamp, $mRestore, $mInvert, $mTargetObj; |
556 | | - var $mTargetTimestamp, $mAllowed, $mComment, $mToken; |
| 556 | + var $mTargetTimestamp, $mAllowed, $mCanView, $mComment, $mToken; |
557 | 557 | |
558 | 558 | function UndeleteForm( $request, $par = "" ) { |
559 | 559 | global $wgUser; |
— | — | @@ -576,10 +576,15 @@ |
577 | 577 | if( $par != "" ) { |
578 | 578 | $this->mTarget = $par; |
579 | 579 | } |
580 | | - if ( $wgUser->isAllowed( 'undelete' ) && !$wgUser->isBlocked() ) { |
581 | | - $this->mAllowed = true; |
582 | | - } else { |
| 580 | + if ( $wgUser->isAllowed( 'deletedcontent' ) && $wgUser->isAllowed( 'undelete' ) && !$wgUser->isBlocked() ) { |
| 581 | + $this->mAllowed = true; // user can restore |
| 582 | + $this->mCanView = true; // user can view content |
| 583 | + } elseif ( $wgUser->isAllowed( 'deletedcontent' ) ) { |
| 584 | + $this->mAllowed = false; // user cannot restore |
| 585 | + $this->mCanView = true; // user can view content |
| 586 | + } else { // user can only view the list of revisions |
583 | 587 | $this->mAllowed = false; |
| 588 | + $this->mCanView = false; |
584 | 589 | $this->mTimestamp = ''; |
585 | 590 | $this->mRestore = false; |
586 | 591 | } |
— | — | @@ -1136,8 +1141,9 @@ |
1137 | 1142 | array( 'page' => $this->mTargetObj->getArticleId() ) ); |
1138 | 1143 | $stxt = ''; |
1139 | 1144 | $ts = wfTimestamp( TS_MW, $row->ar_timestamp ); |
| 1145 | + // Build checkboxen... |
1140 | 1146 | if( $this->mAllowed ) { |
1141 | | - if( $this->mInvert){ |
| 1147 | + if( $this->mInvert ) { |
1142 | 1148 | if( in_array( $ts, $this->mTargetTimestamp ) ) { |
1143 | 1149 | $checkBox = Xml::check( "ts$ts"); |
1144 | 1150 | } else { |
— | — | @@ -1146,12 +1152,18 @@ |
1147 | 1153 | } else { |
1148 | 1154 | $checkBox = Xml::check( "ts$ts" ); |
1149 | 1155 | } |
| 1156 | + } else { |
| 1157 | + $checkBox = ''; |
| 1158 | + } |
| 1159 | + // Build page & diff links... |
| 1160 | + if( $this->mCanView ) { |
1150 | 1161 | $titleObj = SpecialPage::getTitleFor( "Undelete" ); |
1151 | | - $pageLink = $this->getPageLink( $rev, $titleObj, $ts, $sk ); |
1152 | 1162 | # Last link |
1153 | 1163 | if( !$rev->userCan( Revision::DELETED_TEXT ) ) { |
| 1164 | + $pageLink = htmlspecialchars( $wgLang->timeanddate( $ts, true ) ); |
1154 | 1165 | $last = wfMsgHtml('diff'); |
1155 | 1166 | } else if( $remaining > 0 || ($earliestLiveTime && $ts > $earliestLiveTime) ) { |
| 1167 | + $pageLink = $this->getPageLink( $rev, $titleObj, $ts, $sk ); |
1156 | 1168 | $last = $sk->linkKnown( |
1157 | 1169 | $titleObj, |
1158 | 1170 | wfMsgHtml('diff'), |
— | — | @@ -1163,20 +1175,22 @@ |
1164 | 1176 | ) |
1165 | 1177 | ); |
1166 | 1178 | } else { |
| 1179 | + $pageLink = $this->getPageLink( $rev, $titleObj, $ts, $sk ); |
1167 | 1180 | $last = wfMsgHtml('diff'); |
1168 | 1181 | } |
1169 | 1182 | } else { |
1170 | | - $checkBox = ''; |
1171 | 1183 | $pageLink = htmlspecialchars( $wgLang->timeanddate( $ts, true ) ); |
1172 | 1184 | $last = wfMsgHtml('diff'); |
1173 | 1185 | } |
| 1186 | + // User links |
1174 | 1187 | $userLink = $sk->revUserTools( $rev ); |
1175 | | - |
1176 | | - if(!is_null($size = $row->ar_len)) { |
| 1188 | + // Revision text size |
| 1189 | + if( !is_null($size = $row->ar_len) ) { |
1177 | 1190 | $stxt = $sk->formatRevisionSize( $size ); |
1178 | 1191 | } |
| 1192 | + // Edit summary |
1179 | 1193 | $comment = $sk->revComment( $rev ); |
1180 | | - $revdlink = ''; |
| 1194 | + // Show/hide link |
1181 | 1195 | if( $wgUser->isAllowed( 'deleterevision' ) ) { |
1182 | 1196 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
1183 | 1197 | // If revision was hidden from sysops |
— | — | @@ -1190,8 +1204,9 @@ |
1191 | 1205 | ); |
1192 | 1206 | $revdlink = $sk->revDeleteLink( $query, $rev->isDeleted( Revision::DELETED_RESTRICTED ) ); |
1193 | 1207 | } |
| 1208 | + } else { |
| 1209 | + $revdlink = ''; |
1194 | 1210 | } |
1195 | | - |
1196 | 1211 | return "<li>$checkBox $revdlink ($last) $pageLink . . $userLink $stxt $comment</li>"; |
1197 | 1212 | } |
1198 | 1213 | |
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | $this->messages['undeleteviewlink'] |
147 | 147 | ); |
148 | 148 | |
149 | | - if( $wgUser->isAllowed('undelete') ) { |
| 149 | + if( $wgUser->isAllowed('deletedcontent') ) { |
150 | 150 | $last = $sk->linkKnown( |
151 | 151 | $undelete, |
152 | 152 | $this->messages['diff'], |