From c49ee4d3e3d1a9597601243e4887b1d446047209 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 31 May 2013 20:06:40 +0200 Subject: LDAP: fix setting value of checkbox after loading configuration --- apps/user_ldap/js/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/user_ldap') 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'); -- cgit v1.2.3 From 2ff9677cd17749767060f30dc55bfd66b22fcc26 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 31 May 2013 20:07:13 +0200 Subject: LDAP: sqlite compatibility for emptyiing tables --- apps/user_ldap/lib/helper.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'apps/user_ldap') 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)) { -- cgit v1.2.3