} else { if (isset($_REQUEST['save'])) { /* $delay_flex = get_request('delay_flex',array()); $db_delay_flex = ''; foreach($delay_flex as $val) $db_delay_flex .= $val['delay'].'/'.$val['period'].';'; $db_delay_flex = trim($db_delay_flex,';'); // for future use */ if (isset($_REQUEST['httptestid'])) { $result = update_httptest($_REQUEST['httptestid'], $_REQUEST['hostid'], $_REQUEST['application'], $_REQUEST['name'], $_REQUEST['delay'], $_REQUEST['status'], $_REQUEST['agent'], $_REQUEST['macros'], $_REQUEST['steps']); $httptestid = $_REQUEST['httptestid']; $action = AUDIT_ACTION_UPDATE; show_messages($result, S_SCENARIO_UPDATED, S_CANNOT_UPDATE_SCENARIO); } else { $httptestid = add_httptest($_REQUEST['hostid'], $_REQUEST['application'], $_REQUEST['name'], $_REQUEST['delay'], $_REQUEST['status'], $_REQUEST['agent'], $_REQUEST['macros'], $_REQUEST['steps']); $result = $httptestid; $action = AUDIT_ACTION_ADD; show_messages($result, S_SCENARIO_ADDED, S_CANNOT_ADD_SCENARIO); } if ($result) { $host = get_host_by_hostid($_REQUEST['hostid']); add_audit($action, AUDIT_RESOURCE_SCENARIO, S_SCENARIO . ' [' . $_REQUEST['name'] . '] [' . $httptestid . '] ' . S_HOST . ' [' . $host['host'] . ']'); unset($_REQUEST['httptestid']); unset($_REQUEST['form']); } } else { if ($_REQUEST['go'] == 'activate' && isset($_REQUEST['group_httptestid'])) { $result = false; $group_httptestid = $_REQUEST['group_httptestid']; foreach ($group_httptestid as $id) {
$db_delay_flex = trim($db_delay_flex,';'); // for future use */ if ($_REQUEST['authentication'] != HTTPTEST_AUTH_NONE) { $http_user = htmlspecialchars($_REQUEST['http_user']); $http_password = htmlspecialchars($_REQUEST['http_password']); } else { $http_user = ''; $http_password = ''; } if (isset($_REQUEST['httptestid'])) { $result = update_httptest($_REQUEST['httptestid'], $_REQUEST['hostid'], $_REQUEST['application'], $_REQUEST['name'], $_REQUEST['authentication'], $http_user, $http_password, $_REQUEST['delay'], $_REQUEST['status'], $_REQUEST['agent'], $_REQUEST['macros'], $_REQUEST['steps']); $httptestid = $_REQUEST['httptestid']; $action = AUDIT_ACTION_UPDATE; show_messages($result, S_SCENARIO_UPDATED, S_CANNOT_UPDATE_SCENARIO); } else { $httptestid = add_httptest($_REQUEST['hostid'], $_REQUEST['application'], $_REQUEST['name'], $_REQUEST['authentication'], $http_user, $http_password, $_REQUEST['delay'], $_REQUEST['status'], $_REQUEST['agent'], $_REQUEST['macros'], $_REQUEST['steps']); $result = $httptestid; $action = AUDIT_ACTION_ADD; show_messages($result, S_SCENARIO_ADDED, S_CANNOT_ADD_SCENARIO); } if ($result) { $host = get_host_by_hostid($_REQUEST['hostid']); add_audit($action, AUDIT_RESOURCE_SCENARIO, S_SCENARIO . ' [' . $_REQUEST['name'] . '] [' . $httptestid . '] ' . S_HOST . ' [' . $host['host'] . ']'); unset($_REQUEST['httptestid']); unset($_REQUEST['form']); } } else { if ($_REQUEST['go'] == 'activate' && isset($_REQUEST['group_httptestid'])) { $go_result = false; $group_httptestid = $_REQUEST['group_httptestid']; foreach ($group_httptestid as $id) {