Special:Lockdb return error when database is locked.
authorSethakill <sethakill@outlook.com>
Sat, 7 May 2016 15:18:08 +0000 (17:18 +0200)
committerSethakill <sethakill@outlook.com>
Sat, 7 May 2016 15:18:08 +0000 (17:18 +0200)
Bug: T134650
Change-Id: Ia8950d0f2ae8a151df1fa1c05e9d33cb7e8e7f10

includes/specials/SpecialLockdb.php
languages/i18n/en.json
languages/i18n/qqq.json

index cb7eb36..37494c5 100644 (file)
@@ -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() {
index a521ab5..10072b9 100644 (file)
        "lockdbsuccesstext": "The database has been locked.<br />\nRemember to [[Special:UnlockDB|remove the lock]] after your maintenance is complete.",
        "unlockdbsuccesstext": "The database has been unlocked.",
        "lockfilenotwritable": "The database lock file is not writable.\nTo lock or unlock the database, this needs to be writable by the web server.",
+       "databaselocked": "The database is already locked.",
        "databasenotlocked": "The database is not locked.",
        "lockedbyandtime": "(by {{GENDER:$1|$1}} on $2 at $3)",
        "move-page": "Move $1",
index ce019cf..bc92b05 100644 (file)
        "lockdbsuccesstext": "Used as message text in [[Special:LockDB]].\n\nSee also:\n* {{msg-mw|Lockdbsuccesssub|subtitle}}\n* {{msg-mw|Lockdbsuccesstext|text}}\n* {{msg-mw|Unlockdbsuccesssub|subtitle}}\n* {{msg-mw|Unlockdbsuccesstext|text}}",
        "unlockdbsuccesstext": "Used as message text in [[Special:UnlockDB]].\n\nSee also:\n* {{msg-mw|Lockdbsuccesssub|subtitle}}\n* {{msg-mw|Lockdbsuccesstext|text}}\n* {{msg-mw|Unlockdbsuccesssub|subtitle}}\n* {{msg-mw|Unlockdbsuccesstext|text}}",
        "lockfilenotwritable": "'No longer needed' on wikipedia.",
+       "databaselocked": "Used as error message in [[Special:LockDB]].\nThe title of this error message is {{msg-mw|Lockdb}}.\n\nSee also:\n* {{msg-mw|Lockdb|title}}\n* {{msg-mw|Databaselocked|message}}",
        "databasenotlocked": "Used as error message in [[Special:UnlockDB]].\nThe title of this error message is {{msg-mw|Lockdb}}.\n\nSee also:\n* {{msg-mw|Lockdb|title}}\n* {{msg-mw|Databasenotlocked|message}}",
        "lockedbyandtime": "Used as part of the message when a database is locked through [[Special:LockDB]]. Parameters:\n* $1 is the user that locked the database.\n* $2 is the date on which the lock was made\n* $3 is the time at which the lock was made",
        "move-page": "Used as page title of [[Special:MovePage]] to move pages.\n\nSee example: [[Special:MovePage/Portal:En]].\n\nParameters:\n* $1 - the name of the page to be moved (without link)\n{{Identical|Move}}",