You are here

public function LdapTestFunctions::configureLdapAuthentication in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapTestFunctions.class.php \LdapTestFunctions::configureLdapAuthentication()

File

ldap_test/LdapTestFunctions.class.php, line 84

Class

LdapTestFunctions

Code

public function configureLdapAuthentication($ldap_authentication_test_conf_id, $sids) {
  module_load_include('php', 'ldap_authentication', 'LdapAuthenticationConfAdmin.class');
  $options = $this->data['ldap_authentication'][$ldap_authentication_test_conf_id];
  foreach ($sids as $i => $sid) {
    $options['sids'][$sid] = $sid;
  }
  $ldapServerAdmin = new LdapAuthenticationConfAdmin();
  foreach ($ldapServerAdmin->saveable as $prop_name) {
    if (isset($options[$prop_name])) {
      $ldapServerAdmin->{$prop_name} = $options[$prop_name];
    }
  }
  $ldapServerAdmin
    ->save();
}