Merge "SpecialLockdb and SpecialUnlockdb don't do database writes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 7 May 2016 23:57:20 +0000 (23:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 7 May 2016 23:57:20 +0000 (23:57 +0000)
1  2 
includes/specials/SpecialLockdb.php
includes/specials/SpecialUnlockdb.php

@@@ -34,7 -34,7 +34,7 @@@ class SpecialLockdb extends FormSpecial
        }
  
        public function doesWrites() {
-               return true;
+               return false;
        }
  
        public function requiresWrite() {
@@@ -47,9 -47,6 +47,9 @@@
                if ( !is_writable( dirname( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) ) {
                        throw new ErrorPageError( 'lockdb', 'lockfilenotwritable' );
                }
 +              if ( file_exists( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) {
 +                      throw new ErrorPageError( 'lockdb', 'databaselocked' );
 +              }
        }
  
        protected function getFormFields() {
@@@ -68,9 -65,9 +68,9 @@@
        }
  
        protected function alterForm( HTMLForm $form ) {
 -              $form->setWrapperLegend( false );
 -              $form->setHeaderText( $this->msg( 'lockdbtext' )->parseAsBlock() );
 -              $form->setSubmitTextMsg( 'lockbtn' );
 +              $form->setWrapperLegend( false )
 +                      ->setHeaderText( $this->msg( 'lockdbtext' )->parseAsBlock() )
 +                      ->setSubmitTextMsg( 'lockbtn' );
        }
  
        public function onSubmit( array $data ) {
                $out->addWikiMsg( 'lockdbsuccesstext' );
        }
  
 +      protected function getDisplayFormat() {
 +              return 'ooui';
 +      }
 +
        protected function getGroupName() {
                return 'wiki';
        }
@@@ -33,7 -33,7 +33,7 @@@ class SpecialUnlockdb extends FormSpeci
        }
  
        public function doesWrites() {
-               return true;
+               return false;
        }
  
        public function requiresWrite() {
@@@ -58,9 -58,9 +58,9 @@@
        }
  
        protected function alterForm( HTMLForm $form ) {
 -              $form->setWrapperLegend( false );
 -              $form->setHeaderText( $this->msg( 'unlockdbtext' )->parseAsBlock() );
 -              $form->setSubmitTextMsg( 'unlockbtn' );
 +              $form->setWrapperLegend( false )
 +                      ->setHeaderText( $this->msg( 'unlockdbtext' )->parseAsBlock() )
 +                      ->setSubmitTextMsg( 'unlockbtn' );
        }
  
        public function onSubmit( array $data ) {
                $out->addWikiMsg( 'unlockdbsuccesstext' );
        }
  
 +      protected function getDisplayFormat() {
 +              return 'ooui';
 +      }
 +
        protected function getGroupName() {
                return 'wiki';
        }