function main_rules_weightedphraselist_dropdown($noecho = 0)
{
    $rule_main = $_GET["rule_main"];
    if ($rule_main == "DansDefault") {
        $dans = new dansguardian_default_rules();
        $rulename = "Default rule";
    } else {
        $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
        $dansg = new dansguardian($_GET["hostname"]);
        $rulename = strip_rulename($dansg->Master_rules_index[$rule_main]);
    }
    while (list($num, $cat) = each($dans->array_weighted_phrases_lists)) {
        $array[$num] = $cat;
    }
    $d = new dansguardian();
    $d->DefinedCategoryWeightedPhraseListLoad();
    while (list($num, $cat) = each($d->UserCategoryWeightedPhraseList)) {
        $array[$cat] = $cat;
    }
    $list = Field_array_Hash($array, 'weighted', null, null, null, 0, 'font-size:13px');
    $tpl = new templates();
    $list = $tpl->_ENGINE_parse_body($list);
    if ($noecho == 1) {
        return $list;
    }
    echo $list;
}
function popup($noecho = 0)
{
    $rule_main = $_GET["rule_main"];
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $dansg = new dansguardian($_GET["hostname"]);
    $rulename = strip_rulename($dansg->Master_rules_index[$rule_main]);
    $html = "\n\t\n\t<p class=caption>{bannedregexpurllist_explain}</p>\n\t<div id='main_rules_bannedregexpurllist_list'>" . main_rules_bannedregexpurllist_list($rule_main, 1) . "</div>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body("{$html}");
}
function popup($noecho = 0)
{
    $rule_main = $_GET["rule_main"];
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $dansg = new dansguardian($_GET["hostname"]);
    $rulename = strip_rulename($dansg->Master_rules_index[$rule_main]);
    $html = "\n\t<input type='hidden' name='rule_main' value='{$rule_main}'>\n\t<p class=caption>{categories_explain}</p>\n\t<div id='main_rules_categories_list'>" . main_rules_categories_list("{$rule_main}", 1) . "</div>\n\t";
    $tpl = new templates();
    if ($noecho == 1) {
        return $tpl->_ENGINE_parse_body("<br>{$html}<br>{$categ}<br>", "dansguardian.index.php");
    }
    echo $tpl->_ENGINE_parse_body("{$html}<br>{$categ}<br>");
}
function popup($noecho = 0)
{
    $rule_main = $_GET["rule_main"];
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $dansg = new dansguardian($_GET["hostname"]);
    $rulename = strip_rulename($dansg->Master_rules_index[$rule_main]);
    $html = "\n\t<input type='hidden' name='rule_main' value='{$rule_main}'>\n\t<p class=caption>{categories_explain}</p>\n\t<div id='main_rules_categories_list' style='width:100%;height:650px;overflow:auto'></div>\n\t<script>\n\t\tDansGuardianRefreshCategories();\n\t</script>\n\t";
    $tpl = new templates();
    if ($noecho == 1) {
        return $tpl->_ENGINE_parse_body("{$html}", "dansguardian.index.php");
    }
    echo $tpl->_ENGINE_parse_body("{$html}");
}
function popup($noecho = 0)
{
    $rule_main = $_GET["rule_main"];
    $sock = new sockets();
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $dansg = new dansguardian($_GET["hostname"]);
    $rulename = strip_rulename($dansg->Master_rules_index[$rule_main]);
    $explain = "categories_explain";
    $EnableSquidFilterWhiteListing = $sock->GET_INFO("EnableSquidFilterWhiteListing");
    if ($EnableSquidFilterWhiteListing == 1) {
        $explain = "categories_white_explain";
    }
    $html = "\n\t<input type='hidden' name='rule_main' value='{$rule_main}'>\n\t<div class=text-info>{{$explain}}</div>\n\t<div id='main_rules_categories_list' style='width:100%;height:650px;overflow:auto'></div>\n\t<script>\n\t\tDansGuardianRefreshCategories();\n\t</script>\n\t";
    $tpl = new templates();
    if ($noecho == 1) {
        return $tpl->_ENGINE_parse_body("{$html}", "dansguardian.index.php");
    }
    echo $tpl->_ENGINE_parse_body("{$html}");
}
Example #6
0
function main_rules_mainsettings()
{
    $users = new usersMenus();
    if ($_GET["hostname"] == null) {
        $hostname = $users->hostname;
    } else {
        $hostname = $_GET["hostname"];
    }
    $rule_main = $_GET["rule_main"];
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $dansg = new dansguardian($_GET["hostname"]);
    $rulename = strip_rulename($dansg->Master_rules_index[$rule_main]);
    $page = CurrentPageName();
    $groupmode = array('0' => "{groupmode_0}", '1' => "{groupmode_1}", '2' => "{groupmode_2}");
    $sock = new sockets();
    $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);
    }
    $EnableUfdbGuard = $sock->GET_INFO("EnableUfdbGuard");
    if ($EnableUfdbGuard == null) {
        $EnableUfdbGuard = 0;
        $sock->SET_INFO("EnableUfdbGuard", 0);
    }
    $dansguardian_part = "\t\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{groupmode}:</strong></td>\n\t<td valign='top'>" . Field_array_Hash($groupmode, 'groupmode', $dans->Main_array["groupmode"], null, null, 1, "font-size:13px;padding:3px") . "</td>\n\t<td valign='top'>" . help_icon('{groupmode_text}') . "</td>\n\t</tr>\t\t\n\t\n\t<td align='right' nowrap valign='top' class=legend>{naughtynesslimit}:</strong></td>\n\t<td valign='top'>" . Field_text('naughtynesslimit', $dans->Main_array["naughtynesslimit"], 'width:50px;font-size:13px;padding:3px') . "</td>\n\t<td valign='top'>" . help_icon('{naughtynesslimit_text}') . "</td>\n\t</tr>\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{categorydisplaythreshold}:</strong></td>\n\t<td valign='top'>" . Field_text('categorydisplaythreshold', $dans->Main_array["categorydisplaythreshold"], 'width:50px;font-size:13px;padding:3px') . "</td>\n\t<td valign='top'>" . help_icon('{categorydisplaythreshold_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{embeddedurlweight}:</strong></td>\n\t<td valign='top'>" . Field_text('embeddedurlweight', $dans->Main_array["embeddedurlweight"], 'width:50px;font-size:13px;padding:3px') . "</td>\n\t<td valign='top'>" . help_icon('{embeddedurlweight_text}') . "</td>\n\t</tr>\t\t\n\t\n\t\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{deepurlanalysis}:</strong></td>\n\t<td valign='top'>" . Field_checkbox('deepurlanalysis', 'on', $dans->Main_array["deepurlanalysis"]) . "</td>\n\t<td valign='top'>" . help_icon('{deepurlanalysis_text}') . "</td>\n\t</tr>\t";
    $users = new usersMenus();
    if (!$users->DANSGUARDIAN_INSTALLED) {
        $dansguardian_part = null;
    }
    if ($squidGuardEnabled == 1) {
        $dansguardian_part = null;
    }
    if ($EnableUfdbGuard == 1) {
        $dansguardian_part = null;
    }
    $style = "style='padding:3px;border-bottom:1px dotted #CCCCCC'";
    $html = "\n\t<div id='main_rules_mainsettings_id'>\n\t<input type='hidden' name='RulesSaveGeneralSettings' value='yes'>\n\t<input type='hidden' name='rule_main' value='{$rule_main}'>\n\t<table style='width:100%'>\n\n\t<tr>\n\t<td align='right' nowrap valign='middle' class=legend>{groupname}:</strong></td>\n\t<td valign='top'>" . Field_text('groupname', $dans->Main_array["groupname"], 'width:220px;font-size:13px;padding:3px') . "</td>\n\t<td valign='top'>" . help_icon('{groupname_text}') . "</td>\n\t</tr>\t\n\t{$dansguardian_part}\n\t\n\t<td {$style} colspan=3 align='right' valign='top'>\n\t<hr>\n\t\t" . button("{save}", "main_rules_mainsettings_save();") . "\n\t</tr>\n\n\t</table>\n\t<br>{$table}\n\t</div>\n\t\n\t<script>\n\t   \n\tvar x_main_rules_mainsettings_save= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tYahooWin2Hide();\n\t\t}\t\n\t\n\t\n\t\n\t\n\t\tfunction main_rules_mainsettings_save(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('RulesSaveGeneralSettings','yes');\n\t\t\tXHR.appendData('rule_main','{$rule_main}');\n\t\t\tXHR.appendData('groupname',document.getElementById('groupname').value);\n\t\t\tif(document.getElementById('groupmode')){\n\t\t\t\tXHR.appendData('groupmode',document.getElementById('groupmode').value);\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('naughtynesslimit')){\n\t\t\t\tXHR.appendData('naughtynesslimit',document.getElementById('naughtynesslimit').value);\n\t\t\t}\t\n\n\t\t\t\n\t\t\tif(document.getElementById('categorydisplaythreshold')){\n\t\t\t\tXHR.appendData('categorydisplaythreshold',document.getElementById('categorydisplaythreshold').value);\n\t\t\t}\t\t\n\n\t\t\tif(document.getElementById('embeddedurlweight')){\n\t\t\t\tXHR.appendData('embeddedurlweight',document.getElementById('embeddedurlweight').value);\n\t\t\t}\t\t\t\t\n\t\t\tif(document.getElementById('deepurlanalysis')){\n\t\t\t\tif(document.getElementById('deepurlanalysis').checked){\n\t\t\t\t\tXHR.appendData('deepurlanalysis','on');\n\t\t\t\t}else{\n\t\t\t\t\tXHR.appendData('deepurlanalysis','off');\n\t\t\t\t}\n\t\t\t}\n\t\tdocument.getElementById('main_rules_mainsettings_id').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_main_rules_mainsettings_save);\t}\n\t\t\n\t\t\n\t</script>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'squid.index.php');
}