diff options
author | blizzz <blizzz@owncloud.com> | 2013-05-31 12:17:46 -0700 |
---|---|---|
committer | blizzz <blizzz@owncloud.com> | 2013-05-31 12:17:46 -0700 |
commit | 1656cc2e7c70288e705dc47db9c618149ab79111 (patch) | |
tree | 8a5df192200ea23e6a1169606d7f5fdd5af0e511 | |
parent | eafb241068c9d2ca591e37580722101ea548ef88 (diff) | |
parent | 2ff9677cd17749767060f30dc55bfd66b22fcc26 (diff) | |
download | nextcloud-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.js | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/helper.php | 8 |
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)) { |