Index: trunk/extensions/Nuke/Nuke_body.php |
— | — | @@ -7,14 +7,18 @@ |
8 | 8 | } |
9 | 9 | |
10 | 10 | public function execute( $par ) { |
11 | | - if( !$this->userCanExecute( $this->getUser() ) ) { |
| 11 | + if ( !$this->userCanExecute( $this->getUser() ) ) { |
12 | 12 | $this->displayRestrictionError(); |
13 | | - return; |
14 | 13 | } |
15 | | - |
16 | 14 | $this->setHeaders(); |
17 | 15 | $this->outputHeader(); |
18 | 16 | |
| 17 | + if ( $this->getUser()->isBlocked() ) { |
| 18 | + $block = $this->getUser()->getBlock(); |
| 19 | + throw new UserBlockedError( $block ); |
| 20 | + } |
| 21 | + $this->checkReadOnly(); |
| 22 | + |
19 | 23 | $req = $this->getRequest(); |
20 | 24 | |
21 | 25 | $target = trim( $req->getText( 'target', $par ) ); |
— | — | @@ -286,6 +290,12 @@ |
287 | 291 | $title = Title::newFromURL( $page ); |
288 | 292 | $file = $title->getNamespace() == NS_FILE ? wfLocalFile( $title ) : false; |
289 | 293 | |
| 294 | + $permission_errors = $title->getUserPermissionsErrors( 'delete', $this->getUser()); |
| 295 | + |
| 296 | + if ( count( $permission_errors )) { |
| 297 | + throw new PermissionsError( 'delete', $permission_errors ); |
| 298 | + } |
| 299 | + |
290 | 300 | if ( $file ) { |
291 | 301 | $oldimage = null; // Must be passed by reference |
292 | 302 | $ok = FileDeleteForm::doDelete( $title, $file, $oldimage, $reason, false )->isOK(); |