From d88c6778ff10ae6b0e5b2d40e56ec540a4e9d535 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 14 Feb 2014 15:34:22 +0100 Subject: [PATCH] LDAP: prevent other configuration from being deleted when deleting the first one which has an empty prefix for historical reasons --- apps/user_ldap/lib/helper.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php index 9727d847d2..7de7fe8667 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/helper.php @@ -118,10 +118,16 @@ class Helper { return false; } + $saveOtherConfigurations = ''; + if(empty($prefix)) { + $saveOtherConfigurations = 'AND `Configkey` NOT LIKE \'s%\''; + } + $query = \OCP\DB::prepare(' DELETE FROM `*PREFIX*appconfig` WHERE `configkey` LIKE ? + '.$saveOtherConfigurations.' AND `appid` = \'user_ldap\' AND `configkey` NOT IN (\'enabled\', \'installed_version\', \'types\', \'bgjUpdateGroupsLastRun\') ');