Merge "Special:Preferences: Use OOjs UI"
[lhc/web/wiklou.git] / includes / specials / SpecialLockdb.php
index cb7eb36..2d087ca 100644 (file)
@@ -34,7 +34,7 @@ class SpecialLockdb extends FormSpecialPage {
        }
 
        public function doesWrites() {
-               return true;
+               return false;
        }
 
        public function requiresWrite() {
@@ -47,6 +47,9 @@ class SpecialLockdb extends FormSpecialPage {
                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() {