• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP update_output_window函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: add_base_packages_menu_items

function add_base_packages_menu_items()
{
    global $g, $config;
    $base_packages = split($g['base_packages'], ",");
    $modified_config = false;
    foreach ($base_packages as $bp) {
        $basepkg_path = "/usr/local/pkg/";
        if (file_exists($basepkg_path . $configfile)) {
            $pkg_config = parse_xml_config_pkg($basepkg_path . $bp, "packagegui");
            if ($pkg_config['menu'] != "") {
                if (is_array($pkg_config['menu'])) {
                    foreach ($pkg_config['menu'] as $menu) {
                        if (is_array($config['installedpackages']['menu'])) {
                            foreach ($config['installedpackages']['menu'] as $amenu) {
                                if ($amenu['name'] == $menu['name']) {
                                    continue;
                                }
                            }
                        }
                        $config['installedpackages']['menu'][] = $menu;
                        $modified_config = true;
                    }
                }
                $static_output .= "done.\n";
                update_output_window($static_output);
            }
        }
    }
    if ($modified_config) {
        write_confg("Restored base_package menus after configuration restore.");
        $config = parse_config(true);
    }
}
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:33,代码来源:diag_backup.php


示例2: read_body_firmware

function read_body_firmware($ch, $string)
{
    global $fout, $file_size, $downloaded, $counter, $version, $latest_version, $current_installed_pfsense_version;
    $length = strlen($string);
    $downloaded += intval($length);
    $downloadProgress = round(100 * (1 - $downloaded / $file_size), 0);
    $downloadProgress = 100 - $downloadProgress;
    $a = $file_size;
    $b = $downloaded;
    $c = $downloadProgress;
    $text = "  Snort download in progress\\n";
    $text .= "----------------------------------------------------\\n";
    $text .= "  Downloaded      : {$b}\\n";
    $text .= "----------------------------------------------------\\n";
    $counter++;
    if ($counter > 150) {
        update_output_window($text);
        update_progress_bar($downloadProgress);
        flush();
        $counter = 0;
    }
    conf_mount_rw();
    fwrite($fout, $string);
    conf_mount_ro();
    return $length;
}
开发者ID:nagyrobi,项目名称:pfsense-packages,代码行数:26,代码来源:snort_download_rules.php


示例3: read_body_firmware

function read_body_firmware($ch, $string)
{
    global $g, $fout, $file_size, $downloaded, $counter, $version, $latest_version;
    $length = strlen($string);
    $downloaded += intval($length);
    $downloadProgress = round(100 * (1 - $downloaded / $file_size), 0);
    $downloadProgress = 100 - $downloadProgress;
    $a = $file_size;
    $b = $downloaded;
    $c = $downloadProgress;
    $text = "  " . gettext("Auto Update Download Status") . "\\n";
    $text .= "----------------------------------------------------\\n";
    $text .= "  " . gettext("Current Version") . " : {$g['product_version']}\\n";
    $text .= "  " . gettext("Latest Version") . "  : {$latest_version}\\n";
    $text .= "  " . gettext("File size") . "       : {$a}\\n";
    $text .= "  " . gettext("Downloaded") . "      : {$b}\\n";
    $text .= "  " . gettext("Percent") . "         : {$c}%\\n";
    $text .= "----------------------------------------------------\\n";
    $counter++;
    if ($counter > 150) {
        update_output_window($text);
        update_progress_bar($downloadProgress);
        $counter = 0;
    }
    fwrite($fout, $string);
    return $length;
}
开发者ID:rohankapoorcom,项目名称:pfsense,代码行数:27,代码来源:system_firmware_auto.php


示例4: add_base_packages_menu_items

function add_base_packages_menu_items()
{
    global $g, $config;
    $base_packages = explode(",", $g['base_packages']);
    $modified_config = false;
    foreach ($base_packages as $bp) {
        $basepkg_path = "/usr/local/pkg/{$bp}";
        $tmpinfo = pathinfo($basepkg_path, PATHINFO_EXTENSION);
        if ($tmpinfo['extension'] == "xml" && file_exists($basepkg_path)) {
            $pkg_config = parse_xml_config_pkg($basepkg_path, "packagegui");
            if ($pkg_config['menu'] != "") {
                if (is_array($pkg_config['menu'])) {
                    foreach ($pkg_config['menu'] as $menu) {
                        if (is_array($config['installedpackages']['menu'])) {
                            foreach ($config['installedpackages']['menu'] as $amenu) {
                                if ($amenu['name'] == $menu['name']) {
                                    continue;
                                }
                            }
                        }
                        $config['installedpackages']['menu'][] = $menu;
                        $modified_config = true;
                    }
                }
                $static_output .= "done.\n";
                update_output_window($static_output);
            }
        }
    }
    if ($modified_config) {
        write_config(gettext("Restored base_package menus after configuration restore."));
        $config = parse_config(true);
    }
}
开发者ID:jdillard,项目名称:pfsense,代码行数:34,代码来源:diag_backup.php


示例5: gettext

    }
    $rebuild_rules = false;
    if ($pkg_interface != "console") {
        $static_output .= gettext("Finished rebuilding Suricata configuration from saved settings.\n");
        update_output_window($static_output);
    }
    log_error(gettext("[Suricata] Finished rebuilding installation from saved settings..."));
    // Only try to start Suricata if not in reboot
    if (!$g['booting']) {
        if ($pkg_interface != "console") {
            update_status(gettext("Starting Suricata using rebuilt configuration..."));
            $static_output .= gettext("Starting Suricata using the rebuilt configuration...");
            update_output_window($static_output);
            mwexec_bg("{$rcdir}suricata.sh start");
            $static_output .= gettext(" done.\n");
            update_output_window($static_output);
        } else {
            mwexec_bg("{$rcdir}suricata.sh start");
        }
    }
}
// If this is first install and "forcekeepsettings" is empty,
// then default it to 'on'.
if (empty($config['installedpackages']['suricata']['config'][0]['forcekeepsettings'])) {
    $config['installedpackages']['suricata']['config'][0]['forcekeepsettings'] = 'on';
}
// Finished with file system mods, so remount it read-only
conf_mount_ro();
// Update Suricata package version in configuration
$config['installedpackages']['suricata']['config'][0]['suricata_config_ver'] = $config['installedpackages']['package'][get_pkg_id("suricata")]['version'];
write_config("Suricata pkg v{$config['installedpackages']['package'][get_pkg_id("suricata")]['version']}: post-install configuration saved.");
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:31,代码来源:suricata_post_install.php


示例6: suricata_fetch_new_rules

function suricata_fetch_new_rules($file_url, $file_dst, $file_md5, $desc = "")
{
    /**********************************************************/
    /* This function downloads the passed rules file and      */
    /* compares its computed md5 hash to the passed md5 hash  */
    /* to verify the file's integrity.                        */
    /*                                                        */
    /* On Entry: $file_url = URL of rules file                */
    /*           $file_dst = Temp destination to store the    */
    /*                       downloaded rules file            */
    /*           $file_md5 = Expected md5 hash for the new    */
    /*                       downloaded rules file            */
    /*           $desc     = Short text string for use in     */
    /*                       log messages                     */
    /*                                                        */
    /*  Returns: TRUE if download was successful.             */
    /*           FALSE if download was not successful.        */
    /**********************************************************/
    global $pkg_interface, $last_curl_error, $update_errors;
    $suricatadir = SURICATADIR;
    $filename = basename($file_dst);
    if ($pkg_interface != "console") {
        update_status(gettext("There is a new set of {$desc} posted. Downloading..."));
    }
    log_error(gettext("[Suricata] There is a new set of {$desc} posted. Downloading {$filename}..."));
    error_log(gettext("\tThere is a new set of {$desc} posted.\n"), 3, SURICATA_RULES_UPD_LOGFILE);
    error_log(gettext("\tDownloading file '{$filename}'...\n"), 3, SURICATA_RULES_UPD_LOGFILE);
    $rc = suricata_download_file_url($file_url, $file_dst);
    // See if the download from the URL was successful
    if ($rc === true) {
        if ($pkg_interface != "console") {
            update_status(gettext("Done downloading {$desc} file."));
        }
        log_error("[Suricata] {$desc} file update downloaded successfully");
        error_log(gettext("\tDone downloading rules file.\n"), 3, SURICATA_RULES_UPD_LOGFILE);
        // Test integrity of the rules file.  Turn off update if file has wrong md5 hash
        if ($file_md5 != trim(md5_file($file_dst))) {
            if ($pkg_interface != "console") {
                update_output_window(gettext("{$desc} file MD5 checksum failed..."));
            }
            log_error(gettext("[Suricata] {$desc} file download failed.  Bad MD5 checksum..."));
            log_error(gettext("[Suricata] Downloaded File MD5: " . md5_file($file_dst)));
            log_error(gettext("[Suricata] Expected File MD5: {$file_md5}"));
            error_log(gettext("\t{$desc} file download failed.  Bad MD5 checksum.\n"), 3, SURICATA_RULES_UPD_LOGFILE);
            error_log(gettext("\tDownloaded {$desc} file MD5: " . md5_file($file_dst) . "\n"), 3, SURICATA_RULES_UPD_LOGFILE);
            error_log(gettext("\tExpected {$desc} file MD5: {$file_md5}\n"), 3, SURICATA_RULES_UPD_LOGFILE);
            error_log(gettext("\t{$desc} file download failed.  {$desc} will not be updated.\n"), 3, SURICATA_RULES_UPD_LOGFILE);
            $update_errors = true;
            return false;
        }
        return true;
    } else {
        if ($pkg_interface != "console") {
            update_output_window(gettext("{$desc} file download failed..."));
        }
        log_error(gettext("[Suricata] {$desc} file download failed... server returned error '{$rc}'..."));
        error_log(gettext("\t{$desc} file download failed.  Server returned error {$rc}.\n"), 3, SURICATA_RULES_UPD_LOGFILE);
        if ($pkg_interface == "console") {
            error_log(gettext("\tThe error text was: {$last_curl_error}\n"), 3, SURICATA_RULES_UPD_LOGFILE);
        }
        error_log(gettext("\t{$desc} will not be updated.\n"), 3, SURICATA_RULES_UPD_LOGFILE);
        $update_errors = true;
        return false;
    }
}
开发者ID:randyqx,项目名称:pfsense-packages,代码行数:65,代码来源:suricata_check_for_rule_updates.php


示例7: gettext

    echo "</html>";
    exit;
}
echo "\n<script type=\"text/javascript\">\n";
echo "//<![CDATA[\n";
echo "jQuery('#invokeupgrade').css('visibility','visible');\n";
echo "//]]>\n";
echo "</script>\n";
echo "\n<script type=\"text/javascript\">\n";
echo "//<![CDATA[\n";
echo "jQuery('#backupdiv').css('visibility','visible');\n";
echo "//]]>\n";
echo "</script>\n";
$txt = gettext("A new version is now available") . "\\n\\n";
$txt .= gettext("Current version") . ": " . $g['product_version'] . "\\n";
if ($g['platform'] == "nanobsd") {
    $txt .= "  " . gettext("NanoBSD Size") . " : " . trim(file_get_contents("/etc/nanosize.txt")) . "\\n";
}
$txt .= "       " . gettext("Built On") . ": " . $current_installed_buildtime . "\\n";
$txt .= "    " . gettext("New version") . ": " . htmlspecialchars($remote_version, ENT_QUOTES | ENT_HTML401) . "\\n\\n";
$txt .= "  " . gettext("Update source") . ": " . $updater_url . "\\n";
update_output_window($txt);
?>
</p>
</form>
<?php 
include "fend.inc";
?>
</body>
</html>
开发者ID:jameswhite,项目名称:pfsense,代码行数:30,代码来源:system_firmware_check.php


示例8: oinkmaster_run

function oinkmaster_run($id, $if_real, $iface_uuid)
{
    global $config, $g, $snortdir_wan, $snortdir, $snort_md5_check_ok, $emerg_md5_check_ok, $pfsense_md5_check_ok;
    if ($snort_md5_check_ok != 'on' || $emerg_md5_check_ok != 'on' || $pfsense_md5_check_ok != 'on') {
        if (empty($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_on']) && empty($config['installedpackages']['snortglobal']['rule'][$id]['rule_sid_off'])) {
            update_status(gettext("Your first set of rules are being copied..."));
            update_output_window(gettext("May take a while..."));
            exec("/bin/cp {$snortdir}/rules/* {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}/rules/");
            exec("/bin/cp {$snortdir}/classification.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/gen-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/generators {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/reference.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/sid {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/sid-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/unicode.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
        } else {
            update_status(gettext("Your enable and disable changes are being applied to your fresh set of rules..."));
            update_output_window(gettext("May take a while..."));
            exec("/bin/cp {$snortdir}/rules/* {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}/rules/");
            exec("/bin/cp {$snortdir}/classification.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/gen-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/generators {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/reference.config {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/sid {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/sid-msg.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            exec("/bin/cp {$snortdir}/unicode.map {$snortdir_wan}/snort_{$iface_uuid}_{$if_real}");
            /*  might have to add a sleep for 3sec for flash drives or old drives */
            exec("/usr/local/bin/perl /usr/local/bin/oinkmaster.pl -C /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/oinkmaster_{$iface_uuid}_{$if_real}.conf -o /usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules > /usr/local/etc/snort/oinkmaster_{$iface_uuid}_{$if_real}.log");
        }
    }
}
开发者ID:netceler,项目名称:pfsense-packages,代码行数:31,代码来源:snort_download_rules.php


示例9: implode

                            }
                        }
                    }
                }
            }
            if ($changed == true) {
                @file_put_contents($file, implode("\n", $splitcontents));
            }
        }
    }
}
if ($snortdownload == 'on' || $emergingthreats == 'on') {
    /* You are Not Up to date, always stop snort when updating rules for low end machines */
    /* Start the proccess for every interface rule */
    if (is_array($config['installedpackages']['snortglobal']['rule'])) {
        foreach ($config['installedpackages']['snortglobal']['rule'] as $id => $value) {
            $if_real = snort_get_real_interface($value['interface']);
            /* make oinkmaster.conf for each interface rule */
            snort_apply_customizations($value, $if_real);
        }
    }
    exec("/bin/sh /usr/local/etc/rc.d/snort.sh restart");
    sleep(10);
    if (!is_process_running("snort")) {
        exec("/bin/sh /usr/local/etc/rc.d/snort.sh start");
    }
    update_output_window(gettext("Snort has restarted with your new set of rules..."));
    log_error("Snort has restarted with your new set of rules...");
}
update_status(gettext("The Rules update finished..."));
conf_mount_ro();
开发者ID:netceler,项目名称:pfsense-packages,代码行数:31,代码来源:snort_check_for_rule_updates.php


示例10: snort_rules_up_install_cron

    snort_rules_up_install_cron($config['installedpackages']['snortglobal']['autorulesupdate7'] != "never_up" ? true : false);
    /* Restore the last Snort Dashboard Widget setting if none is set */
    if (!empty($config['installedpackages']['snortglobal']['dashboard_widget']) && stristr($config['widgets']['sequence'], "snort_alerts-container") === FALSE) {
        $config['widgets']['sequence'] .= "," . $config['installedpackages']['snortglobal']['dashboard_widget'];
    }
    $rebuild_rules = false;
    if ($pkg_interface != "console") {
        update_output_window(gettext("Finished rebuilding Snort configuration files..."));
    }
    log_error(gettext("[Snort] Finished rebuilding installation from saved settings..."));
    /* Only try to start Snort if not in reboot */
    if (!$g['booting']) {
        if ($pkg_interface != "console") {
            update_status(gettext("Starting Snort using rebuilt configuration..."));
            mwexec_bg("{$rcdir}snort.sh start");
            update_output_window(gettext("Snort is starting as a background task using the rebuilt configuration..."));
        } else {
            mwexec_bg("{$rcdir}snort.sh start");
        }
    }
}
/* We're finished with conf partition mods, return to read-only */
conf_mount_ro();
/* If an existing Snort Dashboard Widget container is not found, */
/* then insert our default Widget Dashboard container.           */
if (stristr($config['widgets']['sequence'], "snort_alerts-container") === FALSE) {
    $config['widgets']['sequence'] .= ",{$snort_widget_container}";
}
/* Update Snort package version in configuration */
$config['installedpackages']['snortglobal']['snort_config_ver'] = "3.2.6";
write_config("Snort pkg v3.2.6: post-install configuration saved.");
开发者ID:peekmessage,项目名称:pfsense-packages,代码行数:31,代码来源:snort_post_install.php


示例11: update_output_window

                update_output_window(gettext("Something is wrong on the request."));
            } else {
                if (file_exists("/tmp/pkg_mgr_{$pkgname}.log")) {
                    update_output_window(@file_get_contents("/tmp/pkg_mgr_{$pkgname}.log"));
                } else {
                    update_output_window(gettext("Log was not retrievable."));
                }
            }
            break;
        case 'installedinfo':
            if (file_exists("/tmp/{$pkgname}.info")) {
                $status = @file_get_contents("/tmp/{$pkgname}.info");
                update_status("{$pkgname} " . gettext("installation completed."));
                update_output_window($status);
            } else {
                update_output_window(sprintf(gettext("Could not find %s."), $pkgname));
            }
            break;
        default:
            break;
    }
} else {
    if ($_POST) {
        $pkgid = str_replace(array("<", ">", ";", "&", "'", '"', '.', '/'), "", htmlspecialchars_decode($_POST['id'], ENT_QUOTES | ENT_HTML401));
        /* All other cases make changes, so mount rw fs */
        conf_mount_rw();
        /* Write out configuration to create a backup prior to pkg install. */
        write_config(gettext("Creating restore point before package installation."));
        $progbar = true;
        switch ($_POST['mode']) {
            case 'delete':
开发者ID:rstevens011,项目名称:pfsense,代码行数:31,代码来源:pkg_mgr_install.php


示例12: read_body

function read_body($ch, $string)
{
    global $fout, $file_size, $downloaded, $counter, $version, $latest_version, $current_installed_pfsense_version;
    $length = strlen($string);
    $downloaded += intval($length);
    $downloadProgress = round(100 * (1 - $downloaded / $file_size), 0);
    $downloadProgress = 100 - $downloadProgress;
    $a = $file_size;
    $b = $downloaded;
    $c = $downloadProgress;
    $text = "  Auto Update Download Status\\n";
    $text .= "---------------------------------\\n";
    $text .= "  Latest Version  : {$latest_version}\\n";
    $text .= "  Current Version : {$current_installed_pfsense_version}\\n";
    $text .= "  File size       : {$a}\\n";
    $text .= "  Downloaded      : {$b}\\n";
    $text .= "  Percent         : {$c}%\\n";
    $text .= "---------------------------------\\n";
    $counter++;
    if ($counter > 150) {
        update_output_window($text);
        update_progress_bar($downloadProgress);
        $counter = 0;
    }
    fwrite($fout, $string);
    return $length;
}
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:27,代码来源:system_firmware_auto.php


示例13: update_output_window

    }
    if (!empty($config['installedpackages']['suricata']['config'][0]['dashboard_widget_rows']) && !empty($config['widgets'])) {
        if (empty($config['widgets']['widget_suricata_display_lines'])) {
            $config['widgets']['widget_suricata_display_lines'] = $config['installedpackages']['suricata']['config'][0]['dashboard_widget_rows'];
        }
    }
    $rebuild_rules = false;
    update_output_window(gettext("Finished rebuilding Suricata configuration files..."));
    log_error(gettext("[Suricata] Finished rebuilding installation from saved settings..."));
    // Only try to start Suricata if not in reboot
    if (!$g['booting']) {
        update_status(gettext("Starting Suricata using rebuilt configuration..."));
        update_output_window(gettext("Please wait... while Suricata is started..."));
        log_error(gettext("[Suricata] Starting Suricata using rebuilt configuration..."));
        mwexec_bg("{$rcdir}suricata.sh start");
        update_output_window(gettext("Suricata has been started using the rebuilt configuration..."));
    }
}
// If this is first install and "forcekeepsettings" is empty,
// then default it to 'on'.
if (empty($config['installedpackages']['suricata']['config'][0]['forcekeepsettings'])) {
    $config['installedpackages']['suricata']['config'][0]['forcekeepsettings'] = 'on';
}
// Finished with file system mods, so remount it read-only
conf_mount_ro();
// Update Suricata package version in configuration
$config['installedpackages']['suricata']['config'][0]['suricata_config_ver'] = "2.0.2";
write_config("Suricata pkg: updated GUI package version number.");
// Done with post-install, so clear flag
unset($g['suricata_postinstall']);
log_error(gettext("[Suricata] Package post-installation tasks completed..."));
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:31,代码来源:suricata_post_install.php


示例14: update_output_window

}
if (!$latest_version) {
    if (isset($curcfg['alturl']['enable'])) {
        update_output_window("Could not contact custom update server.");
    } else {
        update_output_window("Could not contact {$g['product_name']} update server {$updater_url}.");
    }
} else {
    if ($needs_system_upgrade) {
        echo "\n<script language=\"JavaScript\">\$('invokeupgrade').style.visibility = 'visible';</script>";
        $txt = "A new version is now available \\n\\n";
        $txt .= "New version:     {$latest_version}\\n";
        $txt .= "Current version: {$current_installed_pfsense_version}\\n";
        $txt .= "Update source:   {$updater_url}\\n";
        update_output_window($txt);
    } else {
        update_output_window("You are on the latest version.");
    }
}
?>

</form>
<?php 
include "fend.inc";
?>
</body>
</html>


</body>
</html>
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:system_firmware_check.php


示例15: read_lists

function read_lists($log_notice = true, $uw = "")
{
    global $config, $g;
    $group_type = array();
    $dir = DANSGUARDIAN_DIR . "/etc/dansguardian/lists";
    #read dansguardian lists dirs
    $groups = array("phraselists", "blacklists", "whitelists");
    #assigns know list files
    $types = array('domains', 'urls', 'banned', 'weighted', 'exception', 'expression');
    #clean previous xml config for dansguardian lists
    foreach ($config['installedpackages'] as $key => $values) {
        if (preg_match("/dansguardian(phrase|black|white)lists/", $key)) {
            unset($config['installedpackages'][$key]);
        }
    }
    #find lists
    foreach ($groups as $group) {
        if (is_dir("{$dir}/{$group}/")) {
            #read dir content and find lists
            $lists = scandir("{$dir}/{$group}/");
            foreach ($lists as $list) {
                if (!preg_match("/^\\./", $list) && is_dir("{$dir}/{$group}/{$list}/")) {
                    $category = scandir("{$dir}/{$group}/{$list}/");
                    foreach ($category as $file) {
                        if (!preg_match("/^\\./", $file)) {
                            if (is_dir("{$dir}/{$group}/{$list}/{$file}")) {
                                $subdir = $file;
                                $subcategory = scandir("{$dir}/{$group}/{$list}/{$subdir}/");
                                foreach ($subcategory as $file) {
                                    if (!preg_match("/^\\./", $file)) {
                                        #assign list to array
                                        $type = split("_", $file);
                                        if (preg_match("/(\\w+)/", $type[0], $matches)) {
                                        }
                                        $xml_type = $matches[1];
                                        if ($config['installedpackages']['dansguardianblacklist']['config'][0]["liston"] == "both" && $group == "blacklists") {
                                            $config['installedpackages']['dansguardianwhitelists' . $xml_type]['config'][] = array("descr" => "{$list}_{$subdir} {$file}", "list" => "{$list}_{$subdir}", "file" => "{$dir}/{$group}/{$list}/{$subdir}/{$file}");
                                        }
                                        $config['installedpackages']['dansguardian' . $group . $xml_type]['config'][] = array("descr" => "{$list}_{$subdir} {$file}", "list" => "{$list}_{$subdir}", "file" => "{$dir}/{$group}/{$list}/{$subdir}/{$file}");
                                    }
                                }
                            } else {
                                #assign list to array
                                $type = split("_", $file);
                                if (preg_match("/(\\w+)/", $type[0], $matches)) {
                                }
                                $xml_type = $matches[1];
                                if ($config['installedpackages']['dansguardianblacklist']['config'][0]["liston"] == "both" && $group == "blacklists") {
                                    $config['installedpackages']['dansguardianwhitelists' . $xml_type]['config'][] = array("descr" => "{$list} {$file}", "list" => $list, "file" => "{$dir}/{$group}/{$list}/{$file}");
                                }
                                $config['installedpackages']['dansguardian' . $group . $xml_type]['config'][] = array("descr" => "{$list} {$file}", "list" => $list, "file" => "{$dir}/{$group}/{$list}/{$file}");
                            }
                        }
                    }
                }
            }
        }
    }
    conf_mount_rw();
    $files = array("site", "url");
    foreach ($files as $edit_xml) {
        $edit_file = file_get_contents("/usr/local/pkg/dansguardian_" . $edit_xml . "_acl.xml");
        if (count($config['installedpackages']['dansguardianblacklistsdomains']['config']) > 18) {
            $edit_file = preg_replace('/size.6/', 'size>20', $edit_file);
            if ($config['installedpackages']['dansguardianblacklist']['config'][0]["liston"] == "both") {
                $edit_file = preg_replace('/size.5/', 'size>19', $edit_file);
            }
        } else {
            $edit_file = preg_replace('/size.20/', 'size>6', $edit_file);
        }
        if ($config['installedpackages']['dansguardianblacklist']['config'][0]["liston"] != "both") {
            $edit_file = preg_replace('/size.19/', 'size>5', $edit_file);
        }
        file_put_contents("/usr/local/pkg/dansguardian_" . $edit_xml . "_acl.xml", $edit_file, LOCK_EX);
    }
    write_config();
    if ($log_notice == true && $uw == "") {
        file_notice("Dansguardian - Blacklist applied, check site and URL access lists for categories", "");
    } else {
        $uw .= "done\n";
        update_output_window($uw);
    }
}
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:83,代码来源:dansguardian.php


示例16: configure_cron

    /* Add the recurring jobs created above to crontab */
    configure_cron();
    /* Restore the last Snort Dashboard Widget setting if none is set */
    if (!empty($config['installedpackages']['snortglobal']['dashboard_widget']) && stristr($config['widgets']['sequence'], "snort_alerts-container") === FALSE) {
        $config['widgets']['sequence'] .= "," . $config['installedpackages']['snortglobal']['dashboard_widget'];
    }
    $rebuild_rules = false;
    update_output_window(gettext("Finished rebuilding Snort configuration files..."));
    log_error(gettext("[Snort] Finished rebuilding installation from saved settings..."));
    /* Only try to start Snort if not in reboot */
    if (!$g['booting']) {
        update_status(gettext("Starting Snort using rebuilt configuration..."));
        update_output_window(gettext("Please wait... while Snort is started..."));
        log_error(gettext("[Snort] Starting Snort using rebuilt configuration..."));
        mwexec_bg("{$rcdir}snort.sh start");
        update_output_window(gettext("Snort is starting using the rebuilt configuration..."));
    }
}
/* We're finished with conf partition mods, return to read-only */
conf_mount_ro();
/* If an existing Snort Dashboard Widget container is not found, */
/* then insert our default Widget Dashboard container.           */
if (stristr($config['widgets']['sequence'], "snort_alerts-container") === FALSE) {
    $config['widgets']['sequence'] .= ",{$snort_widget_container}";
}
/* Update Snort package version in configuration */
$config['installedpackages']['snortglobal']['snort_config_ver'] = "3.1.2";
write_config("Snort pkg: post-install configuration saved.");
/* Done with post-install, so clear flag */
unset($g['snort_postinstall']);
log_error(gettext("[Snort] Package post-installation tasks completed..."));
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:31,代码来源:snort_post_install.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP update_page_cache函数代码示例发布时间:2022-05-23
下一篇:
PHP update_order函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap