]> source.dussan.org Git - nextcloud-server.git/commitdiff
bump version and don't overwrite values on next update if not necessary
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 14 May 2014 11:27:23 +0000 (13:27 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Wed, 14 May 2014 11:27:23 +0000 (13:27 +0200)
apps/user_ldap/appinfo/update.php
apps/user_ldap/appinfo/version

index 8bf532fe3a395ac218332a3b2e711f4742093187..47cc566b360306059454689db7f27d015923dbae 100644 (file)
@@ -17,19 +17,28 @@ $configPrefixes = OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes(true)
 $ldap = new OCA\user_ldap\lib\LDAP();
 foreach($configPrefixes as $config) {
        $connection = new OCA\user_ldap\lib\Connection($ldap, $config);
-       $value = \OCP\Config::getAppValue('user_ldap',
-                                                                         $config.'ldap_uuid_attribute', 'auto');
-       \OCP\Config::setAppValue('user_ldap',
-                                                        $config.'ldap_uuid_user_attribute', $value);
-       \OCP\Config::setAppValue('user_ldap',
-                                                        $config.'ldap_uuid_group_attribute', $value);
 
-       $value = \OCP\Config::getAppValue('user_ldap',
-                                                                         $config.'ldap_expert_uuid_attr', 'auto');
-       \OCP\Config::setAppValue('user_ldap',
-                                                        $config.'ldap_expert_uuid_user_attr', $value);
-       \OCP\Config::setAppValue('user_ldap',
-                                                        $config.'ldap_expert_uuid_group_attr', $value);
+       $state = \OCP\Config::getAppValue(
+               'user_ldap', $config.'ldap_uuid_user_attribute', 'not existing');
+       if($state === 'non existing') {
+               $value = \OCP\Config::getAppValue(
+                       'user_ldap', $config.'ldap_uuid_attribute', 'auto');
+               \OCP\Config::setAppValue(
+                       'user_ldap', $config.'ldap_uuid_user_attribute', $value);
+               \OCP\Config::setAppValue(
+                       'user_ldap', $config.'ldap_uuid_group_attribute', $value);
+       }
+
+       $state = \OCP\Config::getAppValue(
+               'user_ldap', $config.'ldap_expert_uuid_user_attr', 'not existing');
+       if($state === 'non existing') {
+               $value = \OCP\Config::getAppValue(
+                       'user_ldap', $config.'ldap_expert_uuid_attr', 'auto');
+               \OCP\Config::setAppValue(
+                       'user_ldap', $config.'ldap_expert_uuid_user_attr', $value);
+               \OCP\Config::setAppValue(
+                       'user_ldap', $config.'ldap_expert_uuid_group_attr', $value);
+       }
 
        if($enableRawMode) {
                \OCP\Config::setAppValue('user_ldap', $config.'ldap_user_filter_mode', 1);
index 44bb5d1f74358758e75a906eebebb458e9de7fcb..2b7c5ae01848a77d95e2792eb83ab605c9aed91a 100644 (file)
@@ -1 +1 @@
-0.4.1
\ No newline at end of file
+0.4.2