diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index fff1c59cf..ec20b6fa6 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -1574,6 +1574,10 @@ class workspaceTools if ($newDatabases != $oldDatabases) { throw new Exception("We can't overwrite this workspace because it has a different amount of databases. Not only the 'source' but also the 'target' must have the same amount of databases."); } + + if(!$workspace->workspaceExists()){ + throw new Exception('We can not overwrite this workspace because the workspace '.$workspaceName.' does not exist please check the lower case and upper case.'); + } CLI::logging(CLI::warning("> Workspace $workspaceName already exist, overwriting!") . "\n"); } else { throw new Exception("Destination workspace already exist (use -o to overwrite)"); diff --git a/workflow/engine/controllers/newSiteProxy.php b/workflow/engine/controllers/newSiteProxy.php index 807ecf4d4..969454bef 100755 --- a/workflow/engine/controllers/newSiteProxy.php +++ b/workflow/engine/controllers/newSiteProxy.php @@ -18,9 +18,17 @@ class newSiteProxy extends HttpProxyController //G::LoadClass( 'json' ); $name = trim( $_POST['NW_TITLE'] ); $inst = new Installer(); - if ($inst->isset_site($name) && $ao_db_drop !==true) { - $this->error = true; - return; + if ($inst->isset_site($name)) { + if($ao_db_drop === true){ + if(!file_exists(PATH_DATA . "sites/" . $name)){ + $this->error = true; + $this->message = 'We can not overwrite this workspace because the workspace '.$name.' does not exist please check the lower case and upper case.'; + return; + } + } else { + $this->error = true; + return; + } } $user = (isset( $_POST['NW_USERNAME'] )) ? trim( $_POST['NW_USERNAME'] ) : 'admin'; $pass = (isset( $_POST['NW_PASSWORD'] )) ? $_POST['NW_PASSWORD'] : 'admin';