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; } }; $errorCode = 0; $returnMessage = " "; $url = " "; if ($_SERVER['REQUEST_METHOD'] == "POST") { $url = $_REQUEST['url']; if(is_uploaded_file($_FILES['keytab']['tmp_name'])) { $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'], $_REQUEST['domain']); $krb5_info = new CKRB5_info(1, $_REQUEST['realm'], $_REQUEST['kdc'], $_REQUEST['mapping'], $_FILES['keytab']['tmp_name']); set_ldap($user, $ldap_info); set_krb5($user, $krb5_info); $returnMessage = "The Kerberos Configuration was successfully updated."; } else { switch ($HTTP_POST_FILES['serviceKeytab']['error']) { case UPLOAD_ERR_INI_SIZE: $returnMessage = "The uploaded file exceeds the upload_max_filesize directive in php.ini"; break; case UPLOAD_ERR_FORM_SIZE: $returnMessage = "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"; break; case UPLOAD_ERR_PARTIAL: $returnMessage = "The uploaded file was only partially uploaded"; break; case UPLOAD_ERR_NO_FILE: $returnMessage = "No file was uploaded"; break; case UPLOAD_ERR_NO_TMP_DIR: $returnMessage = "Missing a temporary folder"; break; case UPLOAD_ERR_CANT_WRITE: $returnMessage = "Failed to write file to disk"; break; case UPLOAD_ERR_EXTENSION: $returnMessage = "File upload stopped by extension"; break; default: $returnMessage = "Unknown upload error"; break; } } } ?>