summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-05-08 13:56:07 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-05-08 13:56:07 +0200
commit5dee914ed2b45c4956fbab1449a6ecc369e959f6 (patch)
tree4da1f66594f53b835fb91690abe9339e0860a32f /apps
parent251a6d1a9fdde2d65005c3a778d30e7acdf50b67 (diff)
downloadnextcloud-server-5dee914ed2b45c4956fbab1449a6ecc369e959f6.tar.gz
nextcloud-server-5dee914ed2b45c4956fbab1449a6ecc369e959f6.zip
LDAP: sqlite compatibility
Diffstat (limited to 'apps')
-rwxr-xr-xapps/user_ldap/lib_ldap.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php
index 31a39327ddf..505181ff882 100755
--- a/apps/user_ldap/lib_ldap.php
+++ b/apps/user_ldap/lib_ldap.php
@@ -360,8 +360,14 @@ class OC_LDAP {
static private function mapComponent($dn, $ocname, $isUser = true) {
$table = self::getMapTable($isUser);
+ $sqliteAdjustment = '';
+ $dbtype = OCP\Config::getSystemValue('dbtype');
+ if(($dbtype == 'sqlite') || ($dbtype == 'sqlite3')) {
+ $sqliteAdjustment = 'OR';
+ }
+
$insert = OCP\DB::prepare('
- INSERT IGNORE INTO '.$table.'
+ INSERT '.$sqliteAdjustment.' IGNORE INTO '.$table.'
(ldap_dn, owncloud_name)
VALUES (?,?)
');
@@ -453,7 +459,6 @@ class OC_LDAP {
if(!is_null($attr) && !is_array($attr)) {
$attr = array(strtolower($attr));
}
-
$sr = @ldap_search(self::getConnectionResource(), $base, $filter, $attr);
$findings = @ldap_get_entries(self::getConnectionResource(), $sr );
// if we're here, probably no connection ressource is returned.