diff --git a/core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php b/core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php index 2edbff2751..294514827d 100644 --- a/core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php +++ b/core/src/plugins/access.ajxp_conf/class.ajxp_confAccessDriver.php @@ -1516,7 +1516,7 @@ public function switchAction($action, $httpVars, $fileVars) } AJXP_XMLWriter::header(); if ($res == -1) { - AJXP_XMLWriter::sendMessage(null, $mess["ajxp_conf.51"]); + AJXP_XMLWriter::sendMessage(null, $mess[427]); } else { AJXP_XMLWriter::sendMessage($mess["ajxp_conf.59"], null); AJXP_XMLWriter::reloadDataNode(); diff --git a/core/src/plugins/action.share/class.ShareStore.php b/core/src/plugins/action.share/class.ShareStore.php index 9e8fdf0676..16b4ce740e 100644 --- a/core/src/plugins/action.share/class.ShareStore.php +++ b/core/src/plugins/action.share/class.ShareStore.php @@ -316,7 +316,7 @@ public function deleteShare($type, $element) $this->testUserCanEditShare($repo->getOwner()); $res = ConfService::deleteRepository($element); if ($res == -1) { - throw new Exception($mess["ajxp_conf.51"]); + throw new Exception($mess[427]); } if($this->sqlSupported){ if(isSet($share)){ @@ -339,7 +339,7 @@ public function deleteShare($type, $element) $this->testUserCanEditShare($repo->getOwner()); $res = ConfService::deleteRepository($repoId); if ($res == -1) { - throw new Exception($mess["ajxp_conf.51"]); + throw new Exception($mess[427]); } // Silently delete corresponding role if it exists AuthService::deleteRole("AJXP_SHARED-".$repoId); diff --git a/core/src/plugins/conf.sql/class.sqlConfDriver.php b/core/src/plugins/conf.sql/class.sqlConfDriver.php index c009b9d42a..7c0b28fb89 100644 --- a/core/src/plugins/conf.sql/class.sqlConfDriver.php +++ b/core/src/plugins/conf.sql/class.sqlConfDriver.php @@ -442,17 +442,19 @@ public function saveRepository($repositoryObject, $update = false) public function deleteRepository($repositoryId) { try { - $result = dibi::query('DELETE FROM [ajxp_repo] WHERE [uuid] = %s', $repositoryId); - $result_opts = dibi::query('DELETE FROM [ajxp_repo_options] WHERE [uuid] = %s', $repositoryId); - $result_opts_rights = dibi::query('DELETE FROM [ajxp_user_rights] WHERE [repo_uuid] = %s',$repositoryId); //jcg + dibi::query('DELETE FROM [ajxp_repo] WHERE [uuid] = %s', $repositoryId); + dibi::query('DELETE FROM [ajxp_repo_options] WHERE [uuid] = %s', $repositoryId); + dibi::query('DELETE FROM [ajxp_user_rights] WHERE [repo_uuid] = %s',$repositoryId); switch ($this->sqlDriver["driver"]) { - case "sqlite": - case "sqlite3": case "postgre": dibi::nativeQuery("SET bytea_output=escape"); $children_results = dibi::query('SELECT * FROM [ajxp_roles] WHERE [searchable_repositories] LIKE %~like~ GROUP BY [role_id]', '"'.$repositoryId.'";s:'); break; + case "sqlite": + case "sqlite3": + $children_results = dibi::query('SELECT * FROM [ajxp_roles] WHERE [searchable_repositories] LIKE %~like~ GROUP BY [role_id]', '"'.$repositoryId.'";s:'); + break; case "mysql": $children_results = dibi::query('SELECT * FROM [ajxp_roles] WHERE [serial_role] LIKE %~like~ GROUP BY [role_id]', '"'.$repositoryId.'";s:'); break; @@ -467,15 +469,10 @@ public function deleteRepository($repositoryId) } } catch (DibiException $e) { + $this->logError(__FUNCTION__, $e->getMessage()); return -1; } - - // Deleting a non-existent repository also qualifies as an error jcg Call to a member function getAffectedRows() on a non-object - /* - if (false === $result->getAffectedRows()) { - return -1; - } - */ + return 1; } public function getUserChildren( $userId )