Esempio n. 1
0
function plugin_syslog_install()
{
    global $config, $syslog_upgrade;
    static $bg_inprocess = false;
    include dirname(__FILE__) . '/config.php';
    syslog_connect();
    $syslog_exists = sizeof(syslog_db_fetch_row('SHOW TABLES FROM `' . $syslogdb_default . "` LIKE 'syslog'"));
    $db_version = syslog_get_mysql_version('syslog');
    /* ================= input validation ================= */
    get_filter_request_var('days');
    /* ==================================================== */
    api_plugin_register_hook('syslog', 'config_arrays', 'syslog_config_arrays', 'setup.php');
    api_plugin_register_hook('syslog', 'draw_navigation_text', 'syslog_draw_navigation_text', 'setup.php');
    api_plugin_register_hook('syslog', 'config_settings', 'syslog_config_settings', 'setup.php');
    api_plugin_register_hook('syslog', 'top_header_tabs', 'syslog_show_tab', 'setup.php');
    api_plugin_register_hook('syslog', 'top_graph_header_tabs', 'syslog_show_tab', 'setup.php');
    api_plugin_register_hook('syslog', 'top_graph_refresh', 'syslog_top_graph_refresh', 'setup.php');
    api_plugin_register_hook('syslog', 'poller_bottom', 'syslog_poller_bottom', 'setup.php');
    api_plugin_register_hook('syslog', 'graph_buttons', 'syslog_graph_buttons', 'setup.php');
    api_plugin_register_hook('syslog', 'config_insert', 'syslog_config_insert', 'setup.php');
    api_plugin_register_hook('syslog', 'utilities_list', 'syslog_utilities_list', 'setup.php');
    api_plugin_register_hook('syslog', 'utilities_action', 'syslog_utilities_action', 'setup.php');
    api_plugin_register_realm('syslog', 'syslog.php', 'Plugin -> Syslog User', 1);
    api_plugin_register_realm('syslog', 'syslog_alerts.php,syslog_removal.php,syslog_reports.php', 'Plugin -> Syslog Administration', 1);
    if (isset_request_var('install') || isset_request_var('return') || isset_request_var('cancel')) {
        if (!$bg_inprocess) {
            syslog_execute_update($syslog_exists, $_REQUEST);
            $bg_inprocess = true;
        }
    } else {
        syslog_install_advisor($syslog_exists, $db_version);
        exit;
    }
}
Esempio n. 2
0
function plugin_syslog_install()
{
    global $config, $syslog_upgrade;
    static $bg_inprocess = false;
    include dirname(__FILE__) . "/config.php";
    syslog_connect();
    $syslog_exists = sizeof(syslog_db_fetch_row("SHOW TABLES FROM `" . $syslogdb_default . "` LIKE 'syslog'"));
    $db_version = syslog_get_mysql_version("syslog");
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("days"));
    /* ==================================================== */
    api_plugin_register_hook('syslog', 'config_arrays', 'syslog_config_arrays', 'setup.php');
    api_plugin_register_hook('syslog', 'draw_navigation_text', 'syslog_draw_navigation_text', 'setup.php');
    api_plugin_register_hook('syslog', 'config_settings', 'syslog_config_settings', 'setup.php');
    api_plugin_register_hook('syslog', 'top_header_tabs', 'syslog_show_tab', 'setup.php');
    api_plugin_register_hook('syslog', 'top_graph_header_tabs', 'syslog_show_tab', 'setup.php');
    api_plugin_register_hook('syslog', 'top_graph_refresh', 'syslog_top_graph_refresh', 'setup.php');
    api_plugin_register_hook('syslog', 'poller_bottom', 'syslog_poller_bottom', 'setup.php');
    api_plugin_register_hook('syslog', 'graph_buttons', 'syslog_graph_buttons', 'setup.php');
    api_plugin_register_hook('syslog', 'config_insert', 'syslog_config_insert', 'setup.php');
    api_plugin_register_realm('syslog', 'syslog.php', 'Plugin -> Syslog User', 1);
    api_plugin_register_realm('syslog', 'syslog_alerts.php,syslog_removal.php,syslog_reports.php', 'Plugin -> Syslog Administration', 1);
    //print "<pre>";print_r($_GET);print "</pre>";
    if (isset($_GET["install"]) || isset($_GET["return"]) || isset($_GET["cancel"])) {
        if (!$bg_inprocess) {
            syslog_execute_update($syslog_exists, $_GET);
            $bg_inprocess = true;
        }
    } else {
        syslog_install_advisor($syslog_exists, $db_version);
        exit;
    }
}