Merge "mw.widgets.CategorySelector: Prevent duplicates"
[lhc/web/wiklou.git] / includes / api / ApiUndelete.php
index c23e9ff..469fe7f 100644 (file)
 class ApiUndelete extends ApiBase {
 
        public function execute() {
-               $params = $this->extractRequestParams();
+               $this->useTransactionalTimeLimit();
 
-               if ( !$this->getUser()->isAllowed( 'undelete' ) ) {
+               $params = $this->extractRequestParams();
+               $user = $this->getUser();
+               if ( !$user->isAllowed( 'undelete' ) ) {
                        $this->dieUsageMsg( 'permdenied-undelete' );
                }
 
-               if ( $this->getUser()->isBlocked() ) {
-                       $this->dieUsageMsg( 'blockedtext' );
+               if ( $user->isBlocked() ) {
+                       $this->dieBlocked( $user->getBlock() );
                }
 
                $titleObj = Title::newFromText( $params['title'] );