summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/appinfo
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/appinfo')
-rw-r--r--apps/user_ldap/appinfo/update.php18
-rw-r--r--apps/user_ldap/appinfo/version2
2 files changed, 19 insertions, 1 deletions
diff --git a/apps/user_ldap/appinfo/update.php b/apps/user_ldap/appinfo/update.php
index dc437ce21ce..badceb378d1 100644
--- a/apps/user_ldap/appinfo/update.php
+++ b/apps/user_ldap/appinfo/update.php
@@ -31,3 +31,21 @@ if($state == 'doCheck'){
OCP\Config::setSystemValue('ldapIgnoreNamingRules', true);
}
}
+
+
+//from version 0.2 to 0.2.1
+$objects = array('user', 'group');
+
+foreach($objects as $object) {
+ $fetchDNSql = 'SELECT ldap_dn from *PREFIX*ldap_'.$object.'_mapping';
+ $updateSql = 'UPDATE *PREFIX*ldap_'.$object.'_mapping SET ldap_DN = ? WHERE ldap_dn = ?';
+
+ $query = OCP\DB::prepare($fetchDNSql);
+ $res = $query->execute();
+ $DNs = $res->fetchAll();
+ $updateQuery = OCP\DB::prepare($updateSql);
+ foreach($DNs as $dn) {
+ $newDN = mb_strtolower($dn['ldap_dn'], 'UTF-8');
+ $updateQuery->execute(array($newDN, $dn['ldap_dn']));
+ }
+}
diff --git a/apps/user_ldap/appinfo/version b/apps/user_ldap/appinfo/version
index 2f4536184bc..5f021e960ec 100644
--- a/apps/user_ldap/appinfo/version
+++ b/apps/user_ldap/appinfo/version
@@ -1 +1 @@
-0.2 \ No newline at end of file
+0.2.0.5 \ No newline at end of file