Index: dbscripts/dbscripts.module =================================================================== --- dbscripts/dbscripts.module (revision 2820) +++ dbscripts/dbscripts.module (revision 2822) @@ -436,11 +436,14 @@ */ function dbscripts_restore($branch = 'development', $filter_option = 'full') { require('config.inc'); - + global $locked; // Ensure required files are loaded if (!isset($dump_path)) return "The file 'config.inc' does not exist. Copy from the example version?"; - + $db_connection_settings = _dbscripts_db_connect(); + if ($locked) { + return "\nDatabase locked to restore; please set locked to false.\n\n"; + } if (!$db_connection_settings) { return "\nImproper database connection settings.\n\n"; } @@ -1749,16 +1752,16 @@ } - +$locked = 0 ; /** * Get the database connection settings from settings.php file * * Helper function for dump, erase and restore functions */ function _dbscripts_db_connect() { + global $locked; require('config.inc'); require("$settings_path"); - // Ensure required files are loaded if (!isset($dump_path)) return "The file 'config.inc' does not exist. Copy from the example version?"; if (!isset($db_url)) return "The file 'settings.php' file does not exist.";