update.php 1.1 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. //detect if we can switch on naming guidelines. We won't do it on conflicts.
  3. //it's a bit spaghetti, but hey.
  4. $state = OCP\Config::getSystemValue('ldapIgnoreNamingRules', 'unset');
  5. if($state === 'unset') {
  6. OCP\Config::setSystemValue('ldapIgnoreNamingRules', false);
  7. }
  8. $configPrefixes = OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes(true);
  9. $ldap = new OCA\user_ldap\lib\LDAP();
  10. foreach($configPrefixes as $config) {
  11. $connection = new OCA\user_ldap\lib\Connection($ldap, $config);
  12. $value = \OCP\Config::getAppValue('user_ldap',
  13. $config.'ldap_uuid_attribute', 'auto');
  14. \OCP\Config::setAppValue('user_ldap',
  15. $config.'ldap_uuid_user_attribute', $value);
  16. \OCP\Config::setAppValue('user_ldap',
  17. $config.'ldap_uuid_group_attribute', $value);
  18. $value = \OCP\Config::getAppValue('user_ldap',
  19. $config.'ldap_expert_uuid_attr', 'auto');
  20. \OCP\Config::setAppValue('user_ldap',
  21. $config.'ldap_expert_uuid_user_attr', $value);
  22. \OCP\Config::setAppValue('user_ldap',
  23. $config.'ldap_expert_uuid_group_attr', $value);
  24. }