aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-02-20 16:55:18 +0100
committerRobin Appelman <icewind@owncloud.com>2014-02-20 16:55:18 +0100
commit0624476aa19a63b1f4e35f35e151c3fc46cb697f (patch)
tree67e9ead3bfd44e7efe3f4a6d1325866075dbd702 /apps/user_ldap/lib
parentf33d35cd073addb08c78a65b719c72eb5424434a (diff)
parentec45a3c0e2567c89729bc6fe8c996b7939025429 (diff)
downloadnextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.tar.gz
nextcloud-server-0624476aa19a63b1f4e35f35e151c3fc46cb697f.zip
Merge branch 'master' into mimeicons-svg
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/access.php11
-rw-r--r--apps/user_ldap/lib/helper.php6
2 files changed, 17 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 6795aecafee..b7e4023dd73 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -922,6 +922,17 @@ class Access extends LDAPUtility {
}
/**
+ * @brief escapes (user provided) parts for LDAP filter
+ * @param String $input, the provided value
+ * @returns the escaped string
+ */
+ public function escapeFilterPart($input) {
+ $search = array('*', '\\', '(', ')');
+ $replace = array('\\*', '\\\\', '\\(', '\\)');
+ return str_replace($search, $replace, $input);
+ }
+
+ /**
* @brief combines the input filters with AND
* @param $filters array, the filters to connect
* @returns the combined filter
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\')
');