function popup()
{
    $users = new usersMenus();
    $rule_main = $_GET["rule_main"];
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $dansg = new dansguardian($_GET["hostname"]);
    $rulename = $dansg->Master_rules_index[$rule_main];
    writelogs("Loading default rule {$rule_main}...", __FUNCTION__, __FILE__);
    $rules = main_rules_exceptionsitelist_list($rule_main, 1);
    $apply = applysettings_dansguardian();
    $html = "\n\t<input type='hidden' name='rule_main' value='{$rule_main}'>\n\t<div class=explain>{ExceptionSiteList_explain}</div>\n\t\t\t<center>\n\t\t\t<table style='width:80%' class=form>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>" . Field_text('except_uri', null, 'font-size:13px;padding:3px', null, null, null, false, "exceptionsitelist_enter(event)") . "</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<td width=1%>" . imgtootltip("plus-24.png", "{add}", "exceptionsitelist_add()") . "\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</center>\n\t\t\n\t<br>\n\t<div id='main_rules_exceptionsitelist_list' style='width:100%;height:300px;overflow:auto'>\n\t{$rules}\n\t</div>\n\t";
    $tpl = new templates();
    echo $tpl->_parse_body("{$html}<br>{$categ}<br>");
}
Esempio n. 2
0
function popup_dansguardian_main()
{
    $table = true;
    $mysql = new mysql();
    $mysqlSquid = new mysql_squid_builder();
    $users = new usersMenus();
    if (!$mysqlSquid->TABLE_EXISTS("dansguardian_categories", "artica_backup")) {
        $table = false;
    }
    if (!$mysql->TABLE_EXISTS("dansguardian_files", "artica_backup")) {
        $table = false;
    }
    if (!$mysql->TABLE_EXISTS("dansguardian_rules", "artica_backup")) {
        $table = false;
    }
    if (!$mysql->TABLE_EXISTS("dansguardian_weightedphraselist", "artica_backup")) {
        $table = false;
    }
    if (!$mysql->TABLE_EXISTS("dansguardian_ipgroups", "artica_backup")) {
        $table = false;
    }
    if (!$mysql->TABLE_EXISTS("dansguardian_whitelists", "artica_events")) {
        $table = false;
    }
    if (!$table) {
        popup_mysql_error();
        exit;
    }
    $page = CurrentPageName();
    $performances = Paragraphe("folder-tasks2-64.png", "{performances}", '{performances_text}', "javascript:YahooWin(500,'{$page}?main=performances');");
    $content_scanner = Paragraphe("64-webscanner.png", "{content_scanner}", '{content_scanner_text}', "javascript:YahooWin(651,'{$page}?main=scanner');");
    $download = Paragraphe("icon-download.gif", "{download}", '{download_text}', "javascript:YahooWin(600,'{$page}?main=download');");
    $rules = Paragraphe("folder-rules2-64.png", "{rules}", '{rules_text}', "javascript:YahooWin(600,'{$page}?popup-rules=yes');");
    $apply = applysettings_dansguardian();
    $squidguardweb = Paragraphe("parameters2-64-grey.png", "{banned_page_webservice}", "{banned_page_webservice_text}", null);
    $sock = new sockets();
    $logsize = trim($sock->getfile('DansGuardianLogSize'));
    $dansguardian_enabled = $sock->GET_INFO("DansGuardianEnabled");
    if ($dansguardian_enabled == null) {
        $dansguardian_enabled = 0;
        $sock->SET_INFO("DansGuardianEnabled", 0);
    }
    $squidGuardEnabled = $sock->GET_INFO("squidGuardEnabled");
    if ($squidGuardEnabled == null) {
        $squidGuardEnabled = 0;
        $sock->SET_INFO("squidGuardEnabled", 0);
    }
    $cicap_enabled = $sock->GET_INFO('CicapEnabled');
    $EnableUfdbGuard = $sock->GET_INFO("EnableUfdbGuard");
    $EnableSquidClamav = $sock->GET_INFO("EnableSquidClamav");
    $others = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='top' class=caption nowrap>{logs_size}:</td>\n\t\t\t<td style='width:99%' valign='top'><strong>{$logsize}&nbsp;Ko</strong></td>\n\t\t\t<td>" . imgtootltip('22-recycle.png', '{rotate_logs}', "DansGuardianRotateLogs();") . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t\t\n\t\t\n\t\n\t\n\t";
    if ($_GET["switch"] == "from-squid") {
        $OnMouseOver = "OnMouseOver=\";this.style.cursor='pointer'\"";
        $OnMouseOut = "OnMouseOut=\"this.style.cursor='default'\"";
        $from_squid = "<div style='padding:3px;font-size:13px'>{web_proxy}&nbsp;&raquo;<span {$OnMouseOver} {$OnMouseOut} OnClick=\"javascript:Loadjs('squid.newbee.php?yes=yes&#bullet#')\" >{filters}</span></div>";
    }
    $simple_intro = "{danseguardian_simple_intro}";
    if ($squidGuardEnabled == 1) {
        $simple_intro = "{squidguard_simple_intro}";
        $tool = "<div style='text-align:right'>" . texttooltip("&laquo;&nbsp;{squidguard_testrules}&nbsp;&raquo;", "{squidguard_testrules}", "Loadjs('squidguard.tests.php')", null, 0, "font-size:14px") . "</div>";
    }
    if ($EnableUfdbGuard == 1) {
        $simple_intro = "{ufdbguard_simple_intro}";
        $tool = null;
        $others = null;
    }
    $html = "\n\t <table style='width:100%;'>\n\t \t<tr>\n\t\t \t\t<td valign='top'>\n\t\t \t\t\t<img src='img/bg_dansguardian.png'>\n\t\t \t\t\t\n\t\t \t\t\t{$others}\n\t\t  \t\t</td>\n\t\t  \t\t<td valign='top'>\n\t\t  \t\t\t<p  style='font-size:13px'>{$from_squid}{$simple_intro}</p>\n\t\t  \t\t\t{$tool}\n\t\t  \t\t</td>\n\t\t  \t</tr>\n\t\t  </table>";
    $blackcomputer = Paragraphe("64-black-computer.png", "{black_ip_group}", '{black_ip_group_text}', "javascript:Loadjs('dansguardian.bannediplist.php');");
    $whitecomputer = Paragraphe("64-white-computer.png", "{white_ip_group}", '{white_ip_group_text}', "javascript:Loadjs('dansguardian.exceptioniplist.php');");
    $template = Paragraphe("banned-template-64.png", "{template_label}", '{template_explain}', "javascript:s_PopUp('dansguardian.template.php',800,800)");
    $denywebistes = Paragraphe('folder-64-denywebistes.png', '{deny_websites}', '{deny_websites_text}', "javascript:Loadjs('squid.popups.php?script=url_regex')");
    $whitelisting = Paragraphe('domain-whitelist-64-grey.png', '{www_whitelisting}', '{www_whitelisting_text}');
    // -> $cicap_enabled
    $cicap_dnsbl = Paragraphe("64-cop-acls-dnsbl.png", "{CICAP_DNSBL}", "{CICAP_DNSBL_TEXT}", "javascript:Loadjs('c-icap.dnsbl.php')");
    if ($cicap_enabled == 0) {
        $cicap_dnsbl = null;
    }
    if (!$users->C_ICAP_DNSBL) {
        $cicap_dnsbl = null;
    }
    if ($dansguardian_enabled == 0) {
        $download = null;
        $performances = null;
        $content_scanner = null;
        $apply = null;
    }
    writelogs("squidGuardEnabled={$squidGuardEnabled} - EnableUfdbGuard={$EnableUfdbGuard}", __FUNCTION__, __FILE__, __LINE__);
    if ($squidGuardEnabled == 1) {
        $squidguard_status = Paragraphe('squidguard-status-64.png', '{squidguard_status}', '{squidguard_status_text}', "javascript:Loadjs('squidguard.status.php')");
        $squidguardweb = Paragraphe("parameters2-64.png", "{banned_page_webservice}", "{banned_page_webservice_text}", "javascript:Loadjs('squidguardweb.php')");
        $whitelisting = Paragraphe('domain-whitelist-64.png', '{www_whitelisting}', '{www_whitelisting_text}', "javascript:Loadjs('squid.filters.whitelisting.php')");
        $whitelisting = Paragraphe('domain-whitelist-64.png', '{www_whitelisting}', '{www_whitelisting_text}', "javascript:echo('under construction')");
    }
    if ($EnableUfdbGuard == 1) {
        $squidguardweb = Paragraphe("parameters2-64.png", "{banned_page_webservice}", "{banned_page_webservice_text}", "javascript:Loadjs('squidguardweb.php')");
        $whitelisting = Paragraphe('domain-whitelist-64.png', '{www_whitelisting}', '{www_whitelisting_text}', "javascript:Loadjs('squid.filters.whitelisting.php')");
        $whitelisting = Paragraphe('domain-whitelist-64.png', '{www_whitelisting}', '{www_whitelisting_text}', "javascript:echo('under construction')");
    }
    if ($EnableSquidClamav == 1) {
        $squidguardweb = Paragraphe("parameters2-64.png", "{banned_page_webservice}", "{banned_page_webservice_text}", "javascript:Loadjs('squidguardweb.php')");
    }
    if ($users->APP_UFDBGUARD_INSTALLED) {
        $ufdbguard_settings = Paragraphe("filter-sieve-64.png", "{APP_UFDBGUARD}", "{APP_UFDBGUARD_PARAMETERS}", "javascript:Loadjs('ufdbguard.php')");
    }
    $tr[] = $apply;
    $tr[] = $whitelisting;
    $tr[] = $squidguard_status;
    $tr[] = $denywebistes;
    $tr[] = $cicap_dnsbl;
    $tr[] = $blackcomputer;
    $tr[] = $whitecomputer;
    $tr[] = $download;
    $tr[] = $ufdbguard_settings;
    $tr[] = $performances;
    $tr[] = $content_scanner;
    $tr[] = $template;
    $tr[] = $squidguardweb;
    $tables[] = "<table style='width:100%'><tr>";
    $t = 0;
    while (list($key, $line) = each($tr)) {
        $line = trim($line);
        if ($line == null) {
            continue;
        }
        $t = $t + 1;
        $tables[] = "<td valign='top'>{$line}</td>";
        if ($t == 3) {
            $t = 0;
            $tables[] = "</tr><tr>";
        }
    }
    if ($t < 3) {
        for ($i = 0; $i <= $t; $i++) {
            $tables[] = "<td valign='top'>&nbsp;</td>";
        }
    }
    $tables[] = "</table>";
    $html = $html . implode("\n", $tables);
    $tpl = new templates();
    $html = $tpl->_ENGINE_parse_body($html, "squid.newbee.php,squid.index.php");
    echo $html;
}