registerFunction("runServerTest");
$in_xAjax = false;
$xAjax_objResponse;
include('user_inc.htm');
// Determine if KMIP servers are configured
$ekm = get_ekm_multi($user, 4);
$results = "";
$has_kmip = count($ekm->managers) >= 2;
function runServerTest($server)
{
global $in_xAjax;
$pass_html = 'Passed';
$fail_html = 'FAILED';
$user = $_SESSION['user'];
$xAjax_objResponse = new xajaxResponse();
$in_xAjax = true;
// This must be called because we set NoInactivityTimer to true because of xajax loading the page behind the sheets.
// Which causes an xajax XML error if the user is redirected to the login page durring the xajax call setup.
// If we are logged out this function will reload the page which will take the user back to the login page.
CheckLoggedOut();
$ekm_data = kmip_path_diags($user, (int)$server);
$xAjax_objResponse->assign("ping_result_".$server, "innerHTML", $ekm_data->ping ? $pass_html : $fail_html );
$xAjax_objResponse->assign("path_result_".$server, "innerHTML", $ekm_data->path ? $pass_html : $fail_html );
$xAjax_objResponse->assign("config_result_".$server, "innerHTML", $ekm_data->config ? $pass_html : $fail_html );
$xAjax_objResponse->script("document.getElementById(\"test_button_".$server."\").disabled = false;");
$xAjax_objResponse->script("decrementRunningTestCount();");
$in_xAjax = false;
return $xAjax_objResponse;
}
$xajax->processRequest();
?>