コード例 #1
0
function main_download()
{
    $users = new usersMenus();
    if ($_GET["hostname"] == null) {
        $hostname = $users->hostname;
        $_GET["hostname"] = $hostname;
    } else {
        $hostname = $_GET["hostname"];
    }
    $page = CurrentPageName();
    $dans = new dansguardian($hostname);
    $style = "style='padding:3px;border-bottom:1px dotted #CCCCCC'";
    $weightedphrasemode = array(0 => "{weightedphrasemode_0}", 1 => '{weightedphrasemode_1}', 2 => '{weightedphrasemode_2}');
    $preservecase = array(0 => "{preservecase_0}", 1 => "{preservecase_1}", 2 => "{preservecase_2}");
    $phrasefiltermode = array(0 => "{phrasefiltermode_0}", 1 => "{phrasefiltermode_1}", 2 => "{phrasefiltermode_2}", 3 => "{phrasefiltermode_3}");
    $enable_clamav = "\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{enable_clamav}:</strong></td>\n\t<td valign='top'>" . Field_checkbox('enable_clamav', 1, $dans->enable_clamav) . "</td>\n\t<td valign='top'>" . help_icon("{enable_clamav_text}") . "</td>\n\t</tr>";
    if (!$users->CLAMD_INSTALLED) {
        $enable_clamav = "<tr>\n\t\t\t\t<td align='right' nowrap valign='top' class=legend>{enable_clamav}:</strong></td>\n\t\t\t\t<td valign='top'><input type='hidden' id='enable_clamav' value='0' name='enable_clamav'></td>\n\t\t\t\t<td valign='top'><img src='img/status_warning.gif'> {CLAMD_NOT_INSTALLED_TEXT}</td>\n\t\t\t\t</tr>";
        $warn_clamav = Paragraphe("dansguardian-warning.png", "{CLAMD_NOT_INSTALLED}", "{CLAMD_NOT_INSTALLED_TEXT}");
    } else {
        if ($users->MEM_TOTAL_INSTALLEE < 716800) {
            $enable_clamav = "<tr>\n\t\t\t\t<td align='right' nowrap valign='top' class=legend>{enable_clamav}:</strong></td>\n\t\t\t\t<td valign='top'><input type='hidden' id='enable_clamav' value='0' name='enable_clamav'></td>\n\t\t\t\t<td valign='top'><img src='img/status_warning.gif'> {MEM_TOTAL_INF_700_TEXT}</td>\n\t\t\t\t</tr>";
            $warn_clamav = Paragraphe("dansguardian-warning.png", "{MEM_TOTAL_INF_700}", "{MEM_TOTAL_INF_700_TEXT}");
        }
    }
    $html = "\n\t<h1>{download}</h1>\n\t<form name='FFM_DANS2'>\n\t<input type='hidden' name='hostname' value='{$hostname}'>\n\t<input type='hidden' name='SaveGeneralSettings' value='yes'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$warn_clamav}</td>\n\t<td valign='top'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{deletedownloadedtempfiles}:</strong></td>\n\t<td valign='top'>" . Field_onoff_checkbox_img('deletedownloadedtempfiles', $dans->Master_array["deletedownloadedtempfiles"]) . "</td>\n\t<td valign='top'>" . help_icon("{deletedownloadedtempfiles_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{initialtrickledelay}:</strong></td>\n\t<td valign='top'>" . Field_text('initialtrickledelay', $dans->Master_array["initialtrickledelay"], 'width:50px') . "</td>\n\t<td valign='top'>" . help_icon("{initialtrickledelay_text}") . "</td>\n\t</tr>\t\n\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{trickledelay}:</strong></td>\n\t<td valign='top'>" . Field_text('trickledelay', $dans->Master_array["trickledelay"], 'width:50px') . "</td>\n\t<td valign='top'>" . help_icon("{trickledelay_text}") . "</td>\n\t</tr>\t\n\t\n\t{$enable_clamav}\n\t\n\t<tr>\n\t<td align='right' nowrap valign='top' class=legend>{enable_user_button}:</strong></td>\n\t<td valign='top'>" . Field_checkbox('DansGuardianEnableUserFrontEnd', 1, $dans->DansGuardianEnableUserFrontEnd) . "</td>\n\t<td valign='top' aling='right'>" . button("{options}...", "Loadjs('{$page}?template-options=yes')") . "</td>\n\t</tr>\t\n\n\t<tr>\n\t<td {$style} colspan=3 align='right' valign='top'>\n\t<hr>" . button("{save}", "ParseForm('FFM_DANS2','{$page}',true)") . "\n\t</td>\n\t</tr>\n\n\t</table></FORM></td></table><br>{$table}";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'squid.index.php');
}
コード例 #2
0
ファイル: sqlgrey.index.php プロジェクト: BillTheBest/1.6.x
function main_config()
{
    $style = "style='padding:3px;border-bottom:1px dotted #CCCCCC'";
    $users = new usersMenus();
    if ($_GET["hostname"] == null) {
        $hostname = $users->hostname;
        $_GET["hostname"] = $hostname;
    } else {
        $hostname = $_GET["hostname"];
    }
    $pure = new sqlgrey($hostname);
    $page = CurrentPageName();
    $greymethod = Field_array_Hash(array("smart" => "{smart}", "full" => "{full}", "classc" => "{classc}"), "greymethod", $pure->main_array["greymethod"], null);
    $optmethod = Field_array_Hash(array("none" => "none", "optin" => "optin", "optout" => "optout"), "optmethod", $pure->main_array["optmethod"]);
    $reject_first_attempt = Field_array_Hash(array("immed" => "immed", "delay" => "delay"), "reject_first_attempt", $pure->main_array["reject_first_attempt"]);
    $reject_early_reconnect = Field_array_Hash(array("immed" => "immed", "delay" => "delay"), "reject_early_reconnect", $pure->main_array["reject_early_reconnect"]);
    $html = main_tabs() . "<br>\n\n\t<h5>{main_settings}</H5>\n\n\t<form name='FFM_DANS2'>\n\t<input type='hidden' name='hostname' value='{$hostname}'>\n\t<input type='hidden' name='SaveGeneralSettings' value='yes'>\n\t" . RoundedLightGreen("\n\t<table style='width:100%'>\n\t\n<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{enable_sqlgrey}:</strong></td>\n\t<td {$style} valign='top'>" . Field_numeric_checkbox_img('enable_sqlgrey', $pure->SqlGreyEnabled) . "</td>\n\t<td {$style} valign='top'>{enable_sqlgrey_text}</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{reconnect_delay}:</strong></td>\n\t<td {$style} valign='top' colspan=2>" . Field_text('reconnect_delay', $pure->main_array["reconnect_delay"], 'width:50px', null, null, '{reconnect_delay_text}') . "</td>\n\t</tr>\n\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{max_connect_age}:</strong></td>\n\t<td {$style} valign='top' colspan=2>" . Field_text('max_connect_age', $pure->main_array["max_connect_age"], 'width:50px', null, null, '{max_connect_age_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{connect_src_throttle}:</strong></td>\n\t<td {$style} valign='top' colspan=2>" . Field_text('connect_src_throttle', $pure->main_array["connect_src_throttle"], 'width:50px', null, null, '{connect_src_throttle_text}') . "</td>\n\t</tr>\t\n\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{awl_age}:</strong></td>\n\t<td {$style} valign='top' colspan=2>" . Field_text('awl_age', $pure->main_array["awl_age"], 'width:50px', null, null, '{awl_age_text}') . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{group_domain_level}:</strong></td>\n\t<td {$style} valign='top' colspan=2>" . Field_text('group_domain_level', $pure->main_array["group_domain_level"], 'width:50px', null, null, '{group_domain_level_text}') . "</td>\n\t</tr>\t\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{greymethod}:</strong></td>\n\t<td {$style} valign='top'>{$greymethod}</td>\n\t<td {$style} valign='top'>" . help_icon("{greymethod_text}") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{optmethod}:</strong></td>\n\t<td {$style} valign='top'>{$optmethod}</td>\n\t<td {$style} valign='top'>" . help_icon("{optmethod_text}") . "</td>\n\t</tr>\t\t\n\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{discrimination}:</strong></td>\n\t<td {$style} valign='top'>" . Field_onoff_checkbox_img('discrimination', $pure->main_array["discrimination"]) . "</td>\n\t<td {$style} valign='top'>" . help_icon("{discrimination_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{discrimination_add_rulenr}:</strong></td>\n\t<td {$style} valign='top'>" . Field_onoff_checkbox_img('discrimination_add_rulenr', $pure->main_array["discrimination_add_rulenr"]) . "</td>\n\t<td {$style} valign='top'>" . help_icon("{discrimination_add_rulenr_text}") . "</td>\n\t</tr>\t\n\n\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{reject_first_attempt}:</strong></td>\n\t<td {$style} valign='top'>{$reject_first_attempt}</td>\n\t<td {$style} valign='top'>" . help_icon("{reject_first_attempt_text}") . "</td>\n\t</tr>\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{reject_early_reconnect}:</strong></td>\n\t<td {$style} valign='top'>{$reject_early_reconnect}</td>\n\t<td {$style} valign='top'>" . help_icon("{reject_early_reconnect_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{whitelists_host}:</strong></td>\n\t<td {$style} valign='top' colspan=2>" . Field_text('whitelists_host', $pure->main_array["whitelists_host"], 'width:250px', null, null, '{whitelists_host_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td {$style} align='right' nowrap valign='top'><strong>{admin_mail}:</strong></td>\n\t<td {$style} valign='top' colspan=2>" . Field_text('admin_mail', $pure->main_array["admin_mail"], 'width:250px', null, null, '{admin_mail_text}') . "</td>\n\t</tr>\n\n\t\n\t<tr>\n\t<tr><td colspan=3 style='border-top:1px solid #005447'>&nbsp;</td></tr>\n\t<tr>\n\t<td {$style} colspan=3 align='right' valign='top'><input type='button' value='{save}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('FFM_DANS2','{$page}',true);LoadAjax('main_config','{$page}?main=yes');\"></td>\n\t</tr>\n\n\t</table>") . "</FORM><br>{$table}";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #3
0
function GROUP_DEFAULT_PASSWORD()
{
    $gpid = $_GET["gpid"];
    $group = new groups($gpid);
    $html = "<h1>{group_default_password}</H1>\n\t<div id='GROUP_DEFAULT_PASSWORD'>\n\t<p class=caption>{group_default_password_text}</p>\n\t<input type='hidden' id='error_passwords_mismatch' value='{error_passwords_mismatch}'>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td class=legend>{password}:</span></td>\t\n\t\t<td>" . Field_password("default_password1", $group->DefaultGroupPassword) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend>{confirm}:</span></td>\t\n\t\t<td>" . Field_password("default_password2", $group->DefaultGroupPassword) . "</td>\n\t\t</tr>\n\t\t<td class=legend>{change_password_now}:</span></td>\t\n\t\t<td>" . Field_onoff_checkbox_img('change_now', 'no', '{group_default_password_change}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><input type='button' OnClick=\"javascript:ChangeDefaultGroupPassword({$gpid});\" value='{apply}&nbsp;&raquo;'>\n\t\t</tr>\n\t</table>\t\n\t</div>\n\t</div>\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #4
0
ファイル: c-icap.index.php プロジェクト: brucewu16899/artica
function daemons()
{
    $ci = new cicap();
    $page = CurrentPageName();
    $html = "<H1>{daemon_settings}</H1>\n\t<p class=caption>{daemon_settings_text}</p>\n\t\n\t<form name=ffmcc1>\n\t<table style='width:100%' class=table_form>\n\t<tr>\n\t\t<td class=legend>{Timeout}:</td>\n\t\t<td>" . Field_text('Timeout', $ci->main_array["CONF"]["Timeout"], 'width:30px') . "&nbsp;{seconds}</td>\n\t\t<td>" . help_icon('{Timeout_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{KeepAlive}:</td>\n\t\t<td>" . Field_onoff_checkbox_img('KeepAlive', $ci->main_array["CONF"]["KeepAlive"], '{enable_disable}') . "</td>\n\t\t<td>" . help_icon('{KeepAlive_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{MaxKeepAliveRequests}:</td>\n\t\t<td>" . Field_text('MaxKeepAliveRequests', $ci->main_array["CONF"]["MaxKeepAliveRequests"], 'width:30px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{MaxKeepAliveRequests_text}') . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend>{KeepAliveTimeout}:</td>\n\t\t<td>" . Field_text('KeepAliveTimeout', $ci->main_array["CONF"]["KeepAliveTimeout"], 'width:30px') . "&nbsp;{seconds}</td>\n\t\t<td>" . help_icon('{KeepAliveTimeout_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td class=legend>{MaxServers}:</td>\n\t\t<td>" . Field_text('MaxServers', $ci->main_array["CONF"]["MaxServers"], 'width:30px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{MaxServers_text}') . "</td>\n\t</tr>\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend>{MinSpareThreads}:</td>\n\t\t<td>" . Field_text('MinSpareThreads', $ci->main_array["CONF"]["MinSpareThreads"], 'width:30px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{MinSpareThreads_text}') . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t\t<td class=legend>{MaxSpareThreads}:</td>\n\t\t<td>" . Field_text('MaxSpareThreads', $ci->main_array["CONF"]["MaxSpareThreads"], 'width:30px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{MaxSpareThreads_text}') . "</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td class=legend>{ThreadsPerChild}:</td>\n\t\t<td>" . Field_text('ThreadsPerChild', $ci->main_array["CONF"]["ThreadsPerChild"], 'width:30px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{ThreadsPerChild_text}') . "</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td class=legend>{MaxRequestsPerChild}:</td>\n\t\t<td>" . Field_text('MaxRequestsPerChild', $ci->main_array["CONF"]["MaxRequestsPerChild"], 'width:30px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{MaxRequestsPerChild_text}') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{VirSaveDir}:</td>\n\t\t<td>" . Field_text('VirSaveDir', $ci->main_array["CONF"]["VirSaveDir"], 'width:290px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{VirSaveDir_text}') . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend>{VirHTTPServer}:</td>\n\t\t<td>" . Field_text('VirHTTPServer', $ci->main_array["CONF"]["VirHTTPServer"], 'width:290px') . "&nbsp;</td>\n\t\t<td>" . help_icon('{VirHTTPServer_text}') . "</td>\n\t</tr>\t\t\n\t<tr>\t\n\t\t<td class=legend>{example}:</td>\n\t\t<td colspan=2><strong><a href='https://{$_SERVER['SERVER_NAME']}/exec.cicap.php?usename=%f&remove=1&file='>https://{$_SERVER['SERVER_NAME']}/exec.cicap.php?usename=%f&remove=1&file=</a></strong></td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td colspan=3 align='right'>\n\t\t\t<input type='button' OnClick=\"javascript:ParseForm('ffmcc1','{$page}',true,false,false,'dialog2_content','{$page}?main=daemons');\" value='{edit}&nbsp;&raquo;'>\n\t\t</td>\n\t</tr>\n\t</table>\n\t</form>\n\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}