Skip to content
Snippets Groups Projects
Commit c9194f76 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #6857 from owncloud/fix_user_ldap_sql_on_oracle

user workaround to compare CLOB column with CHAR value
parents 0f794b68 21832bc8
Branches
No related tags found
No related merge requests found
......@@ -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);
}
$stmt = \OCP\DB::prepare($sql);
$serverConfigs = $query->execute(array('%'.$referenceConfigkey))->fetchAll();
$serverConfigs = $stmt->execute(array('%'.$referenceConfigkey))->fetchAll();
$prefixes = array();
foreach($serverConfigs as $serverConfig) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment