summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/helper.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-02-14 15:34:22 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-02-14 15:34:22 +0100
commitd88c6778ff10ae6b0e5b2d40e56ec540a4e9d535 (patch)
treeb64a15d72cf581a78794a1622c021da112780ecf /apps/user_ldap/lib/helper.php
parent2a7509ee50b3d16392c54c44cad003e8c867e349 (diff)
downloadnextcloud-server-d88c6778ff10ae6b0e5b2d40e56ec540a4e9d535.tar.gz
nextcloud-server-d88c6778ff10ae6b0e5b2d40e56ec540a4e9d535.zip
LDAP: prevent other configuration from being deleted when deleting the first one which has an empty prefix for historical reasons
Diffstat (limited to 'apps/user_ldap/lib/helper.php')
-rw-r--r--apps/user_ldap/lib/helper.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php
index 9727d847d27..7de7fe8667f 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\')
');