* (bug 6642) Don't offer to unlock the database when it isn't locked
authorRob Church <robchurch@users.mediawiki.org>
Wed, 12 Jul 2006 11:32:45 +0000 (11:32 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 12 Jul 2006 11:32:45 +0000 (11:32 +0000)
RELEASE-NOTES
includes/SpecialUnlockdb.php
languages/Messages.php

index 8079a0d..fe0fd10 100644 (file)
@@ -59,6 +59,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fix regression searching Ipblocklist with ugly URLs
 * (bug 6639) Use a consistent default for upload directories
 * Preserve entered reason when reporting unconfirmed lock on Special:Lockdb
+* (bug 6642) Don't offer to unlock the database when it isn't locked
 
 == Languages updated ==
 
index 7808ac5..6627f75 100644 (file)
@@ -39,6 +39,12 @@ class DBUnlockForm {
        {
                global $wgOut, $wgUser;
 
+               global $wgReadOnlyFile;
+               if( !file_exists( $wgReadOnlyFile ) ) {
+                       $wgOut->addWikiText( wfMsg( 'databasenotlocked' ) );
+                       return;
+               }
+
                $wgOut->setPagetitle( wfMsg( "unlockdb" ) );
                $wgOut->addWikiText( wfMsg( "unlockdbtext" ) );
 
index 7f752b9..e7783d2 100644 (file)
@@ -1346,6 +1346,7 @@ Please confirm that this is what you intend to do.',
 <br />Remember 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. To lock or unlock the database, this needs to be writable by the web server.',
+'databasenotlocked' => 'The database is not locked.',
 
 # Make sysop
 'makesysoptitle'       => 'Make a user into a sysop',