Exemplo n.º 1
0
function main_configfile()
{
    $users = new usersMenus();
    if ($_GET["hostname"] == null) {
        $hostname = $users->hostname;
    } else {
        $hostname = $_GET["hostname"];
    }
    $dans = new dansguardian($hostname);
    $conf = $dans->BuildConfig();
    $table = explode("\n", $conf);
    $html = main_tabs() . "\n\t\n\t<br>\n\t<div style='padding:5px;margin:5px'>\n\t<table style='width:100%'>\n\t\n\t";
    while (list($num, $val) = each($table)) {
        $html = $html . "<tr><td width=1% style='background-color:#CCCCCCC'><strong>{$num}</strong></td><td width=99%'><code>{$val}</code></td></tr>";
    }
    $html = $html . "</table>\n\t\n\t</div>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function BuildMasterRule()
{
    $dans = new dansguardian();
    $file = $dans->BuildConfig();
    events(__FUNCTION__ . ":: Writing /etc/dansguardian/dansguardian.conf " . strlen($file) . " bytes");
    @file_put_contents("/etc/dansguardian/dansguardian.conf", $file);
    CheckFilesDatabases($file, 1);
    CheckAuthMethods();
    DEFAULT_RULE_BANNEDSITE_LISTS();
}