1234567891011121314151617181920212223242526272829303132 |
- <?php
- use OCA\User_LDAP\LDAP;
- \OC_JSON::checkAdminUser();
- \OC_JSON::checkAppEnabled('user_ldap');
- \OC_JSON::callCheck();
- $prefix = (string)$_POST['ldap_serverconfig_chooser'];
- $chkboxes = ['ldap_configuration_active', 'ldap_override_main_server',
- 'ldap_turn_off_cert_check'];
- foreach ($chkboxes as $boxid) {
- if (!isset($_POST[$boxid])) {
- $_POST[$boxid] = 0;
- }
- }
- $ldapWrapper = new LDAP();
- $connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix);
- $connection->setConfiguration($_POST);
- $connection->saveConfiguration();
- \OC_JSON::success();
|