settings.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * ownCloud - user_ldap
  4. *
  5. * @author Dominik Schmidt
  6. * @author Arthur Schiwon
  7. * @copyright 2011 Dominik Schmidt dev@dominik-schmidt.de
  8. * @copyright 2012-2013 Arthur Schiwon blizzz@owncloud.com
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  12. * License as published by the Free Software Foundation; either
  13. * version 3 of the License, or any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public
  21. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. OC_Util::checkAdminUser();
  25. $params = array('ldap_host', 'ldap_port', 'ldap_backup_host',
  26. 'ldap_backup_port', 'ldap_override_main_server', 'ldap_dn',
  27. 'ldap_agent_password', 'ldap_base', 'ldap_base_users',
  28. 'ldap_base_groups', 'ldap_userlist_filter',
  29. 'ldap_login_filter', 'ldap_group_filter', 'ldap_display_name',
  30. 'ldap_group_display_name', 'ldap_tls',
  31. 'ldap_turn_off_cert_check', 'ldap_nocase', 'ldap_quota_def',
  32. 'ldap_quota_attr', 'ldap_email_attr',
  33. 'ldap_group_member_assoc_attribute', 'ldap_cache_ttl',
  34. 'home_folder_naming_rule'
  35. );
  36. OCP\Util::addscript('user_ldap', 'settings');
  37. OCP\Util::addstyle('user_ldap', 'settings');
  38. // fill template
  39. $tmpl = new OCP\Template('user_ldap', 'settings');
  40. $prefixes = \OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes();
  41. $tmpl->assign('serverConfigurationPrefixes', $prefixes);
  42. // assign default values
  43. if(!isset($ldap)) {
  44. $ldap = new \OCA\user_ldap\lib\Connection();
  45. }
  46. $defaults = $ldap->getDefaults();
  47. foreach($defaults as $key => $default) {
  48. $tmpl->assign($key.'_default', $default);
  49. }
  50. // $tmpl->assign();
  51. return $tmpl->fetchPage();