当前位置: 首页>>代码示例>>PHP>>正文


PHP raise_message函数代码示例

本文整理汇总了PHP中raise_message函数的典型用法代码示例。如果您正苦于以下问题:PHP raise_message函数的具体用法?PHP raise_message怎么用?PHP raise_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了raise_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: register_field_errors

function register_field_errors($error_fields) {
	/* mark this field with an input error */
	$_SESSION["sess_error_fields"][$field_name] = 1;

	/* raise the error message */
	raise_message(3);
}
开发者ID:songchin,项目名称:Cacti,代码行数:7,代码来源:form.php

示例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("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));
    }
}
开发者ID:resmon,项目名称:resmon-cacti,代码行数:30,代码来源:host_templates.php

示例3: form_save

function form_save()
{
    if (isset($_POST["save_component_tree"])) {
        $save["id"] = $_POST["id"];
        $save["name"] = form_input_validate($_POST["name"], "name", "", false, 3);
        $save["sort_type"] = form_input_validate($_POST["sort_type"], "sort_type", "", true, 3);
        if (!is_error_message()) {
            $tree_id = sql_save($save, "graph_tree");
            if ($tree_id) {
                raise_message(1);
                /* sort the tree using the algorithm chosen by the user */
                sort_tree(SORT_TYPE_TREE, $tree_id, $_POST["sort_type"]);
            } else {
                raise_message(2);
            }
        }
        if (is_error_message() || empty($_POST["id"])) {
            header("Location: tree.php?action=edit&id=" . (empty($tree_id) ? $_POST["id"] : $tree_id));
        } else {
            header("Location: tree.php");
        }
    } elseif (isset($_POST["save_component_tree_item"])) {
        $tree_item_id = api_tree_item_save($_POST["id"], $_POST["graph_tree_id"], $_POST["type"], $_POST["parent_item_id"], isset($_POST["title"]) ? $_POST["title"] : "", isset($_POST["local_graph_id"]) ? $_POST["local_graph_id"] : "0", isset($_POST["rra_id"]) ? $_POST["rra_id"] : "0", isset($_POST["host_id"]) ? $_POST["host_id"] : "0", isset($_POST["host_grouping_type"]) ? $_POST["host_grouping_type"] : "1", isset($_POST["sort_children_type"]) ? $_POST["sort_children_type"] : "1", isset($_POST["propagate_changes"]) ? true : false);
        if (is_error_message()) {
            header("Location: tree.php?action=item_edit&tree_item_id=" . (empty($tree_item_id) ? $_POST["id"] : $tree_item_id) . "&tree_id=" . $_POST["graph_tree_id"] . "&parent_id=" . $_POST["parent_item_id"]);
        } else {
            header("Location: tree.php?action=edit&id=" . $_POST["graph_tree_id"]);
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:odp-svn,代码行数:30,代码来源:tree.php

示例4: 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));
    }
}
开发者ID:MrWnn,项目名称:cacti,代码行数:30,代码来源:host_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;
		}
	}
}
开发者ID:songchin,项目名称:Cacti,代码行数:26,代码来源:gprint_presets.php

示例6: 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");
        }
    }
}
开发者ID:songchin,项目名称:Cacti,代码行数:28,代码来源:device_templates.php

示例7: 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");
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:odp-svn,代码行数:34,代码来源:rra.php

示例8: flowview_delete_filter

function flowview_delete_filter()
{
    global $config, $colors;
    db_execute("DELETE FROM plugin_flowview_queries WHERE id=" . get_request_var_request('query'));
    raise_message('flow_deleted');
    header("Location: flowview.php");
    exit;
}
开发者ID:avillaverdec,项目名称:cacti,代码行数:8,代码来源:flowview.php

示例9: flowview_delete_filter

function flowview_delete_filter()
{
    db_execute('DELETE FROM plugin_flowview_queries WHERE id=' . get_request_var_request('query'));
    db_execute('DELETE FROM plugin_flowview_schedules WHERE savedquery=' . get_request_var_request('query'));
    raise_message('flow_deleted');
    header('Location: flowview.php?tab=filters&header=false');
    exit;
}
开发者ID:Cacti,项目名称:plugin_flowview,代码行数:8,代码来源:flowview.php

示例10: 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;
}
开发者ID:avillaverdec,项目名称:cacti,代码行数:54,代码来源:mactrack_actions.php

示例11: settings

function settings() {
	global $colors, $themes;

	$themes["default"] = _("System Default (Global Setting)");

	/* you cannot have per-user settings if cacti's user management is not turned on */
	if (read_config_option("auth_method") == "0") {
		raise_message(6);
		display_output_messages();
		return;
	}

	/* get user settings */
	$user = api_user_info( array( "id" => $_SESSION["sess_user_id"] ) );

	print "<form method='post'>\n";

	html_start_box("<strong>" . _("User Settings") . "</strong>", "98%", $colors["header_background"], "3", "center", "");

	?>
	<tr bgcolor='<?php print $colors["header_panel_background"];?>'>
		<td colspan='2' class='textSubHeaderDark' style='padding: 3px;'>General</td>
	</tr>
		<?php

	$form_array = array(
		"current_theme" => array(
			"friendly_name" => _("Visual Theme"),
			"description" => _("The Cacti theme to use. Changes the look of Cacti."),
			"method" => "drop_array",
			"array" => $themes,
			"value" => api_user_theme($_SESSION["sess_user_id"]),
			"default" => "default"
			)
		);

	draw_edit_form(
		array(
			"config" => array(
				"no_form_tag" => true
				),
			"fields" => $form_array
			)
		);

	html_end_box();


	form_hidden_box("save_component_user","1","");
	form_save_button((isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "index.php"), "save");

}
开发者ID:songchin,项目名称:Cacti,代码行数:52,代码来源:user_settings.php

示例12: package_import

function package_import(&$xml) {
	$xml_array = xml_array_get($xml);

	if (sizeof($xml_array) == 0) {
		raise_message(7); /* xml parse error */
		return;
	}

	/* first, import the header which consists of the actual package data */
	$package_id = package_header_import($xml_array["header"]);

	/* next, import the full payload of the package including all of the templates */
	package_payload_import($xml_array["payload"], $package_id);

	/* last, tie the knot by adding the completed graph template references to the package */
	package_header_items_import($xml_array["header"], $package_id);
}
开发者ID:songchin,项目名称:Cacti,代码行数:17,代码来源:package_import.php

示例13: change_password

function change_password() {
	global $colors;

	$change_result = 1;

	$user_realms = api_user_realms_list($_SESSION["sess_user_id"]);

	/* check if authorized */
	if ($user_realms["18"]["value"] == "1") {
		/* check passwords */
		if ((!empty($_POST["password_old"])) && (!empty($_POST["password_new"])) && (!empty($_POST["password_new_confirm"]))) {
			if ($_POST["password_new"] != $_POST["password_new_confirm"]) {
				/* New passwords do not match */
				raise_message(4);
			}else{
				$change_result = api_user_changepassword($_SESSION["sess_user_id"],$_POST["password_new"],$_POST["password_old"]);
				if ($change_result == "0") {
					/* Password changed successfully */
					raise_message(11);
					/* Log password change */
					$username = db_fetch_cell("select username from user_auth where id=" . $_SESSION["sess_user_id"]);
					log_save(_("CHANGEPASSWORD: Password change successful"), SEV_INFO, FACIL_AUTH);
				}elseif ($change_result == "2") {
					/* Authentication failure for old password */
					raise_message(8);
					log_save(_("CHANGEPASSWORD: Authenication failure on old password"), SEV_WARNING, FACIL_AUTH);
				}else{
					/* General error changing password */
					raise_message(9);
					log_save(_("CHANGEPASSWORD: General Error unable to change password"), SEV_ERROR, FACIL_AUTH);
				}
			}
		}else{
			/* error empty fields */
			raise_message(10);
		}
	}

	require_once(CACTI_BASE_PATH . "/include/top_header.php");
	if ($user_realms["18"]["value"] != "1") {
		/* Access Denied */
		display_custom_error_message("Access Denied.");
	}
	require_once(CACTI_BASE_PATH . "/include/bottom_footer.php");

}
开发者ID:songchin,项目名称:Cacti,代码行数:46,代码来源:user_changepassword.php

示例14: 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));
}
开发者ID:Cacti,项目名称:plugin_thold,代码行数:18,代码来源:notify_lists.php

示例15: form_save

function form_save()
{
    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));
}
开发者ID:teddywen,项目名称:cacti,代码行数:18,代码来源:notify_lists.php


注:本文中的raise_message函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。