本文整理汇总了PHP中is_error_message函数的典型用法代码示例。如果您正苦于以下问题:PHP is_error_message函数的具体用法?PHP is_error_message怎么用?PHP is_error_message使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_error_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form_save
function form_save()
{
/* modify for multi user start */
/* ================= input validation ================= */
input_validate_input_number(get_request_var_post("id"));
/* ==================================================== */
if (!check_notification($_REQUEST['id'])) {
access_denied();
}
/* modify for multi user end */
if (isset($_POST["save_component"])) {
$save["id"] = $_POST["id"];
$save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
$save["description"] = form_input_validate($_POST["description"], "description", "", false, 3);
$save["emails"] = form_input_validate($_POST["emails"], "emails", "", false, 3);
if (!is_error_message()) {
$id = sql_save($save, "plugin_notification_lists");
if ($id) {
raise_message(1);
} else {
raise_message(2);
}
}
}
header("Location: notify_lists.php?action=edit&id=" . (empty($id) ? $_POST["id"] : $id));
}
示例2: form_save
function form_save()
{
/* ================= input validation ================= */
input_validate_input_number(get_request_var_post('host_template_id'));
input_validate_input_number(get_request_var_post('snmp_query_id'));
input_validate_input_number(get_request_var_post('graph_template_id'));
/* ==================================================== */
if (isset($_POST['save_component_template'])) {
$redirect_back = false;
$save['id'] = $_POST['id'];
$save['hash'] = get_hash_host_template($_POST['id']);
$save['name'] = form_input_validate($_POST['name'], 'name', '', false, 3);
if (!is_error_message()) {
$host_template_id = sql_save($save, 'host_template');
if ($host_template_id) {
raise_message(1);
if (isset($_POST['add_gt_x'])) {
db_execute_prepared('REPLACE INTO host_template_graph (host_template_id, graph_template_id) VALUES (?, ?)', array($host_template_id, $_POST['graph_template_id']));
$redirect_back = true;
} elseif (isset($_POST['add_dq_x'])) {
db_execute_prepared('REPLACE INTO host_template_snmp_query (host_template_id, snmp_query_id) VALUES (?, ?)', array($host_template_id, $_POST['snmp_query_id']));
$redirect_back = true;
}
} else {
raise_message(2);
}
}
header('Location: host_templates.php?action=edit&id=' . (empty($host_template_id) ? $_POST['id'] : $host_template_id));
}
}
示例3: form_save
function form_save()
{
/* ================= input validation ================= */
input_validate_input_number(get_request_var_post("id"));
input_validate_input_number(get_request_var_post("host_template_id"));
input_validate_input_number(get_request_var_post("snmp_query_id"));
input_validate_input_number(get_request_var_post("graph_template_id"));
/* ==================================================== */
if (isset($_POST["save_component_template"])) {
$redirect_back = false;
$save["id"] = $_POST["id"];
$save["hash"] = get_hash_host_template($_POST["id"]);
$save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
if (!is_error_message()) {
$host_template_id = sql_save($save, "host_template");
if ($host_template_id) {
raise_message(1);
if (isset($_POST["add_gt_x"])) {
db_execute("replace into host_template_graph (host_template_id,graph_template_id) values({$host_template_id}," . $_POST["graph_template_id"] . ")");
$redirect_back = true;
} elseif (isset($_POST["add_dq_x"])) {
db_execute("replace into host_template_snmp_query (host_template_id,snmp_query_id) values({$host_template_id}," . $_POST["snmp_query_id"] . ")");
$redirect_back = true;
}
} else {
raise_message(2);
}
}
header("Location: host_templates.php?action=edit&id=" . (empty($host_template_id) ? $_POST["id"] : $host_template_id));
}
}
示例4: form_save
function form_save()
{
if (isset($_POST["save_component_template"])) {
$redirect_back = false;
$save["id"] = $_POST["id"];
$save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
if (!is_error_message()) {
$host_template_id = sql_save($save, "host_template");
if ($host_template_id) {
raise_message(1);
if (isset($_POST["add_gt_x"])) {
db_execute("replace into host_template_graph (host_template_id,graph_template_id) values({$host_template_id}," . $_POST["graph_template_id"] . ")");
$redirect_back = true;
} elseif (isset($_POST["add_dq_x"])) {
db_execute("replace into host_template_data_query (host_template_id,data_query_id) values({$host_template_id}," . $_POST["snmp_query_id"] . ")");
$redirect_back = true;
}
} else {
raise_message(2);
}
}
if (is_error_message() || empty($_POST["id"]) || $redirect_back == true) {
header("Location: device_templates.php?action=edit&id=" . (empty($host_template_id) ? $_POST["id"] : $host_template_id));
} else {
header("Location: device_templates.php");
}
}
}
示例5: form_save
function form_save() {
if (isset($_POST["save_component_gprint_presets"])) {
$save["id"] = $_POST["id"];
$save["hash"] = get_hash_gprint($_POST["id"]);
$save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
$save["gprint_text"] = form_input_validate($_POST["gprint_text"], "gprint_text", "", false, 3);
if (!is_error_message()) {
$gprint_preset_id = sql_save($save, "graph_templates_gprint");
if ($gprint_preset_id) {
raise_message(1);
}else{
raise_message(2);
}
}
if (is_error_message()) {
header("Location: gprint_presets.php?action=edit&id=" . (empty($gprint_preset_id) ? $_POST["id"] : $gprint_preset_id));
exit;
}else{
header("Location: gprint_presets.php");
exit;
}
}
}
示例6: form_save
function form_save()
{
if (isset($_POST["save_component_rra"])) {
$save["id"] = $_POST["id"];
$save["hash"] = get_hash_round_robin_archive($_POST["id"]);
$save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
$save["x_files_factor"] = form_input_validate($_POST["x_files_factor"], "x_files_factor", "^[0-9]+(\\.[0-9])?\$", false, 3);
$save["steps"] = form_input_validate($_POST["steps"], "steps", "^[0-9]*\$", false, 3);
$save["rows"] = form_input_validate($_POST["rows"], "rows", "^[0-9]*\$", false, 3);
$save["timespan"] = form_input_validate($_POST["timespan"], "timespan", "^[0-9]*\$", false, 3);
if (!is_error_message()) {
$rra_id = sql_save($save, "rra");
if ($rra_id) {
raise_message(1);
db_execute("delete from rra_cf where rra_id={$rra_id}");
if (isset($_POST["consolidation_function_id"])) {
for ($i = 0; $i < count($_POST["consolidation_function_id"]); $i++) {
/* ================= input validation ================= */
input_validate_input_number($_POST["consolidation_function_id"][$i]);
/* ==================================================== */
db_execute("insert into rra_cf (rra_id,consolidation_function_id)\n\t\t\t\t\t\t\tvalues ({$rra_id}," . $_POST["consolidation_function_id"][$i] . ")");
}
}
} else {
raise_message(2);
}
}
if (is_error_message()) {
header("Location: rra.php?action=edit&id=" . (empty($rra_id) ? $_POST["id"] : $rra_id));
} else {
header("Location: rra.php");
}
}
}
示例7: display_output_messages
function display_output_messages() {
global $messages, $colors;
if (isset($_SESSION["sess_messages"])) {
$error_message = is_error_message();
if (is_array($_SESSION["sess_messages"])) {
foreach (array_keys($_SESSION["sess_messages"]) as $current_message_id) {
eval ('$message = "' . $messages[$current_message_id]["message"] . '";');
switch ($messages[$current_message_id]["type"]) {
case 'info':
if ($error_message == false) {
print "<table align='center' width='98%' style='background-color: #" . $colors['messagebar_background'] . "; border: 1px solid #" . $colors['messagebar_border'] . ";'>";
print "<tr><td bgcolor='#" . $colors["messagebar_background"] . "'><p class='textInfo'>$message</p></td></tr>";
print "</table><br>";
}
break;
case 'error':
print "<table align='center' width='98%' style='background-color: #" . $colors['messagebar_background'] . "; border: 1px solid #ff0000;'>";
print "<tr><td bgcolor='#" . $colors["messagebar_background"] . "'><p class='textError'>Error: $message</p></td></tr>";
print "</table><br>";
break;
}
}
}
}
kill_session_var("sess_messages");
}
示例8: form_save
function form_save()
{
if (isset($_POST["save_component_item"])) {
/* cache all post field values */
init_post_field_cache();
/* step #1: field validation */
$form_graph_item["id"] = $_POST["graph_item_id"];
$form_graph_item["graph_id"] = $_POST["graph_id"];
$form_graph_item["data_source_item_id"] = $_POST["data_source_item_id"];
$form_graph_item["color"] = $_POST["color"];
$form_graph_item["graph_item_type"] = $_POST["graph_item_type"];
$form_graph_item["consolidation_function"] = $_POST["consolidation_function"];
$form_graph_item["cdef"] = $_POST["cdef"];
$form_graph_item["gprint_format"] = $_POST["gprint_format"];
$form_graph_item["legend_value"] = $_POST["legend_value"];
$form_graph_item["legend_format"] = $_POST["legend_format"];
$form_graph_item["hard_return"] = html_boolean(isset($_POST["hard_return"]) ? $_POST["hard_return"] : "");
field_register_error(api_graph_item_fields_validate($form_graph_item, "|field|"));
/* step #2: field save */
if (!is_error_message()) {
$graph_item_id = api_graph_item_save($_POST["graph_item_id"], $form_graph_item);
}
if (is_error_message()) {
header("Location: graph_items.php?action=edit" . (empty($graph_item_id) ? "" : "&id=" . $graph_item_id) . "&graph_id=" . $_POST["graph_id"]);
} else {
header("Location: graphs.php?action=edit&id=" . $_POST["graph_id"]);
}
}
}
示例9: xaxis_form_save
function xaxis_form_save() {
if (isset($_POST["save_component_xaxis"])) {
$save["id"] = $_POST["id"];
$save["hash"] = get_hash_xaxis($_POST["id"]);
$save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
if (!is_error_message()) {
$xaxis_id = sql_save($save, "graph_templates_xaxis");
if ($xaxis_id) {
raise_message(1);
}else{
raise_message(2);
}
}
if ((is_error_message()) || (empty($_POST["id"]))) {
header("Location: xaxis_presets.php?action=edit&id=" . (empty($xaxis_id) ? $_POST["id"] : $xaxis_id));
}else{
header("Location: xaxis_presets.php");
}
exit;
}
if ((isset($_POST["save_component_item"]))) {
$save["id"] = $_POST["id"];
$save["hash"] = get_hash_xaxis($_POST["id"], "xaxis_item");
$save["item_name"] = form_input_validate($_POST["item_name"], "item_name", "", true, 3);
$save["xaxis_id"] = form_input_validate($_POST["xaxis_id"], "xaxis_id", "^[0-9]+$", false, 3);
$save["timespan"] = form_input_validate($_POST["timespan"], "timespan", "^[0-9]+$", false, 3);
$save["gtm"] = form_input_validate($_POST["gtm"], "gtm", "", false, 3);
$save["gst"] = form_input_validate($_POST["gst"], "gst", "^[0-9]+$", false, 3);
$save["mtm"] = form_input_validate($_POST["mtm"], "mtm", "", false, 3);
$save["mst"] = form_input_validate($_POST["mst"], "mst", "^[0-9]+$", false, 3);
$save["ltm"] = form_input_validate($_POST["ltm"], "ltm", "", false, 3);
$save["lst"] = form_input_validate($_POST["lst"], "lst", "^[0-9]+$", false, 3);
$save["lpr"] = form_input_validate($_POST["lpr"], "lpr", "^[0-9]+$", false, 3);
$save["lfm"] = form_input_validate($_POST["lfm"], "lfm", "", true, 3);
if (!is_error_message()) {
$xaxis_item_id = sql_save($save, "graph_templates_xaxis_items");
if ($xaxis_item_id) {
raise_message(1);
}else{
raise_message(2);
}
}
if ((is_error_message()) || (empty($_POST["id"]))) {
header("Location: xaxis_presets.php?action=item_edit&xaxis_id=" . $_POST["xaxis_id"] . "&id=" . (empty($xaxis_item_id) ? $_POST["id"] : $xaxis_item_id));
}else{
header("Location: xaxis_presets.php?action=edit&id=" . (!empty($_POST["xaxis_id"]) ? $_POST["xaxis_id"] : 0));
}
exit;
}
}
示例10: api_device_save
function api_device_save($id, $host_template_id, $description, $hostname, $snmp_community, $snmp_version, $snmp_username, $snmp_password, $snmp_port, $snmp_timeout, $disabled)
{
/* fetch some cache variables */
if (empty($id)) {
$_host_template_id = 0;
} else {
$_host_template_id = db_fetch_cell("select host_template_id from host where id={$id}");
}
$save["id"] = $id;
$save["host_template_id"] = form_input_validate($host_template_id, "host_template_id", "^[0-9]+\$", false, 3);
$save["description"] = form_input_validate($description, "description", "", false, 3);
$save["hostname"] = form_input_validate($hostname, "hostname", "", false, 3);
$save["snmp_community"] = form_input_validate($snmp_community, "snmp_community", "", true, 3);
$save["snmp_version"] = form_input_validate($snmp_version, "snmp_version", "", true, 3);
$save["snmp_username"] = form_input_validate($snmp_username, "snmp_username", "", true, 3);
$save["snmp_password"] = form_input_validate($snmp_password, "snmp_password", "", true, 3);
$save["snmp_port"] = form_input_validate($snmp_port, "snmp_port", "^[0-9]+\$", false, 3);
$save["snmp_timeout"] = form_input_validate($snmp_timeout, "snmp_timeout", "^[0-9]+\$", false, 3);
$save["disabled"] = form_input_validate($disabled, "disabled", "", true, 3);
$host_id = 0;
if (!is_error_message()) {
$host_id = sql_save($save, "host");
if ($host_id) {
raise_message(1);
/* push out relavant fields to data sources using this host */
push_out_host($host_id, 0);
/* the host substitution cache is now stale; purge it */
kill_session_var("sess_host_cache_array");
/* update title cache for graph and data source */
update_data_source_title_cache_from_host($host_id);
update_graph_title_cache_from_host($host_id);
} else {
raise_message(2);
}
/* if the user changes the host template, add each snmp query associated with it */
if ($host_template_id != $_host_template_id && !empty($host_template_id)) {
$snmp_queries = db_fetch_assoc("select snmp_query_id from host_template_snmp_query where host_template_id={$host_template_id}");
if (sizeof($snmp_queries) > 0) {
foreach ($snmp_queries as $snmp_query) {
db_execute("replace into host_snmp_query (host_id,snmp_query_id,reindex_method) values ({$host_id}," . $snmp_query["snmp_query_id"] . "," . DATA_QUERY_AUTOINDEX_BACKWARDS_UPTIME . ")");
/* recache snmp data */
run_data_query($host_id, $snmp_query["snmp_query_id"]);
}
}
$graph_templates = db_fetch_assoc("select graph_template_id from host_template_graph where host_template_id={$host_template_id}");
if (sizeof($graph_templates) > 0) {
foreach ($graph_templates as $graph_template) {
db_execute("replace into host_graph (host_id,graph_template_id) values ({$host_id}," . $graph_template["graph_template_id"] . ")");
}
}
}
}
return $host_id;
}
示例11: api_mactrack_device_save
function api_mactrack_device_save($device_id, $host_id, $site_id, $hostname,
$device_name, $scan_type, $snmp_options, $snmp_readstring,
$snmp_version, $snmp_username, $snmp_password, $snmp_auth_protocol,
$snmp_priv_passphrase, $snmp_priv_protocol, $snmp_context,
$snmp_port, $snmp_timeout, $snmp_retries, $max_oids,
$ignorePorts, $notes, $user_name, $user_password, $term_type,
$private_key_path, $disabled) {
global $config;
include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_functions.php");
$save["device_id"] = $device_id;
$save["host_id"] = $host_id;
$save["site_id"] = $site_id;
$save["hostname"] = form_input_validate($hostname, "hostname", "", false, 3);
$save["device_name"] = form_input_validate($device_name, "device_name", "", false, 3);
$save["notes"] = form_input_validate($notes, "notes", "", true, 3);
$save["scan_type"] = form_input_validate($scan_type, "scan_type", "", false, 3);
$save["snmp_options"] = form_input_validate($snmp_options, "snmp_options", "^[0-9]+$", true, 3);
$save["snmp_readstring"] = form_input_validate($snmp_readstring, "snmp_readstring", "", true, 3); # for SNMP V3, this is optional
$save["snmp_version"] = form_input_validate($snmp_version, "snmp_version", "", false, 3);
$save["snmp_username"] = form_input_validate($snmp_username, "snmp_username", "", true, 3);
$save["snmp_password"] = form_input_validate($snmp_password, "snmp_password", "", true, 3);
$save["snmp_auth_protocol"] = form_input_validate($snmp_auth_protocol, "snmp_auth_protocol", "", true, 3);
$save["snmp_priv_passphrase"] = form_input_validate($snmp_priv_passphrase, "snmp_priv_passphrase", "", true, 3);
$save["snmp_priv_protocol"] = form_input_validate($snmp_priv_protocol, "snmp_priv_protocol", "", true, 3);
$save["snmp_context"] = form_input_validate($snmp_context, "snmp_context", "", true, 3);
$save["snmp_port"] = form_input_validate($snmp_port, "snmp_port", "^[0-9]+$", false, 3);
$save["snmp_timeout"] = form_input_validate($snmp_timeout, "snmp_timeout", "^[0-9]+$", false, 3);
$save["snmp_retries"] = form_input_validate($snmp_retries, "snmp_retries", "^[0-9]+$", false, 3);
$save["max_oids"] = form_input_validate($max_oids, "max_oids", "^[0-9]+$", false, 3);
$save["user_name"] = form_input_validate($user_name, "user_name", "", true, 3);
$save["user_password"] = form_input_validate($user_password, "user_password", "", true, 3);
$save["ignorePorts"] = form_input_validate($ignorePorts, "ignorePorts", "", true, 3);
$save["term_type"] = form_input_validate($term_type, "term_type", "", true, 3);
$save["private_key_path"] = form_input_validate($private_key_path, "private_key_path", "", true, 3);
$save["disabled"] = form_input_validate($disabled, "disabled", "", true, 3);
$device_id = 0;
if (!is_error_message()) {
$device_id = sql_save($save, "mac_track_devices", "device_id");
if ($device_id) {
raise_message(1);
sync_mactrack_to_cacti($save);
}else{
raise_message(2);
mactrack_debug("ERROR: Cacti Device: ($device_id/$host_id): $hostname, error on save: " . serialize($save));
}
} else {
mactrack_debug("ERROR: Cacti Device: ($device_id/$host_id): $hostname, error on verify: " . serialize($save));
}
return $device_id;
}
示例12: form_post
function form_post() {
global $registered_cacti_names;
if (isset($_POST["save_component_data_poller"])) {
$poller_id = api_poller_save($_POST["poller_id"], (isset($_POST["active"]) ? $_POST["active"] : ""), $_POST["hostname"], $_POST["name"]);
if ((is_error_message()) || (empty($_POST["poller_id"]))) {
header("Location: pollers.php?action=edit&poller_id=" . (empty($poller_id) ? $_POST["poller_id"] : $poller_id));
}else{
header("Location: pollers.php");
}
}
}
示例13: form_save
function form_save() {
if ($_POST["action_post"] == "script_edit") {
/* cache all post field values */
init_post_field_cache();
$form_script["name"] = $_POST["name"];
$form_script["input_string"] = $_POST["input_string"];
$form_script["type_id"] = $_POST["type_id"];
field_register_error(api_script_field_validate($form_script, "|field|"));
/* if the validation passes, save the row to the database */
if (!is_error_message()) {
$script_id = api_script_save($_POST["id"], $form_script);
}
if ((is_error_message()) || (empty($_POST["id"]))) {
header("Location: scripts.php?action=edit&id=" . (empty($script_id) ? $_POST["id"] : $script_id));
}else{
header("Location: scripts.php");
}
/* submit button on the actions area page */
}else if ($_POST["action_post"] == "box-1") {
$selected_rows = explode(":", $_POST["box-1-action-area-selected-rows"]);
if ($_POST["box-1-action-area-type"] == "remove") {
foreach ($selected_rows as $script_id) {
api_script_remove($script_id);
}
}else if ($_POST["box-1-action-area-type"] == "duplicate") {
// yet yet coded
}
header("Location: scripts.php");
/* 'filter' area at the bottom of the box */
}else if ($_POST["action_post"] == "script_list") {
$get_string = "";
/* the 'clear' button wasn't pressed, so we should filter */
if (!isset($_POST["box-1-action-clear-button"])) {
if (trim($_POST["box-1-search_filter"]) != "") {
$get_string = ($get_string == "" ? "?" : "&") . "search_filter=" . urlencode($_POST["box-1-search_filter"]);
}
}
header("Location: scripts.php$get_string");
}
}
示例14: form_save
function form_save()
{
if ($_POST["action_post"] == "graph_tree_edit") {
/* cache all post field values */
init_post_field_cache();
$form_graph_tree["name"] = $_POST["name"];
$form_graph_tree["sort_type"] = $_POST["sort_type"];
/* validate graph tree preset fields */
field_register_error(api_graph_tree_fields_validate($form_graph_tree, "|field|"));
if (!is_error_message()) {
$graph_tree_id = api_graph_tree_save($_POST["id"], $form_graph_tree);
}
if (is_error_message()) {
header("Location: graph_trees.php?action=edit" . (empty($graph_tree_id) ? "" : "&id={$graph_tree_id}"));
} else {
header("Location: graph_trees.php");
}
/* submit button on the actions area page */
} else {
if ($_POST["action_post"] == "box-1") {
$selected_rows = explode(":", $_POST["box-1-action-area-selected-rows"]);
if ($_POST["box-1-action-area-type"] == "remove") {
foreach ($selected_rows as $graph_tree_id) {
api_graph_tree_remove($graph_tree_id);
}
} else {
if ($_POST["box-1-action-area-type"] == "duplicate") {
// yet yet coded
}
}
header("Location: graph_trees.php");
/* 'filter' area at the bottom of the box */
} else {
if ($_POST["action_post"] == "graph_tree_list") {
$get_string = "";
/* the 'clear' button wasn't pressed, so we should filter */
if (!isset($_POST["box-1-action-clear-button"])) {
if (trim($_POST["box-1-search_filter"]) != "") {
$get_string = ($get_string == "" ? "?" : "&") . "search_filter=" . urlencode($_POST["box-1-search_filter"]);
}
}
header("Location: graph_trees.php{$get_string}");
}
}
}
}
示例15: form_save
function form_save()
{
if (isset_request_var('save_component')) {
$save['id'] = get_filter_request_var('id');
$save['name'] = form_input_validate(get_nfilter_request_var('name'), 'name', '', false, 3);
$save['description'] = form_input_validate(get_nfilter_request_var('description'), 'description', '', false, 3);
$save['emails'] = form_input_validate(get_nfilter_request_var('emails'), 'emails', '', false, 3);
if (!is_error_message()) {
$id = sql_save($save, 'plugin_notification_lists');
if ($id) {
raise_message(1);
} else {
raise_message(2);
}
}
}
header('Location: notify_lists.php?header=false&action=edit&id=' . (empty($id) ? get_request_var('id') : $id));
}