enabled = $enabled; $this->lib_ug = $lib_ug; $this->lib_ag = $lib_ag; $this->principal = $principal; $this->credential = $credential; $this->repository_uri = $repository_uri; $this->user_dn = $user_dn; $this->group_dn = $group_dn; $this->domain = $domain; } }; class CKRB5_info { var $enabled; var $realm; var $kdc; var $mappings; var $kt; function CKRB5_info($enabled, $realm, $kdc, $mappings, $kt) { $this->enabled = $enabled; $this->realm = $realm; $this->kdc = $kdc; $this->mappings = $mappings; $this->kt = $kt; } }; //initialize variables $errorCode = 0; $returnMessage = " "; $url = " "; // if this is a post, then this is a request for work to be done if ($_SERVER['REQUEST_METHOD'] == "POST") { $url = $_REQUEST['url']; if($_REQUEST['test_ldap'] == "1" ) { $userToTest = $_REQUEST['userToTest']; $passToTest = $_REQUEST['passToTest']; $testError = test_ldap($user, $userToTest, $passToTest); if(!$testError) { $returnMessage = "The LDAP Connection Test was successfully completed."; } else { $returnMessage = "The LDAP Connection Test did not complete successfully. Please check settings and try again."; } } else { $ldap_info = new CLDAP_info(1, $_REQUEST['lib_ug'], $_REQUEST['lib_ag'], $_REQUEST['principal'], $_REQUEST['credential'], $_REQUEST['repository_uri'], $_REQUEST['user_dn'], $_REQUEST['group_dn'], "LDAP_DOMAIN" ); $krb5_info = new CKRB5_info(0, "", "", "", ""); set_ldap($user, $ldap_info); set_krb5($user, $krb5_info); $returnMessage = "The LDAP Configuration was successfully updated."; } } ?>