aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@owncloud.com>2013-05-31 12:17:46 -0700
committerblizzz <blizzz@owncloud.com>2013-05-31 12:17:46 -0700
commit1656cc2e7c70288e705dc47db9c618149ab79111 (patch)
tree8a5df192200ea23e6a1169606d7f5fdd5af0e511
parenteafb241068c9d2ca591e37580722101ea548ef88 (diff)
parent2ff9677cd17749767060f30dc55bfd66b22fcc26 (diff)
downloadnextcloud-server-1656cc2e7c70288e705dc47db9c618149ab79111.tar.gz
nextcloud-server-1656cc2e7c70288e705dc47db9c618149ab79111.zip
Merge pull request #3565 from owncloud/fix_ldap_sqlite_n_js
Fix ldap sqlite n js
-rw-r--r--apps/user_ldap/js/settings.js2
-rw-r--r--apps/user_ldap/lib/helper.php8
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index f47d49cf222..52d5dbc48d9 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -14,7 +14,7 @@ var LdapConfiguration = {
//deal with Checkboxes
if($(elementID).is('input[type=checkbox]')) {
- if(configvalue === 1) {
+ if(parseInt(configvalue) === 1) {
$(elementID).attr('checked', 'checked');
} else {
$(elementID).removeAttr('checked');
diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php
index 07d13a806a6..10ed40ebd6a 100644
--- a/apps/user_ldap/lib/helper.php
+++ b/apps/user_ldap/lib/helper.php
@@ -118,7 +118,13 @@ class Helper {
return false;
}
- $query = \OCP\DB::prepare('TRUNCATE '.$table);
+ if(strpos(\OCP\Config::getSystemValue('dbtype'), 'sqlite') !== false) {
+ $query = \OCP\DB::prepare('DELETE FROM '.$table);
+ } else {
+ $query = \OCP\DB::prepare('TRUNCATE '.$table);
+ }
+
+
$res = $query->execute();
if(\OCP\DB::isError($res)) {