aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-01-21 04:14:28 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2014-01-21 04:14:28 -0800
commitc9194f761ff56a7380fbf97d8f1f623a30d0cd75 (patch)
treef4f80bbc894928fdb40d1184c3855558e4711f28
parent0f794b6889d05508c86449dacdee3e05bd47d071 (diff)
parent21832bc89092e150edce8247abd06c91655b034d (diff)
downloadnextcloud-server-c9194f761ff56a7380fbf97d8f1f623a30d0cd75.tar.gz
nextcloud-server-c9194f761ff56a7380fbf97d8f1f623a30d0cd75.zip
Merge pull request #6857 from owncloud/fix_user_ldap_sql_on_oracle
user workaround to compare CLOB column with CHAR value
-rw-r--r--apps/user_ldap/lib/helper.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php
index 09f646921e3..9727d847d27 100644
--- a/apps/user_ldap/lib/helper.php
+++ b/apps/user_ldap/lib/helper.php
@@ -48,18 +48,25 @@ class Helper {
static public function getServerConfigurationPrefixes($activeConfigurations = false) {
$referenceConfigkey = 'ldap_configuration_active';
- $query = '
+ $sql = '
SELECT DISTINCT `configkey`
FROM `*PREFIX*appconfig`
WHERE `appid` = \'user_ldap\'
AND `configkey` LIKE ?
';
+
if($activeConfigurations) {
- $query .= ' AND `configvalue` = \'1\'';
+ if (\OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') {
+ //FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
+ $sql .= ' AND to_char(`configvalue`)=\'1\'';
+ } else {
+ $sql .= ' AND `configvalue` = \'1\'';
+ }
}
- $query = \OCP\DB::prepare($query);
- $serverConfigs = $query->execute(array('%'.$referenceConfigkey))->fetchAll();
+ $stmt = \OCP\DB::prepare($sql);
+
+ $serverConfigs = $stmt->execute(array('%'.$referenceConfigkey))->fetchAll();
$prefixes = array();
foreach($serverConfigs as $serverConfig) {