From bae954a7972c84cfd71ced68173bde0e3b36a2eb Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 18 May 2012 17:38:22 +0200 Subject: [PATCH] LDAP: only check once for name conflicts on update. Set a value on install as well --- apps/user_ldap/appinfo/install.php | 6 ++++++ apps/user_ldap/appinfo/update.php | 33 ++++++++++++++++-------------- 2 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 apps/user_ldap/appinfo/install.php diff --git a/apps/user_ldap/appinfo/install.php b/apps/user_ldap/appinfo/install.php new file mode 100644 index 0000000000..9efc3bb24d --- /dev/null +++ b/apps/user_ldap/appinfo/install.php @@ -0,0 +1,6 @@ +getUsers(); -$query = OCP\DB::prepare($sqlCleanMap); -$query->execute(); -OCP\Config::setSystemValue('ldapIgnoreNamingRules', false); -OC_LDAP::init(true); -$users_new = $LDAP_USER->getUsers(); -$query = OCP\DB::prepare($sqlCleanMap); -$query->execute(); -if($users_old !== $users_new) { - //we don't need to check Groups, because they were not supported in 3' OCP\Config::setSystemValue('ldapIgnoreNamingRules', true); + $LDAP_USER = new OC_USER_LDAP(); + $users_old = $LDAP_USER->getUsers(); + $query = OCP\DB::prepare($sqlCleanMap); + $query->execute(); + OCP\Config::setSystemValue('ldapIgnoreNamingRules', false); + OC_LDAP::init(true); + $users_new = $LDAP_USER->getUsers(); + $query = OCP\DB::prepare($sqlCleanMap); + $query->execute(); + if($users_old !== $users_new) { + //we don't need to check Groups, because they were not supported in 3' + OCP\Config::setSystemValue('ldapIgnoreNamingRules', true); + } } \ No newline at end of file