function popup()
{
    $sock = new sockets();
    $PostfixMultiCreateBubble = $sock->GET_INFO("PostfixMultiCreateBubble");
    if (!is_numeric($PostfixMultiCreateBubble)) {
        $PostfixMultiCreateBubble = 0;
    }
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $EnableSubmission = $main->GET("EnableSubmission");
    $TrustMyNetwork = $main->GET("TrustMyNetwork");
    if (!is_numeric($TrustMyNetwork)) {
        $TrustMyNetwork = 1;
    }
    $EnableSasl = $main->GET("EnableSasl");
    $sasl = Paragraphe_switch_img('{sasl_title}', '{sasl_intro}', 'EnableSasl', $EnableSasl, '{enable_disable}', 300);
    if ($PostfixMultiCreateBubble == 1) {
        $TrustMyNetwork = "<input type=hidden id='TrustMyNetwork' name=\"TrustMyNetwork\" value='{$TrustMyNetwork}'>" . Paragraphe_switch_disable('{TrustMyNetwork}', '{TrustMyNetwork_text}<hr><i style=color:#9E0000>{PostfixMultiCreateBubbleIsEnabled}</i>', '{TrustMyNetwork_text}', 300);
    } else {
        $TrustMyNetwork = Paragraphe_switch_img('{TrustMyNetwork}', '{TrustMyNetwork_text}', 'TrustMyNetwork', $TrustMyNetwork, '{enable_disable}', 300);
    }
    $PostfixEnableSubmission_field = Paragraphe_switch_img('{PostfixEnableSubmission}', '{PostfixEnableSubmission_text}', 'EnableSubmission', $EnableSubmission, '{enable_disable}', 300);
    $old = "" . Paragraphe("64-settings-black.png", "{SASL_STATUS}", "{SASL_STATUS_TEXT}", "javascript:SaslStatus();") . "\n\t\t\t{$settings}\n\t\t\t{$smtpd_sasl_exceptions_networks}";
    $html = "\n\t<div id='sasl-id'>\n\t<table style='width:99%' class=form>\n\t<tbody>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t{$sasl}\n\t\t\t<div style='text-align:right'><hr>" . button("{apply}", "postfix_multi_enable_auth()", 16) . "</div>\n\t\t</td>\n\t<td valign='top'>\n\t\t{$TrustMyNetwork}\n\t\t<div style='text-align:right'><hr>" . button("{apply}", "postfix_multi_enable_auth()", 16) . "</div>\n\t</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2>\n\t\t{$PostfixEnableSubmission_field}\n\t\t<div style='text-align:right'><hr>" . button("{apply}", "postfix_multi_enable_auth()", 16) . "</div>\n\t</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'postfix.sasl.php');
}
Esempio n. 2
0
function MAIN_STATUS_MIDDLE()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $t = time();
    $EnableNginx = intval($sock->GET_INFO("EnableNginx"));
    $EnableFreeWeb = intval($sock->GET_INFO("EnableFreeWeb"));
    $EnableNginxMail = intval($sock->GET_INFO("EnableNginxMail"));
    $SQUIDEnable = trim($sock->GET_INFO("SQUIDEnable"));
    $users = new usersMenus();
    if (!is_numeric($SQUIDEnable)) {
        $SQUIDEnable = 1;
    }
    $p1 = Paragraphe_switch_img("{enable_reverse_proxy_service}", "{enable_reverse_proxy_service_explain}", "EnableNginx-{$t}", $EnableNginx, null, 1072);
    $p2 = Paragraphe_switch_disable("{enable_reverse_imap_proxy_service}", "{enable_reverse_imap_proxy_service_explain}", "EnableNginxMail-{$t}", $EnableNginxMail, null, 1072);
    $p3 = Paragraphe_switch_img("{enable_freeweb}", "{enable_freeweb_text}", "EnableFreeWeb-{$t}", $EnableFreeWeb, null, 1072);
    if ($users->SQUID_INSTALLED) {
        $p4 = Paragraphe_switch_img("{enable_squid_service}", "{enable_squid_service_explain}<br>{enable_squid_service_text}", "SQUIDEnable-{$t}", $SQUIDEnable, null, 1072);
    }
    $p2 = "<br>{$p2}";
    $p2 = null;
    $html = "{$p1}<br>{$p3}<br>{$p4}{$p2}<hr>\n\t<div style='text-align:right;width:98%'>" . button("{apply}", "Save{$t}()", 40) . "</div>\n\t<script>\n\t\t\t\n\tvar xSave{$t}=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tLoadjs('nginx.verif.progress.php');\n\t\t}\t\n\t\t\n\t\tfunction Save{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n    \t\tXHR.appendData('EnableFreeWeb',document.getElementById('EnableFreeWeb-{$t}').value);\n    \t\tXHR.appendData('EnableNginx',document.getElementById('EnableNginx-{$t}').value);\n    \t\tif(document.getElementById('EnableNginxMail-{$t}')){\n    \t\t\tXHR.appendData('EnableNginxMail',document.getElementById('EnableNginxMail-{$t}').value);\n    \t\t}\n    \t\tif(document.getElementById('SQUIDEnable-{$t}')){\n    \t\t\tXHR.appendData('SQUIDEnable',document.getElementById('SQUIDEnable-{$t}').value);\n    \t\t}\n    \t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\t\t\n\t\t}\n\t</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 3
0
function popup()
{
    $sock = new sockets();
    $EnableKav4Samba = $sock->GET_INFO('EnableKav4Samba');
    $EnableScannedOnly = $sock->GET_INFO('EnableScannedOnly');
    $EnableSambaXapian = $sock->GET_INFO('EnableSambaXapian');
    if ($EnableKav4Samba == null) {
        $EnableKav4Samba = 1;
    }
    if ($EnableScannedOnly == null) {
        $EnableScannedOnly = 1;
    }
    if ($EnableSambaXapian == null) {
        $EnableSambaXapian = 1;
    }
    $users = new usersMenus();
    if ($users->KAV4SAMBA_INSTALLED) {
        $kav = Paragraphe_switch_img('{enable_kaspersky_samba}', '{enable_kaspersky_samba_text}', 'EnableKav4Samba', $EnableKav4Samba, '{enable_disable}', 290);
    } else {
        $kav = Paragraphe_switch_disable('{enable_kaspersky_samba}', '{feature_not_installed}', '{feature_not_installed}', 290);
    }
    if ($users->SCANNED_ONLY_INSTALLED) {
        $SCANNED_ONLY_INSTALLED = Paragraphe_switch_img('{enable_scanned_only}', '{enable_scanned_only_text}', 'EnableScannedOnly', $EnableScannedOnly, '{enable_disable}', 290);
    } else {
        $SCANNED_ONLY_INSTALLED = Paragraphe_switch_disable('{enable_scanned_only}', '{feature_not_installed}', '{feature_not_installed}', 290);
    }
    if ($users->XAPIAN_PHP_INSTALLED) {
        $XAPIAN_INSTALLED = Paragraphe_switch_img('{enable_xapian_indexing}', '{enable_xapian_indexing_text}', 'EnableSambaXapian', $EnableSambaXapian, '{enable_disable}', 290);
    }
    $html = "<H1>{APP_SAMBA} {plugins}</H1>\n\t<p class=caption style='font-size:13px'>{vfs_modules_disabled_text}</p>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$kav}</TD>\n\t\t<td valign='top'>{$SCANNED_ONLY_INSTALLED}</TD>\n\t</TR>\n\t<tr>\n\t\t<td valign='top'>{$XAPIAN_INSTALLED}</TD>\n\t\t<td valign='top'>&nbsp;</TD>\n\t</TR>\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>\n\t\t" . button("{edit}", "SaveSambaPlugins()") . "\n\t\t\n\t</tr>\n\t</TABLE>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 4
0
function popup()
{
    $uid = $_GET["uid"];
    $user = new user($uid);
    $sock = new sockets();
    $ApacheGroupware = $sock->GET_INFO("ApacheGroupware");
    if ($ApacheGroupware == null) {
        $ApacheGroupware = 1;
    }
    $field = Paragraphe_switch_disable("{ACTIVATE_THIS_USER_WEBDAV}", "{APP_GROUPWARE_APACHE_DISABLED_TEXT}", null, 330);
    $field = Paragraphe_switch_img("{ACTIVATE_THIS_USER_WEBDAV}", "{ACTIVATE_THIS_USER_WEBDAV_TEXT}", "WebDavUser", $user->WebDavUser, 330);
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/webdav-128.png' id='webdav-image'></td>\n\t<td valing='top'>\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td>{$field}</td>\n\t</tr>\n\t<tr>\n\t<tr>\n\t\t<td align='right'><hr>" . button("{apply}", "SaveWebDavEnabledUser()") . "</td>\n\t</tr>\n\t</table>\t\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 5
0
function popup()
{
    $sock = new sockets();
    $EnableKav4Samba = $sock->GET_INFO('EnableKav4Samba');
    $EnableScannedOnly = $sock->GET_INFO('EnableScannedOnly');
    $EnableSambaXapian = $sock->GET_INFO('EnableSambaXapian');
    if ($EnableKav4Samba == null) {
        $EnableKav4Samba = 1;
    }
    if ($EnableScannedOnly == null) {
        $EnableScannedOnly = 1;
    }
    if ($EnableSambaXapian == null) {
        $EnableSambaXapian = 1;
    }
    $EnableGreyhole = $sock->GET_INFO('EnableGreyhole');
    if (!is_numeric($EnableGreyhole)) {
        $EnableGreyhole = 1;
    }
    $users = new usersMenus();
    if ($users->KAV4SAMBA_INSTALLED) {
        $kav = Paragraphe_switch_img('{enable_kaspersky_samba}', '{enable_kaspersky_samba_text}', 'EnableKav4Samba', $EnableKav4Samba, '{enable_disable}', 290);
    } else {
        $kav = Paragraphe_switch_disable('{enable_kaspersky_samba}', '{feature_not_installed}', '{feature_not_installed}', 290);
    }
    if ($users->SCANNED_ONLY_INSTALLED) {
        $SCANNED_ONLY_INSTALLED = Paragraphe_switch_img('{enable_scanned_only}', '{enable_scanned_only_text}', 'EnableScannedOnly', $EnableScannedOnly, '{enable_disable}', 290);
    } else {
        $SCANNED_ONLY_INSTALLED = Paragraphe_switch_disable('{enable_scanned_only}', '{feature_not_installed}', '{feature_not_installed}', 290);
    }
    if ($users->GREYHOLE_INSTALLED) {
        $GREYHOLE = Paragraphe_switch_img('{enable_grehole}', '{enable_grehole_text}', 'EnableGreyhole', $EnableGreyhole, '{enable_disable}', 290);
    } else {
        $GREYHOLE = Paragraphe_switch_disable('{enable_grehole}', '{feature_not_installed}', '{feature_not_installed}', 290);
    }
    $html = "\n\t<div class=explain>{vfs_modules_disabled_text}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$kav}</TD>\n\t\t<td valign='top'>{$SCANNED_ONLY_INSTALLED}</TD>\n\t</TR>\n\t<tr>\n\t\t<td valign='top'>{$GREYHOLE}</TD>\n\t\t<td valign='top'>{$XAPIAN_INSTALLED}</TD>\n\t\t\n\t</TR>\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>\n\t\t" . button("{apply}", "SaveSambaPlugins()", 16) . "\n\t\t\n\t</tr>\n\t</TABLE>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 6
0
function popup()
{
    $infos = infos();
    $sock = new sockets();
    $page = CurrentPageName();
    $alx = $sock->getFrameWork("system.php?modinfo=alx");
    $ModeProbeAlx = intval($sock->GET_INFO("ModeProbeAlx"));
    $q = new mysql();
    $DIVS = array();
    $js = array();
    if ($q->TABLE_EXISTS("RXTX_HOUR", "artica_events")) {
        $results = $q->QUERY_SQL("SELECT ETH FROM RXTX_HOUR GROUP BY ETH", "artica_events");
        while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
            $ETH = $ligne["ETH"];
            $nic = new system_nic($ETH);
            $DIVS[] = "<hr><div style='font-size:30px;margin-top:20px'>{$ETH} [{$nic->IPADDR}] - {$nic->NICNAME} - {$nic->netzone}</div>";
            $DIVS[] = "<div style='width:1460px;height:350px' id='{$ETH}-RX-hour' class=form></div>";
            $DIVS[] = "<div style='width:1460px;height:350px' id='{$ETH}-TX-hour' class=form></div>";
            $DIVS[] = "<div style='width:1460px;height:350px' id='{$ETH}-RX-week' class=form></div>";
            $DIVS[] = "<div style='width:1460px;height:350px' id='{$ETH}-TX-week' class=form></div>";
            $js[] = "Loadjs('{$page}?eth-hour=yes&type=RX&ETH={$ETH}')";
            $js[] = "Loadjs('{$page}?eth-hour=yes&type=TX&ETH={$ETH}')";
            $js[] = "Loadjs('{$page}?eth-week=yes&type=RX&ETH={$ETH}')";
            $js[] = "Loadjs('{$page}?eth-week=yes&type=TX&ETH={$ETH}')";
        }
    }
    $t = time();
    if ($alx == "TRUE") {
        $alxform = Paragraphe_switch_img("{qualcomm_atheros}", "{qualcomm_atheros_explain}", "ModeProbeAlx", $ModeProbeAlx, null, 1450);
    } else {
        $alxform = Paragraphe_switch_disable("{qualcomm_atheros}", "{qualcomm_atheros_explain}", "ModeProbeAlx", 0, null, 1450);
    }
    //$gateway=Paragraphe('relayhost.png','{APP_ARTICA_GAYTEWAY}','{APP_ARTICA_GAYTEWAY_TEXT}',"javascript:Loadjs('index.gateway.php?script=yes')");
    $html = "\n\t<div style='width:98%' class=form>\n\t{$alxform}\t\t\n\t{$gateway}\n\t<div style='margin-top:20px;text-align:right'><hr>" . button("{apply}", "Save{$t}()", 32) . "</div>\n\t</div>\n\t\n\t<div style='width:98%' class=form>\n\t<div style='font-size:26px;font-weight:bold'>{network_hardware_infos_text}</div>\n\t<br>\n\t<div style='width:98%;height:300px;overflow:auto;'>{$infos}</div>\n\t</div>\n\t" . @implode("\n", $DIVS) . "\n<script>\nvar xSave{$t}=function (obj) {\n\tLoadjs('network.restart.php');\n}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ModeProbeAlx',document.getElementById('ModeProbeAlx').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n" . @implode("\n", $js) . "\n</script>\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 7
0
function config()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $EnableDropBox = $sock->GET_INFO("EnableDropBox");
    $EnableShareDropBox = $sock->GET_INFO("EnableShareDropBox");
    if ($EnableDropBox == null) {
        $EnableDropBox = 0;
    }
    if ($EnableShareDropBox == null) {
        $EnableShareDropBox = 0;
    }
    $DropBoxShareProperties = unserialize(base64_decode($sock->GET_INFO("DropBoxShareProperties")));
    if ($DropBoxShareProperties["ShareDropBoxName"] == null) {
        $DropBoxShareProperties["ShareDropBoxName"] = "dropbox";
    }
    $enableShare = Paragraphe_switch_disable("{share_dropbox_path}", "{share_dropbox_path_text}", null, 300);
    $enable = Paragraphe_switch_img("{enable_dropbox_service}", "{dropbox_service_text}", "EnableDropBox", $EnableDropBox, null, 300);
    $users = new usersMenus();
    if ($users->SAMBA_INSTALLED) {
        $samba = new samba();
        $folder_name = $samba->GetShareName("/home/dropbox");
        if ($folder_name != null) {
            $EnableShareDropBox = 1;
            $share = Paragraphe("disk_share_enable-64.png", "{smb_infos}", "{folder_properties}", "javascript:FolderProp('{$folder_name}');");
            if ($folder_name != $DropBoxShareProperties["ShareDropBoxName"]) {
                $DropBoxShareProperties["ShareDropBoxName"] = $folder_name;
            }
        } else {
            $EnableShareDropBox = 0;
        }
        $enableShare = Paragraphe_switch_img("{share_dropbox_path}", "{share_dropbox_path_text}", "EnableShareDropBox", $EnableShareDropBox, null, 300);
    }
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$enable}</td>\n\t<td valign='top'>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t<td valign='top'>{$enableShare}</td>\n\t<td valign='top'>{$share}</td>\n\t</tr>\n\t</table>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{share_name}:</td>\n\t\t<td>" . Field_text("ShareDropBoxName", $DropBoxShareProperties["ShareDropBoxName"], "font-size:13px;padding:3px;width:190px") . "</td>\n\t</tr>\n\t</table>\n\t\n\t\n\t<div style='text-align:right'><hr>" . button("{apply}", "SaveDropBoxConfig()") . "</div>\n\t\n\t<script>\n\t\n\tvar X_SaveDropBoxConfig= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\tRefreshTab('main_dropbox_config');\n\t}\t\n\tfunction SaveDropBoxConfig(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('ShareDropBoxName',document.getElementById('ShareDropBoxName').value);\n\t\t\tXHR.appendData('EnableDropBox',document.getElementById('EnableDropBox').value);\n\t\t\tdocument.getElementById('img_EnableDropBox').src='img/wait_verybig.gif';\n\t\t\tif(document.getElementById('EnableShareDropBox')){\n\t\t\t\tXHR.appendData('EnableShareDropBox',document.getElementById('EnableDropBox').value);\n\t\t\t\tdocument.getElementById('img_EnableShareDropBox').src='img/wait_verybig.gif';\n\t\t\t}\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',X_SaveDropBoxConfig);\t\n\t}\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 8
0
function popup()
{
    $tpl = new templates();
    $t = time();
    $page = CurrentPageName();
    $sock = new sockets();
    $AsSquidLoadBalancer = $sock->GET_INFO("AsSquidLoadBalancer");
    if (!is_numeric($AsSquidLoadBalancer)) {
        $AsSquidLoadBalancer = 0;
    }
    $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance");
    if (!is_numeric($EnableWebProxyStatsAppliance)) {
        $EnableWebProxyStatsAppliance = 0;
    }
    if ($users->WEBSTATS_APPLIANCE) {
        $EnableWebProxyStatsAppliance = 1;
    }
    $switch = Paragraphe_switch_img("{activate_loadbalancing}", "{activate_loadbalancing_text}", "AsSquidLoadBalancer", $AsSquidLoadBalancer, null, 400);
    if ($EnableWebProxyStatsAppliance == 1) {
        $switch = Paragraphe_switch_disable("{activate_loadbalancing}", "{activate_loadbalancing_text}", "", 400);
    }
    $html = "\n\t<div id='{$t}-div'></div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td>{$switch}</td>\n\t</tr>\n\t<tr>\n\t\t<td  align='right'><hr>" . button("{apply}", "SaveLoadBalance{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\n\t\n\t\n\t\n\t\n\t<script>\n\tvar x_SaveLoadBalance{$t}=function(obj){\n     \tvar tempvalue=obj.responseText;\n      \tif(tempvalue.length>5){alert(tempvalue);}\n      \tCacheOff();\n      \tQuickLinkSystems('section_architecture');\n      \tYahooWin3Hide();\n     \t}\t\n\n\tfunction SaveLoadBalance{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('AsSquidLoadBalancer',document.getElementById('AsSquidLoadBalancer').value);\n\t\t\tAnimateDiv('{$t}-div');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveLoadBalance{$t});\t\t\n\t}\t\t\n\t\t\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 9
0
function altermime_articafilter_failed()
{
    $level = Paragraphe_switch_disable('{APP_ALTERMIME}', "{APP_ARTICA_FILTER_NOT_ENABLED}", "{APP_ARTICA_FILTER_NOT_ENABLED}");
    $activate = Paragraphe('64-folder-install.png', '{AS_ACTIVATE}', '{AS_ACTIVATE_TEXT}', "javascript:Loadjs('postfix.index.php?script=antispam')", null, 210, null, 0, true);
    $tpl = new templates();
    $html = "<H1>{disclaimer}</H1>\n\t<p class=caption>{disclaimer_text}</p>\n\t<table style='widht:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t<div id='sanesecuid'>\n\t\t\t{$level}\n\t\t\t</div>\n\t\t</td>\n\t\t<td valign='top'>{$activate}</td>\n\t</tr>";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 10
0
function parameters_main()
{
    $squid = new squidbee();
    $page = CurrentPageName();
    $sslbumb = false;
    $users = new usersMenus();
    if (preg_match("#^([0-9]+)\\.([0-9]+)#", $users->SQUID_VERSION, $re)) {
        if ($re[1] >= 3) {
            if ($re[2] >= 1) {
                $sslbumb = true;
            }
        }
    }
    $enableSSLBump = Paragraphe_switch_img("{activate_ssl_bump}", "{activate_ssl_bump_text}", "EnableSSLBump", $squid->SSL_BUMP, null, 450);
    if (!$sslbumb) {
        $enableSSLBump = Paragraphe_switch_disable("{wrong_squid_version}: &laquo;{$users->SQUID_VERSION}&raquo;", "{wrong_squid_version_feature_text}", null, 450);
    }
    $html = "\n\t<div style='font-size:14px' id='sslbumpdiv'></div>\n\t{$enableSSLBump}\n\t<hr>\n\t<div style='text-align:right'>" . button("{apply}", "SaveEnableSSLDump()") . "</div>\n\t\n\t<script>\n\t\tvar x_SaveEnableSSLDump=function(obj){\n     \t var tempvalue=obj.responseText;\n      \tif(tempvalue.length>3){alert(tempvalue);}\n     \tdocument.getElementById('EnableSSLBump').innerHTML='';\n     \tRefreshTab('main_config_sslbump');\n     \n      \n      }\t\n\n\tfunction SaveEnableSSLDump(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(!document.getElementById('EnableSSLBump')){return;}\n\t\tXHR.appendData('EnableSSLBump',document.getElementById('EnableSSLBump').value);\n\t\tdocument.getElementById('sslbumpdiv').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveEnableSSLDump);\t\t\n\t\n\t}\n\t</script>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 11
0
function antispam_popup()
{
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $sock = new sockets();
    $EnableArticaSMTPFilter = $sock->GET_INFO("EnableArticaSMTPFilter");
    $EnableArticaSMTPFilter = 0;
    $EnableArticaPolicyFilter = $sock->GET_INFO("EnableArticaPolicyFilter");
    $EnableArticaPolicyFilter = 0;
    $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
    $amavis = Paragraphe_switch_disable('{enable_amavis}', '{feature_not_installed}', '{feature_not_installed}');
    $amavis_disabled = Paragraphe_switch_disable('{enable_amavis}', '{feature_not_installed}', '{feature_not_installed}');
    $assp = Paragraphe_switch_disable('{enable_assp}', '{feature_not_installed}', '{feature_not_installed}');
    if ($users->SPAMASS_MILTER_INSTALLED) {
        $spamassin = Paragraphe_switch_img('{enable_spamasssin}', '{enable_spamasssin_text}', 'enable_spamassassin', $users->SpamAssMilterEnabled, '{enable_disable}', 290);
    } else {
        $spamassin = Paragraphe_switch_disable('{enable_spamasssin}', '{feature_not_installed}', '{feature_not_installed}');
    }
    if ($users->AMAVIS_INSTALLED) {
        $amavis = Paragraphe_switch_img('{enable_amavis}', '{enable_amavis_text}', 'enable_amavis', $users->EnableAmavisDaemon, '{enable_disable}', 290);
        if ($users->EnableAmavisDaemon == 1) {
            $spamassin = Paragraphe_switch_disable('{spamassassin_in_amavis}', '{spamassassin_in_amavis_text}', '{spamassassin_in_amavis_text}');
        }
    }
    //$artica=Paragraphe_switch_img('{enable_artica_filter}','{enable_artica_filter_text}','EnableArticaSMTPFilter',$EnableArticaSMTPFilter,'{enable_disable}',290);
    //$artica_policy=Paragraphe_switch_img('{enable_artica_policy}','{enable_artica_policy_text}','EnableArticaPolicyFilter',$EnableArticaPolicyFilter,'{enable_disable}',290);
    if ($users->ASSP_INSTALLED) {
        $sock = new sockets();
        $EnableASSP = $sock->GET_INFO('EnableASSP');
        $assp = Paragraphe_switch_img('{enable_assp}', '{enable_assp_text}', 'EnableASSP', $EnableASSP, '{enable_disable}', 290);
    }
    if ($users->MILTERGREYLIST_INSTALLED) {
        $miltergreylist = Paragraphe_switch_img('{APP_MILTERGREYLIST}', '{enable_miltergreylist_text}', 'MilterGreyListEnabled', $users->MilterGreyListEnabled, '{enable_disable}', 290);
    } else {
        $miltergreylist = Paragraphe_switch_disable('{APP_MILTERGREYLIST}', '{feature_not_installed}', '{feature_not_installed}');
    }
    if ($users->KAV_MILTER_INSTALLED) {
        $kavmilter = Paragraphe_switch_img('{APP_KAVMILTER}', '{enable_kavmilter_text}', 'kavmilterEnable', $users->KAVMILTER_ENABLED, '{enable_disable}', 290);
    } else {
        $kavmilter = Paragraphe_switch_disable('{APP_KAVMILTER}', '{feature_not_installed}', '{feature_not_installed}');
    }
    if ($users->kas_installed) {
        $kaspersky = Paragraphe_switch_img('{enable_kaspersky_as}', '{enable_kaspersky_as_text}', 'enable_kaspersky_as', $users->KasxFilterEnabled, '{enable_disable}', 290);
    } else {
        $kaspersky = Paragraphe_switch_disable('{enable_kaspersky_as}', '{feature_not_installed}', '{feature_not_installed}');
    }
    if (!$users->MEM_HIGER_1G) {
        $amavis = Paragraphe_switch_disable('{enable_amavis}', '{ressources_insuffisantes}', '{ressources_insuffisantes}');
        $spamassin = Paragraphe_switch_disable('{enable_spamasssin}', '{ressources_insuffisantes}', '{ressources_insuffisantes}');
    }
    if ($EnablePostfixMultiInstance == 1) {
        $spamassin = Paragraphe_switch_disable('{enable_spamasssin}', '{feature_disabled_multiple_postfix_instances_enabled}', '{feature_disabled_multiple_postfix_instances_enabled}');
        $miltergreylist = Paragraphe_switch_disable('{APP_MILTERGREYLIST}', '{feature_disabled_multiple_postfix_instances_enabled}', '{feature_disabled_multiple_postfix_instances_enabled}');
        $assp = Paragraphe_switch_disable('{enable_assp}', '{feature_disabled_multiple_postfix_instances_enabled}', '{feature_disabled_multiple_postfix_instances_enabled}');
        $spamassin = null;
        $miltergreylist = null;
        $assp = null;
    }
    if ($users->KASPERSKY_SMTP_APPLIANCE) {
        $amavis = $amavis_disabled;
        $spamassin = null;
        $assp = null;
    }
    if ($users->CLUEBRINGER_INSTALLED) {
        $EnableCluebringer = $sock->GET_INFO("EnableCluebringer");
        $Cluebringer = Paragraphe_switch_img('{APP_CLUEBRINGER}', '{enable_cluebringer_text}', 'EnableCluebringer', $EnableCluebringer, '{enable_disable}', 290);
    }
    $html = "\n\t\n\t<div style='width:100%;height:400px;overflow:auto'>\n\t<table style='width:99%' class=form>\n\t<td valign='top' width=50%>\n\t\t{$kaspersky}<br>{$kavmilter}<br>{$amavis}<br>{$spamassin}\n\t</td>\n\t<td valign='top' width=50%>\n   \t\t{$miltergreylist}<br>{$assp}<br>{$Cluebringer}<br>{$artica}<br>{$artica_policy}\n\t</td>\n\t</tr>\n\t<tr>\n\t</table>\n\t</div>\n\t<div style='width:100%;text-align:right'><hr>" . button("{apply}", "ApplyKasSpamas()", 18) . "</div>\n\t";
    $tpl = new templates();
    $html = $tpl->_ENGINE_parse_body($html, 'postfix.plugins.php');
    echo $html;
}
Esempio n. 12
0
function logfile_daemon_popup(){
	$page=CurrentPageName();
	$tpl=new templates();
	$sock=new sockets();
	
	$SquidPerformance=intval($sock->GET_INFO("SquidPerformance"));
	if($SquidPerformance>1){
		echo $tpl->_ENGINE_parse_body(FATAL_WARNING_SHOW_128("{artica_statistics_disabled_see_performance}"));
		return;
	}
	
	$RemoteUfdbCat=intval($sock->GET_INFO("RemoteUfdbCat"));
	
	
	$t=time();
	$DisableLogFileDaemonMySQL=intval($sock->GET_INFO("DisableLogFileDaemonMySQL"));
	$DisableLogFileDaemonCategories=intval($sock->GET_INFO("DisableLogFileDaemonCategories"));
	$DisableLogFileDaemonCategories_INV=1;
	$DisableLogFileDaemonMySQL_INV=1;
	
	
	
	if($DisableLogFileDaemonCategories==1){
		$DisableLogFileDaemonCategories_INV=0;
	}
	
	if($DisableLogFileDaemonMySQL==1){
		$DisableLogFileDaemonMySQL_INV=0;
	}	
	
	
	$detect_categories=Paragraphe_switch_img("{detect_categories}", "{logfile_detect_categories}","DisableLogFileDaemonCategories",$DisableLogFileDaemonCategories_INV,null,750);
	
	
	if($SquidPerformance>0){
		$detect_categories=Paragraphe_switch_disable("{detect_categories}", "{logfile_detect_categories}","DisableLogFileDaemonCategories",$DisableLogFileDaemonCategories_INV,null,750);
		$explain_RemoteUfdbCat="<div style='font-size:18px' class=text-info>{explain_SquidPerformance_nocat}</div>";
	}
	
	if($RemoteUfdbCat==1){
		$detect_categories=Paragraphe_switch_disable("{detect_categories}", "{logfile_detect_categories}","DisableLogFileDaemonCategories",$DisableLogFileDaemonCategories_INV,null,750);
		$explain_RemoteUfdbCat="<div style='font-size:18px' class=text-info>{explain_RemoteUfdbCat}</div>";
	}
	
	
	$html="<div style='width:98%' class=form>$explain_RemoteUfdbCat
	".Paragraphe_switch_img("{direct_to_mysql}", "{logfile_direct_to_mysql_explain}","DisableLogFileDaemonMySQL",$DisableLogFileDaemonMySQL_INV,null,750)
	."$detect_categories
	 <div style='width:100%;text-align:right;margin-top:20px'><hr>".button("{apply}","Save$t()",26)."</div>
<script>
var xSave$t= function (obj) {
	var res=obj.responseText;
	if (res.length>3){alert(res);return;}
	YahooWin2Hide();
	Loadjs('squid.reconfigure.simple.php');
}
function SaveCK$t(e){
	if(!checkEnter(e)){return;}
	Save$t();
}

function Save$t(){
	var XHR = new XHRConnection();
	XHR.appendData('DisableLogFileDaemonMySQL',document.getElementById('DisableLogFileDaemonMySQL').value);
	XHR.appendData('DisableLogFileDaemonCategories',document.getElementById('DisableLogFileDaemonCategories').value);
	XHR.sendAndLoad('$page', 'POST',xSave$t);
}				
</script>
";
	
	
	echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 13
0
function global_parameters()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $users = new usersMenus();
    $DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    $CacheReplacementPolicy = $sock->GET_INFO("CacheReplacementPolicy");
    $DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
    if ($CacheReplacementPolicy == null) {
        $CacheReplacementPolicy = "heap_LFUDA";
    }
    $SquidDebugCacheProc = $sock->GET_INFO("SquidDebugCacheProc");
    $ForceWindowsUpdateCaching = $sock->GET_INFO("ForceWindowsUpdateCaching");
    $ProxyDedicateMicrosoftRules = $sock->GET_INFO("ProxyDedicateMicrosoftRules");
    $DisableSquidSMP = intval($sock->GET_INFO("DisableSquidSMP"));
    if ($DisableSquidSMP == 0) {
        $EnableSQUIDSMP = 1;
    } else {
        $EnableSQUIDSMP = 0;
    }
    $SquidSimpleConfig = $sock->GET_INFO("SquidSimpleConfig");
    if (!is_numeric($SquidSimpleConfig)) {
        $SquidSimpleConfig = 1;
    }
    $SquidCacheLevel = $sock->GET_INFO("SquidCacheLevel");
    if (!is_numeric($SquidCacheLevel)) {
        $SquidCacheLevel = 4;
    }
    $compilefile = "ressources/logs/squid.compilation.params";
    if (!is_file($compilefile)) {
        $sock->getFrameWork("squid.php?compil-params=yes");
    }
    $COMPILATION_PARAMS = unserialize(base64_decode(@file_get_contents($compilefile)));
    $SquidReloadIntoIMS = $sock->GET_INFO("SquidReloadIntoIMS");
    $license_error = null;
    $refresh_pattern_def_min = $sock->GET_INFO("refresh_pattern_def_min");
    $refresh_pattern_def_max = $sock->GET_INFO("refresh_pattern_def_max");
    $refresh_pattern_def_perc = $sock->GET_INFO("refresh_pattern_def_perc");
    if (!is_numeric($refresh_pattern_def_min)) {
        $refresh_pattern_def_min = 4320;
    }
    if (!is_numeric($refresh_pattern_def_max)) {
        $refresh_pattern_def_min = 43200;
    }
    if (!is_numeric($refresh_pattern_def_perc)) {
        $refresh_pattern_def_perc = 40;
    }
    if (!is_numeric($SquidDebugCacheProc)) {
        $SquidDebugCacheProc = 0;
    }
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    if (!is_numeric($ForceWindowsUpdateCaching)) {
        $ForceWindowsUpdateCaching = 0;
    }
    if (!is_numeric($ProxyDedicateMicrosoftRules)) {
        $ProxyDedicateMicrosoftRules = 0;
    }
    if (!is_numeric($SquidReloadIntoIMS)) {
        $SquidReloadIntoIMS = 1;
    }
    $squid = new squidbee();
    $t = time();
    $array["lru"] = "{cache_lru}";
    $array["heap_GDSF"] = "{heap_GDSF}";
    $array["heap_LFUDA"] = "{heap_LFUDA}";
    $array["heap_LRU"] = "{heap_LRU}";
    $read_ahead_gap = $squid->global_conf_array["read_ahead_gap"];
    $cache_mem = $squid->global_conf_array["cache_mem"];
    if (preg_match("#([0-9]+)\\s+#", $cache_mem, $re)) {
        $cache_mem = $re[1];
    }
    $minimum_object_size = $squid->global_conf_array["minimum_object_size"];
    if (preg_match("#([0-9]+)\\s+#", $read_ahead_gap, $re)) {
        $read_ahead_gap = $re[1];
    }
    if (preg_match("#([0-9]+)\\s+#", $minimum_object_size, $re)) {
        $minimum_object_size = $re[1];
    }
    if (preg_match("#([0-9]+)#", $squid->global_conf_array["maximum_object_size"], $re)) {
        $maximum_object_size = $re[1];
        if (preg_match("#([A-Z]+)#", $squid->global_conf_array["maximum_object_size"], $re)) {
            $unit = $re[1];
        }
        if ($unit == "KB") {
            $maximum_object_size_in_memory = round($maximum_object_size_in_memory / 1024);
        }
    }
    $level = Paragraphe_switch_img('{DisableAnyCache} ({hard_drive})', "{DisableAnyCache_explain2}", "DisableAnyCache-{$t}", $DisableAnyCache, null, 850);
    if ($SquidCacheLevel == 0) {
        $level = Paragraphe_switch_disable('{DisableAnyCache}', "{DisableAnyCache_explain2}", "DisableAnyCache-{$t}", $DisableAnyCache, null, 850);
    }
    $DisableSquidSMPF = Paragraphe_switch_img("{EnableSQUIDSMP}", "{EnableSQUIDSMP_explain}", "EnableSQUIDSMP-{$t}", $EnableSQUIDSMP, null, 850);
    $CORP_LICENSE = 1;
    if (!$users->CORP_LICENSE) {
        $CORP_LICENSE = 0;
        $license_error = "<hr><i style='font-size:18px;color:#d32d2d;font-weight:bold'>" . $tpl->_ENGINE_parse_body("{license_error}") . "</i><hr>";
        $DisableSquidSMPF = Paragraphe_switch_disable('{EnableSQUIDSMP}', "{$license_error}{EnableSQUIDSMP_explain}", "EnableSQUIDSMP-{$t}", $EnableSQUIDSMP, null, 850);
    }
    $ForceWindowsUpdateCaching = Paragraphe_switch_img("{ForceWindowsUpdateCaching}", "{ForceWindowsUpdateCaching_explain}", "ForceWindowsUpdateCaching-{$t}", $ForceWindowsUpdateCaching, null, 850);
    $ProxyDedicateMicrosoftRules = Paragraphe_switch_img("{ProxyDedicateMicrosoftRules}", "{ProxyDedicateMicrosoftRules_explain}", "ProxyDedicateMicrosoftRules-{$t}", $ProxyDedicateMicrosoftRules, null, 850);
    $ForceWindowsUpdateCaching = null;
    $html = "\n\t<div id='animate-{$t}'></div>\n\t<div style='margin:10px;padding:10px;width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t<td colspan=3 style='margin-bottom:15px;vertical-align:top'>{$DisableSquidSMPF}</td>\n\t</tr>\t\n\t<tr>\n\t<td colspan=3 style='margin-bottom:15px;vertical-align:top'>{$level}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=3 style='margin-bottom:15px;vertical-align:top'>{$ProxyDedicateMicrosoftRules}</td>\n\t</tr>\n\t<tr><td colspan=3 style='text-align:right'><hr>" . button("{apply}", "Save{$t}()", 36) . "</td><tr>\n\t<tr><td colspan=3 style='padding-bottom:50px;vertical-align:top'><p>&nbsp;</p></td></tr>\n\t<td colspan=3 style='margin-bottom:15px;vertical-align:top;font-size:42px'>{advanced_options}</td>\n\t</tr>\t\n\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' width=99%>{central_memory}:</td>\n\t\t<td style='font-size:22px'>" . Field_text("cache_mem-{$t}", $cache_mem, "font-size:22px;width:110px") . "&nbsp;MB</td>\n\t\t<td style='font-size:16px' width=1%>" . help_icon("{cache_mem_text}") . "</td>\n\t</tr>\t\t\t\n<tr><td colspan=3><hr></td></tr>\t\t\t\n\t<tr>\n\t<td class=legend style='font-size:22px'>{cache_replacement_policy}:</td>\n\t<td>" . Field_array_Hash($array, "CacheReplacementPolicy-{$t}", $CacheReplacementPolicy, null, null, 0, "font-size:22px") . "</td>\n\t<td width=1%>" . help_icon('{cache_replacement_policy_explain}', true) . "</td>\n\t</tr>\n\t\t\t\n\t<tr>\n\t\t<td align='right' class=legend nowrap style='font-size:22px'>{cache_swap_low}:</strong></td>\n\t\t<td style='font-size:22px'>" . Field_text("cache_swap_low-{$t}", $squid->global_conf_array["cache_swap_low"], 'width:110px;font-size:22px') . "&nbsp;%</td>\n\t\t<td>" . help_icon('{cache_swap_low_text}', false, 'squid.index.php') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' class=legend nowrap style='font-size:22px'>{cache_swap_high}:</strong></td>\n\t\t<td style='font-size:22px'>" . Field_text("cache_swap_high-{$t}", $squid->global_conf_array["cache_swap_high"], 'width:110px;font-size:22px') . "&nbsp;%</td>\n\t\t<td>" . help_icon('{cache_swap_high_text}', false, 'squid.index.php') . "</td>\n\t</tr>\t\t\t\n\t\t\t\n\t<tr><td colspan=3><hr></td></tr>\n\t\t\t\t\n\t\t\t\n\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{read_ahead_gap}:</td>\n\t\t<td style='font-size:18px'>" . Field_text("read_ahead_gap-{$t}", $read_ahead_gap, "font-size:22px;width:110px") . "&nbsp;MB</td>\n\t\t<td style='font-size:18px' width=1%>" . help_icon("{read_ahead_gap_text}") . "</td>\n\t</tr>\t\t\t\t\t\t\n\t<tr>\n\t<td style='font-size:22px' class=legend>{maximum_object_size}:</td>\n\t<td align='left' style='font-size:22px'>" . Field_text("maximum_object_size-{$t}", $maximum_object_size, 'width:110px;font-size:22px') . "&nbsp;MB</td>\n\t<td width=1%>" . help_icon('{maximum_object_size_text}', true) . "</td>\n\t</tr>\n\t\t\t\n<tr>\n\t\t<td align='right' class=legend nowrap style='font-size:22px'>{minimum_object_size}:</strong></td>\n\t\t<td align='left' style='font-size:18px'>" . Field_text("minimum_object_size-{$t}", $minimum_object_size, 'width:110px;font-size:22px') . "&nbsp;KB</td>\n\t\t<td>" . help_icon('{minimum_object_size_text}', false, 'squid.index.php') . "</td>\n</tr>\n<tr>\t\t\t\n\n\t<tr>\n\t<td style='font-size:22px' class=legend>{debug_cache_processing}:</td>\n\t<td align='left' style='font-size:22px'>" . Field_checkbox_design("SquidDebugCacheProc-{$t}", 1, $SquidDebugCacheProc) . "</td>\n\t<td width=1%></td>\n\t</tr>\t\n\t<tr><td colspan=3 style='text-align:right'><hr>" . button("{apply}", "Save{$t}()", 36) . "</td>\n\t</tr>\n\t\n\t\n\t\n\t</table>\n\t</div>\n\t\t\n\t<script>\n\t\n\tvar xSSave{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);}\n\t\t\tLoadjs('squid.compile.progress.php');\n\t\t}\t\t\n\n\t\tfunction Save{$t}(){\n\t\t\tvar SquidDebugCacheProc=0;\n\t\t\tvar CORP_LICENSE={$CORP_LICENSE};\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('DisableAnyCache',document.getElementById('DisableAnyCache-{$t}').value);\n\t\t\t\n\t\t\tXHR.appendData('ProxyDedicateMicrosoftRules',document.getElementById('ProxyDedicateMicrosoftRules-{$t}').value);\n\t\t\t\n\t\t\tif(document.getElementById('SquidDebugCacheProc-{$t}').checked){SquidDebugCacheProc=1;}\n\n\t\t\t\n\t\t\tif(CORP_LICENSE==1){\n\t\t\t\tXHR.appendData('EnableSQUIDSMP',document.getElementById('EnableSQUIDSMP-{$t}').value);\n\t\t\t}else{\n\t\t\t\tXHR.appendData('EnableSQUIDSMP',0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tXHR.appendData('cache_mem',document.getElementById('cache_mem-{$t}').value);\n\t\t\tXHR.appendData('minimum_object_size',document.getElementById('minimum_object_size-{$t}').value);\n\t\t\tXHR.appendData('cache_swap_high',document.getElementById('cache_swap_high-{$t}').value);\n\t\t\tXHR.appendData('cache_swap_low',document.getElementById('cache_swap_low-{$t}').value);\n\t\t\t\n\t\t\tXHR.appendData('read_ahead_gap',document.getElementById('read_ahead_gap-{$t}').value);\n\t\t\tXHR.appendData('CacheReplacementPolicy',document.getElementById('CacheReplacementPolicy-{$t}').value);\n\t\t\tXHR.appendData('maximum_object_size',document.getElementById('maximum_object_size-{$t}').value);\n\t\t\t\n\t\t\tXHR.appendData('SquidDebugCacheProc',SquidDebugCacheProc);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',xSSave{$t});\n\t\t}\n\t\t\n\t\tfunction CheckDisableAnyCache{$t}(){\n\t\t\tvar DisableAnyCache={$DisableAnyCache};\n\t\t\tvar SquidSimpleConfig={$SquidSimpleConfig};\n\t\t\t\n\t\t\tdocument.getElementById('SquidDebugCacheProc-{$t}').disabled=true;\n\t\t\tdocument.getElementById('CacheReplacementPolicy-{$t}').disabled=true;\n\t\t\tdocument.getElementById('maximum_object_size-{$t}').disabled=true;\n\t\t\t\n\t\t\tdocument.getElementById('read_ahead_gap-{$t}').disabled=true;\n\t\t\tdocument.getElementById('CacheReplacementPolicy-{$t}').disabled=true;\n\t\t\t\n\t\t\tif(SquidSimpleConfig==0){\n\t\t\t\tdocument.getElementById('read_ahead_gap-{$t}').disabled=false;\n\t\t\t\tdocument.getElementById('CacheReplacementPolicy-{$t}').disabled=false;\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(DisableAnyCache==0){\n\t\t\t\tdocument.getElementById('SquidDebugCacheProc-{$t}').disabled=false;\n\t\t\t\tif(SquidSimpleConfig==0){document.getElementById('CacheReplacementPolicy-{$t}').disabled=false;}\n\t\t\t\tdocument.getElementById('maximum_object_size-{$t}').disabled=false;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tCheckDisableAnyCache{$t}();\t\n\t\n\t</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 14
0
function plugins_popup()
{
    $squid = new squidbee();
    $users = new usersMenus();
    if ($users->KAV4PROXY_INSTALLED) {
        if ($squid->isicap()) {
            $kav = Paragraphe_switch_img("{enable_kavproxy}", "{enable_kavproxy_text}", 'enable_kavproxy', $squid->enable_kavproxy, '{enable_disable}', 250);
        } else {
            $kav = Paragraphe_switch_disable('{enable_kavproxy}', "{feature_not_installed}<br><strong style='color:#d32d2d'>{$squid->kav_accept_why}</strong>", '{feature_not_installed}');
        }
    }
    if ($users->C_ICAP_INSTALLED) {
        if ($users->SQUID_ICAP_ENABLED) {
            $cicap = Paragraphe_switch_img("{enable_c_icap}", "{enable_c_icap_text}", 'enable_c_icap', $squid->enable_cicap, '{enable_disable}', 250);
        }
    }
    if ($users->DANSGUARDIAN_INSTALLED) {
        $dans = Paragraphe_switch_img("{enable_dansguardian}", "{enable_dansguardian_text}", 'enable_dansguardian', $squid->enable_dansguardian, '{enable_disable}', 250);
    }
    if ($users->SQUIDGUARD_INSTALLED) {
        $squidguard = Paragraphe_switch_img("{enable_squidguard}", "{enable_squidguard_text}", 'enable_squidguard', $squid->enable_squidguard, '{enable_disable}', 250);
    }
    if ($users->APP_UFDBGUARD_INSTALLED) {
        $ufdbguardd = Paragraphe_switch_img("{enable_ufdbguardd}", "{enable_ufdbguardd_text}", 'enable_ufdbguardd', $squid->enable_UfdbGuard, '{enable_disable}', 250);
    }
    if ($users->ADZAPPER_INSTALLED) {
        //$adzapper=Paragraphe_switch_img('{enable_adzapper}','{enable_adzapper_text}','enable_adzapper',$squid->enable_adzapper,'{enable_disable}',250);
    }
    if ($users->APP_SQUIDCLAMAV_INSTALLED) {
        $squidclamav = Paragraphe_switch_img('{enable_squidclamav}', '{enable_squidclamav_text}', 'enable_squidclamav', $squid->enable_squidclamav, '{enable_disable}', 250);
    }
    if ($users->C_ICAP_INSTALLED) {
        if ($users->SQUID_ICAP_ENABLED) {
            if ($users->APP_KHSE_INSTALLED) {
                $metascanner = Paragraphe_switch_img('{enable_metascanner}', '{enable_metascanner_text}', 'enable_metascanner', $squid->enable_metascanner, '{enable_disable}', 250);
            }
        }
    }
    if ($users->KASPERSKY_WEB_APPLIANCE) {
        $cicap = null;
        $squidclamav = null;
        $squidguard = null;
        $adzapper = null;
    }
    $tr[] = $squidclamav;
    $tr[] = $metascanner;
    $tr[] = $cicap;
    $tr[] = $kav;
    $tr[] = $adzapper;
    $tr[] = $squidguard;
    $tr[] = $ufdbguardd;
    $tr[] = $dans;
    $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 >{$line}</td>";
        if ($t == 2) {
            $t = 0;
            $tables[] = "</tr><tr>";
        }
    }
    if ($t < 2) {
        for ($i = 0; $i <= $t; $i++) {
            $tables[] = "<td >&nbsp;</td>";
        }
    }
    $form = "<div id='div-poubelle'></div>\n\t\t " . implode("\n", $tables) . "\n\t\t</table> \t\n\t\t\t<div   style='text-align:right'><hr>" . button("{apply}", "save_plugins()") . "</div>\n\t\t\t\t\t\n\t\t";
    $html = "{$form}";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'squid.index.php');
}
Esempio n. 15
0
function status_list()
{
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $sock = new sockets();
    $tpl = new templates();
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $sock = new sockets();
    $EnableArticaSMTPFilter = $sock->GET_INFO("EnableArticaSMTPFilter");
    $EnableArticaSMTPFilter = 0;
    $EnableArticaPolicyFilter = $sock->GET_INFO("EnableArticaPolicyFilter");
    $EnableArticaPolicyFilter = 0;
    $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
    $amavis = Paragraphe_switch_disable('{enable_amavis}', '{feature_not_installed}', '{feature_not_installed}');
    $assp = Paragraphe_switch_disable('{enable_assp}', '{feature_not_installed}', '{feature_not_installed}');
    $main = new maincf_multi("master");
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $array["APP_POSTFWD2"]["INSTALLED"] = True;
    $array["APP_POSTFWD2"]["NAME"] = "APP_POSTFWD2";
    $array["APP_POSTFWD2"]["ENABLED"] = $array_filters["APP_POSTFWD2"];
    $array["APP_POSTFWD2"]["TEXT"] = "POSTFWD2_ABOUT";
    $array["APP_POSTFWD2"]["JS"] = "Loadjs('postfwd2.php?instance=master&with-popup=yes')";
    $array["MILTER_GREYLIST"]["INSTALLED"] = False;
    $array["MILTER_GREYLIST"]["NAME"] = "APP_MILTERGREYLIST";
    $array["AMAVISD"]["INSTALLED"] = False;
    $array["AMAVISD_MILTER"]["INSTALLED"] = False;
    $array["AMAVISD"]["NAME"] = "APP_AMAVISD_NEW";
    $array["SPAMASSASSIN"]["INSTALLED"] = False;
    $array["SPAMASS_MILTER"]["INSTALLED"] = False;
    $array["CLAMAV"]["INSTALLED"] = False;
    $array["APP_MILTER_DKIM"]["INSTALLED"] = False;
    $array["APP_MILTER_DKIM"]["NAME"] = "APP_MILTER_DKIM";
    $array["APP_MILTER_DKIM"]["TEXT"] = "dkim_about";
    $array["FRESHCLAM"]["INSTALLED"] = False;
    $array["FRESHCLAM"]["NAME"] = "APP_FRESHCLAM";
    $array["APP_CLUEBRINGER"]["INSTALLED"] = False;
    $array["DKIM_FILTER"]["INSTALLED"] = False;
    $array["DKIM_FILTER"]["NAME"] = "APP_DKIM_FILTER";
    $array["SPFMILTER"]["INSTALLED"] = False;
    $array["SPFMILTER"]["NAME"] = "APP_SPFMILTER";
    $array["APP_CLUEBRINGER"]["NAME"] = "APP_CLUEBRINGER";
    $array["MAILSPY"]["INSTALLED"] = False;
    $array["MAILSPY"]["NAME"] = "APP_MAILSPY";
    $array["KAVMILTER"]["INSTALLED"] = False;
    $array["KAS_MILTER"]["INSTALLED"] = False;
    $array["KAS3"]["INSTALLED"] = False;
    $array["BOGOM"]["INSTALLED"] = False;
    $array["BOGOM"]["NAME"] = "APP_BOGOM";
    $array["POLICYD_WEIGHT"]["INSTALLED"] = False;
    //$array["APP_ARTICA_POLICY"]["INSTALLED"]=False;
    $array["AMAVISD_MILTER"]["NAME"] = "APP_AMAVISD_MILTER";
    $array["KAS3"]["NAME"] = "APP_KAS3_MILTER";
    $array["SPAMASS_MILTER"]["NAME"] = "APP_SPAMASS_MILTER";
    $array["SPAMASSASSIN"]["NAME"] = "APP_SPAMASSASSIN";
    $array["KAVMILTER"]["NAME"] = "APP_KAVMILTER";
    $array["KAS_MILTER"]["NAME"] = "APP_KAS3_MILTER";
    $array["ASSP"]["INSTALLED"] = False;
    $array["ASSP"]["NAME"] = "APP_ASSP";
    if ($users->SPAMASS_MILTER_INSTALLED) {
        $array["SPAMASS_MILTER"]["INSTALLED"] = true;
        $array["SPAMASS_MILTER"]["TEXT"] = "feature_not_installed";
        $array["SPAMASS_MILTER"]["ENABLED"] = $users->SpamAssMilterEnabled;
        $array["SPAMASS_MILTER"]["TOKEN"] = "enable_spamassassin";
        $array["SPAMASS_MILTER"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
    }
    if ($users->DKIMFILTER_INSTALLED) {
        $array["DKIM_FILTER"]["INSTALLED"] = true;
    }
    if ($users->spamassassin_installed) {
        $APP_SPAMASSASSIN_TEXT = $tpl->_ENGINE_parse_body("{APP_SPAMASSASSIN_TEXT}");
        $spamassassin_in_amavis_text = $tpl->_ENGINE_parse_body("{spamassassin_in_amavis_text}");
        $array["SPAMASSASSIN"]["INSTALLED"] = True;
        $array["SPAMASSASSIN"]["TEXT"] = "{$APP_SPAMASSASSIN_TEXT}<br>{$spamassassin_in_amavis_text}";
        $array["SPAMASSASSIN"]["ENABLED"] = $users->EnableAmavisDaemon;
        $array["SPAMASSASSIN"]["LOCK"] = true;
        $array["SPAMASSASSIN"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
    } else {
        $array["SPAMASSASSIN"]["JS-INSTALL"] = "Loadjs('spamassassin.install.php');";
        //APP_SPAMASSASSIN
    }
    if ($users->AMAVIS_INSTALLED) {
        $array["AMAVISD"]["INSTALLED"] = true;
        $array["AMAVISD"]["TEXT"] = "enable_amavis_text";
        $array["AMAVISD"]["ENABLED"] = $users->EnableAmavisDaemon;
        $array["AMAVISD"]["TOKEN"] = "enable_amavis";
        $array["AMAVISD"]["JS"] = "Loadjs('amavis.index.php?ajax=yes')";
        //
        if ($users->EnableAmavisDaemon == 1) {
            $array["SPAMASS_MILTER"]["INSTALLED"] = true;
            $array["SPAMASS_MILTER"]["TEXT"] = "spamassassin_in_amavis_text";
            $array["SPAMASS_MILTER"]["ENABLED"] = 0;
            $array["SPAMASS_MILTER"]["LOCK"] = true;
        }
    } else {
        $array["AMAVISD"]["JS-INSTALL"] = "Loadjs('amavisd.install.php');";
    }
    if ($users->CLAMD_INSTALLED) {
        $EnableClamavDaemon = $sock->GET_INFO("EnableClamavDaemon");
        if (!is_numeric($EnableClamavDaemon)) {
            $EnableClamavDaemon = 0;
        }
        $EnableClamavDaemonForced = $sock->GET_INFO("EnableClamavDaemonForced");
        if (!is_numeric($EnableClamavDaemonForced)) {
            $EnableClamavDaemonForced = 0;
        }
        if ($EnableClamavDaemonForced == 1) {
            $EnableClamavDaemon = 1;
        }
        $array["CLAMAV"]["JS"] = "Loadjs('clamav.enable.php')";
        $array["CLAMAV"]["INSTALLED"] = True;
        $array["CLAMAV"]["ENABLED"] = $EnableClamavDaemon;
        $array["CLAMAV"]["TOKEN"] = "EnableClamavDaemon";
    }
    if ($users->MILTERGREYLIST_INSTALLED) {
        $array["MILTER_GREYLIST"]["INSTALLED"] = True;
        $array["MILTER_GREYLIST"]["TEXT"] = "enable_miltergreylist_text";
        $array["MILTER_GREYLIST"]["ENABLED"] = $users->MilterGreyListEnabled;
        $array["MILTER_GREYLIST"]["TOKEN"] = "MilterGreyListEnabled";
        $array["MILTER_GREYLIST"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
        //MilterGreyListEnabled
    }
    if ($users->KAV_MILTER_INSTALLED) {
        $array["KAVMILTER"]["INSTALLED"] = True;
        $array["KAVMILTER"]["TEXT"] = "enable_kavmilter_text";
        $array["KAVMILTER"]["ENABLED"] = $users->KAVMILTER_ENABLED;
        $array["KAVMILTER"]["TOKEN"] = "kavmilterEnable";
        $array["KAVMILTER"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
        //kavmilterEnable
    }
    if ($users->kas_installed) {
        $array["KAS3"]["INSTALLED"] = True;
        $array["KAS3"]["TEXT"] = "enable_kaspersky_as_text";
        $array["KAS3"]["ENABLED"] = $users->KasxFilterEnabled;
        $array["KAS3"]["TOKEN"] = "enable_kaspersky_as";
        $array["KAS3"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
        //enable_kaspersky_as
    }
    //
    /*	if($users->ASSP_INSTALLED){
    		$sock=new sockets();
    		$EnableASSP=$sock->GET_INFO('EnableASSP');
    		$assp=Paragraphe_switch_img('{enable_assp}','{enable_assp_text}','EnableASSP',$EnableASSP,'{enable_disable}',290);
    	}
    */
    if (!$users->MEM_HIGER_1G) {
        $array["AMAVISD"]["TEXT"] = "ressources_insuffisantes";
        $array["SPAMASS_MILTER"]["TEXT"] = "ressources_insuffisantes";
        $array["SPAMASSASSIN"]["TEXT"] = "ressources_insuffisantes";
    }
    if ($users->KASPERSKY_SMTP_APPLIANCE) {
        unset($array["AMAVISD"]);
        unset($array["SPAMASS_MILTER"]);
        unset($array["SPAMASSASSIN"]);
    }
    if ($users->CLUEBRINGER_INSTALLED) {
        $array["APP_CLUEBRINGER"]["INSTALLED"] = True;
        $array["APP_CLUEBRINGER"]["TEXT"] = "enable_cluebringer_text";
        $EnableCluebringer = $sock->GET_INFO("EnableCluebringer");
        $array["APP_CLUEBRINGER"]["ENABLED"] = $EnableCluebringer;
        $array["APP_CLUEBRINGER"]["TOKEN"] = "EnableCluebringer";
        //
    }
    if (is_file("ressources/logs/global.status.ini")) {
        $ini = new Bs_IniHandler("ressources/logs/global.status.ini");
    } else {
        writelogs("ressources/logs/global.status.ini no such file");
        $sock = new sockets();
        $datas = base64_decode($sock->getFrameWork('cmd.php?Global-Applications-Status=yes'));
        $ini = new Bs_IniHandler($datas);
    }
    $sock = new sockets();
    $datas = $sock->getFrameWork('cmd.php?refresh-status=yes');
    //$activate=Paragraphe('64-folder-install.png','{AS_ACTIVATE}','{AS_ACTIVATE_TEXT}',"javascript:Loadjs('postfix.index.php?script=antispam')",null,210,null,0,true);
    $tr[] = DAEMON_STATUS_ROUND($ligne, $ini, null, 1);
    $html = "\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t<th>{service}</th>\n\t<th>{version}</th>\n\t<th>{installed}</th>\n\t<th>{enabled}</th>\n\t<th>{running}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    //print_r($ini->_params);
    if ($_GET["search"] != null) {
        $search = "*{$_GET["search"]}*";
        $search = str_replace(".", "\\.", $search);
        $search = str_replace("(", "\\(", $search);
        $search = str_replace(")", "\\)", $search);
        $search = str_replace("**", "*", $search);
        $search = str_replace("**", "*", $search);
        $search = str_replace("*", ".*?", $search);
    }
    while (list($key, $arrayConf) = each($array)) {
        $servicename = null;
        $enabled = NULL;
        $installed = null;
        $fontColor = "black";
        $version = "&nbsp;";
        $running = null;
        $since = null;
        $memory = null;
        $text = null;
        $ahref = null;
        if (isset($ini->_params[$key]["service_name"])) {
            $servicename = "{{$ini->_params[$key]["service_name"]}}";
        }
        if ($servicename == null) {
            if (isset($arrayConf["NAME"])) {
                $servicename = "{{$arrayConf["NAME"]}}";
            }
        }
        if ($servicename == null) {
            $servicename = $key;
        }
        $servicename = $tpl->_ENGINE_parse_body($servicename);
        if ($arrayConf["INSTALLED"]) {
            $installed = "<img src='img/check-32.png'>";
        } else {
            if ($ini->_params[$key]["application_installed"] == 1) {
                $installed = "<img src='img/check-32.png'>";
                $arrayConf["JS"] = null;
            }
        }
        if (isset($arrayConf["JS-INSTALL"])) {
            $arrayConf["JS"] = $arrayConf["JS-INSTALL"];
        }
        if (isset($ini->_params[$key]["master_version"])) {
            $version = $ini->_params[$key]["master_version"];
        }
        $clickToInstall = null;
        if ($installed == null) {
            if ($_GET["installed"] == 1) {
                continue;
            }
            if (!isset($arrayConf["JS-INSTALL"])) {
                $fontColor = "#B5B5B5";
            }
            $installed = "&nbsp;";
            if (isset($arrayConf["TEXT"])) {
                if (strpos($arrayConf["TEXT"], "}") > 0) {
                    $text = $tpl->_ENGINE_parse_body($arrayConf["TEXT"]);
                } else {
                    $text = $tpl->_ENGINE_parse_body("{{$arrayConf["TEXT"]}}");
                }
                $text = "<hr>" . wordwrap($text, 95, "<br>") . "";
                $text = str_replace("\n", "", $text);
                $text = str_replace("\r", "", $text);
                $text = str_replace("<br><br>", "<br>", $text);
            }
            if (isset($arrayConf["JS-INSTALL"])) {
                $clickToInstall = "&nbsp;<span style='font-color:#C50000;font-size:10px'>{click_to_install}</strong><br>";
            }
            $text = "{feature_not_installed}{$text}";
        }
        if (isset($arrayConf["ENABLED"])) {
            if ($arrayConf["ENABLED"] == 1) {
                $enabled = imgtootltip("check-32.png", "{enable_disable}", "Loadjs('postfix.index.php?script=antispam')");
            } else {
                if ($_GET["enabled"] == 1) {
                    continue;
                }
                $enabled = imgtootltip("check-32-grey.png", "{enable_disable}", "Loadjs('postfix.index.php?script=antispam')");
            }
        } else {
            if (isset($ini->_params[$key]["service_disabled"])) {
                if ($ini->_params[$key]["service_disabled"] == 1) {
                    if ($_GET["enabled"] == 1) {
                        continue;
                    }
                    $enabled = imgtootltip("check-32.png", "{enable_disable}", "Loadjs('postfix.index.php?script=antispam')");
                }
            }
        }
        if ($search != null) {
            if (!preg_match("#{$search}#i", $servicename)) {
                continue;
            }
        }
        if ($enabled != null) {
            if (isset($ini->_params[$key]["running"])) {
                if ($ini->_params[$key]["running"] == 1) {
                    $running = "<img src='img/ok32.png'>";
                    $memory = "&nbsp;{memory}:<span style='font-weight:bolder'> " . FormatBytes($ini->_params[$key]["master_memory"]) . " </span>/ {virtual_memory}: <span style='font-weight:bolder'>" . FormatBytes($ini->_params[$key]["master_cached_memory"]) . "</span> ";
                    $since = "&nbsp;{since}: <span style='font-weight:bolder;color:#AB3106'>{$ini->_params[$key]["uptime"]}</span>";
                } else {
                    $running = "<img src='img/okdanger32.png'>";
                }
            }
        }
        if ($text == null) {
            if (isset($arrayConf["TEXT"])) {
                $text = $tpl->_ENGINE_parse_body("{{$arrayConf["TEXT"]}}");
                $text = str_replace("\n", "", $text);
                $text = wordwrap($text, 95, "<br>");
                $text = str_replace("\n", "", $text);
                $text = str_replace("\r", "", $text);
                $text = str_replace("<br><br>", "<br>", $text);
            }
        }
        if ($arrayConf["JS"] != null) {
            $ahref = "<a href=\"javascript:blur();\" OnClick=\"javascript:{$arrayConf["JS"]}\"\n\t\t\tstyle='font-size:14px;color:{$fontColor};text-decoration:underline;font-weight:bold'>";
        }
        if ($running == null) {
            $running = "<img src='img/ok32-grey.png'>";
        }
        if ($enabled == null) {
            $enabled = "&nbsp;";
        }
        if ($memory == null) {
            $memory = "&nbsp;";
        }
        if ($since == null) {
            $since = "&nbsp;";
        }
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        if (strlen($text) > 290) {
            $text = substr($text, 0, 290) . "...";
        }
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=100% align='left'>\n\t\t\t\t<strong style='font-size:14px;color:{$fontColor}' align='left'>{$ahref}{$servicename}{$clickToInstall}</a></strong>\n\t\t\t\t<div style='font-size:11px;color:{$fontColor};'>{$text}{$memory}{$since}</div>\n\t\t\t\t\n\t\t\t\t</a></td>\n\t\t\t<td width=1% align='left'><strong style='font-size:14px;color:{$fontColor}' align='center'>{$version}</a></td>\n\t\t\t<td width=1% nowrap align='center'>{$installed}</a></td>\n\t\t\t<td width=1% nowrap align='center'>{$enabled}</td>\n\t\t\t<td  width=1% nowrap align='center'>{$running}</td>\n\t\t\t\n\t\t</tr>";
    }
    $datas = $tpl->_ENGINE_parse_body($html . "</table>");
    echo $datas;
}
Esempio n. 16
0
function logfile_daemon_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 1) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled_see_performance}"));
        return;
    }
    $RemoteUfdbCat = intval($sock->GET_INFO("RemoteUfdbCat"));
    $t = time();
    $LogFileDaemonMaxEvents = intval($sock->GET_INFO("LogFileDaemonMaxEvents"));
    if ($LogFileDaemonMaxEvents == 0) {
        $LogFileDaemonMaxEvents = 500;
    }
    if ($RemoteUfdbCat == 1) {
        $detect_categories = Paragraphe_switch_disable("{detect_categories}", "{logfile_detect_categories}", "DisableLogFileDaemonCategories", $DisableLogFileDaemonCategories_INV, null, 750);
        $explain_RemoteUfdbCat = "<div style='font-size:18px' class=explain>{explain_RemoteUfdbCat}</div>";
    }
    $html = "<div style='width:98%' class=form>{$explain_RemoteUfdbCat}\r\n\t<div style='font-size:18px' class=explain>{LogFileDaemonMaxEvents_explain}</div>\r\n\t<table style='width:100%'>\r\n\t<tr>\r\n\t\t<td class=legend style='font-size:22px'>{max_events_in_memory}:</td>\r\n\t\t<td>" . Field_text("LogFileDaemonMaxEvents", $LogFileDaemonMaxEvents, "font-size:22px;width:110px") . "</td>\r\n\t</tr>\r\n\t</table>\r\n\t <div style='width:100%;text-align:right;margin-top:20px'><hr>" . button("{apply}", "Save{$t}()", 26) . "</div>\r\n<script>\r\nvar xSave{$t}= function (obj) {\r\n\tvar res=obj.responseText;\r\n\tif (res.length>3){alert(res);return;}\r\n\tYahooWin2Hide();\r\n\tLoadjs('squid.reload.php');\r\n}\r\nfunction SaveCK{$t}(e){\r\n\tif(!checkEnter(e)){return;}\r\n\tSave{$t}();\r\n}\r\n\r\nfunction Save{$t}(){\r\n\tvar XHR = new XHRConnection();\r\n\tXHR.appendData('LogFileDaemonMaxEvents',document.getElementById('LogFileDaemonMaxEvents').value);\r\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\r\n}\t\t\t\t\r\n</script>\r\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 17
0
function popup(){
	$page=CurrentPageName();
	$sock=new sockets();
	$users=new usersMenus();
	$t=time();
	$LICENSE=0;
	if($users->CORP_LICENSE){$LICENSE=1;}
	$EnableSquidGuardHTTPService=$sock->GET_INFO("EnableSquidGuardHTTPService");
	if(strlen(trim($EnableSquidGuardHTTPService))==0){$EnableSquidGuardHTTPService=1;}
	
	$SquidGuardApacheSSLPort=$sock->GET_INFO("SquidGuardApacheSSLPort");
	$SquidGuardApachePort=intval($sock->GET_INFO("SquidGuardApachePort"));
	$SquidGuardWebBlankReferer=intval($sock->GET_INFO("SquidGuardWebBlankReferer"));
	$SquidGuardWebSSLCertificate=$sock->GET_INFO("SquidGuardWebSSLCertificate");
	
	if(!is_numeric($SquidGuardApacheSSLPort)){$SquidGuardApacheSSLPort=9025;}
	if($SquidGuardApachePort==0){$SquidGuardApachePort=9020;}
	
	$SquidGuardIPWeb=$sock->GET_INFO("SquidGuardIPWeb");
	$fulluri=$sock->GET_INFO("SquidGuardIPWeb");
	$SquidGuardWebFollowExtensions=$sock->GET_INFO("SquidGuardWebFollowExtensions");
	$SquidGuardWebUseExternalUri=intval($sock->GET_INFO("SquidGuardWebUseExternalUri"));
	
	
	
	$SquidGuardServerName=$sock->GET_INFO("SquidGuardServerName");
	
	
	if($SquidGuardIPWeb==null){
			$SquidGuardIPWeb="http://".$_SERVER['SERVER_ADDR'].':'.$SquidGuardApachePort."/exec.squidguard.php";
			$SquidGuardIPWebSSL="https://".$_SERVER['SERVER_ADDR'].':'.$SquidGuardApacheSSLPort."/exec.squidguard.php";
			$fulluri="http://".$_SERVER['SERVER_ADDR'].':'.$SquidGuardApachePort."/exec.squidguard.php";
			$fulluriSSL="https://".$_SERVER['SERVER_ADDR'].':'.$SquidGuardApacheSSLPort."/exec.squidguard.php";
	}	
	$SquidGuardIPWeb=str_replace("http://",null,$SquidGuardIPWeb);
	$SquidGuardIPWeb=str_replace("https://",null,$SquidGuardIPWeb);
	$fulluriSSL=$SquidGuardIPWeb;
	
	if(preg_match("#\/(.+?):([0-9]+)\/#",$SquidGuardIPWeb,$re)){$SquidGuardIPWeb="{$re[1]}:{$re[2]}";}
	
	if(preg_match("#(.+?):([0-9]+)#",$SquidGuardIPWeb,$re)){
		$SquidGuardServerName=$re[1];
		$SquidGuardApachePort=$re[2];
	}	

	if(!is_numeric($SquidGuardWebFollowExtensions)){$SquidGuardWebFollowExtensions=1;}
	$fulluriSSL=str_replace($SquidGuardApachePort, $SquidGuardApacheSSLPort, $fulluriSSL);
	
	$squid_reverse=new squid_reverse();
	$sslcertificates=$squid_reverse->ssl_certificates_list();
	$button= button("{apply}","SaveSquidGuardHTTPService$t()",32);
	$p1=Paragraphe_switch_img("{enable_http_service}", 
				"{enable_http_service_squidguard}","EnableSquidGuardHTTPService",$EnableSquidGuardHTTPService,null,626,"EnableSquidGuardHTTPService()");
	if($SquidGuardWebUseExternalUri==1){
		$p1=Paragraphe_switch_disable("{enable_http_service}",
				"{enable_http_service_squidguard}","EnableSquidGuardHTTPService",$EnableSquidGuardHTTPService,null,626,"EnableSquidGuardHTTPService()");
		$button=null;
	}
	
	
	$html="
	<div id='EnableSquidGuardHTTPServiceDiv'>
	<div style='width:98%' class=form>
	<table style='width:100%'>
	<tr>
			
		<td style='vertical-align:top'><div id='squid-guard-http-status' style='margin-right:10px'></div></td>
		<td colspan=2>$p1".
				Paragraphe_switch_img("{FollowExtensions}",
				"{SquidGuardWebFollowExtensions_explain}","SquidGuardWebFollowExtensions",$SquidGuardWebFollowExtensions,null,626,"EnableSquidGuardHTTPService()").
				
				Paragraphe_switch_img("{SquidGuardWebBlankReferer}",
				"{SquidGuardWebBlankReferer_explain}","SquidGuardWebBlankReferer",$SquidGuardWebBlankReferer,null,626,"EnableSquidGuardHTTPService()").
								
				
				
				
				"</td>	
							

	<tr>
		<td class=legend style='font-size:22px'>{listen_port}:</td>
		<td>". Field_text("listen_port_squidguard",$SquidGuardApachePort,"font-size:22px;padding:3px;width:110px",null,null,null,false,"")."</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class=legend style='font-size:22px'>{listen_port} (SSL):</td>
		<td>". Field_text("listen_port_squidguard_ssl",$SquidGuardApacheSSLPort,"font-size:22px;padding:3px;width:110px",null,null,null,false,"")."</td>
		<td>&nbsp;</td>
	</tr>				
	<tr>
		<td class=legend style='font-size:22px'>{certificate}:</td>
		<td>". Field_array_Hash($sslcertificates,"SquidGuardWebSSLCertificate",$SquidGuardWebSSLCertificate,
				"style:font-size:22px;padding:3px;width:75%",null,null,null,false,"")."</td>
		<td>&nbsp;</td>
	</tr>				
				
				
					
	
	<tr>
		<td class=legend style='font-size:22px'>{hostname}:</td>
		<td style='font-size:14px'>". Field_text("servername_squidguard",$SquidGuardServerName,"font-size:22px;padding:3px;width:380px",null,null,null,false,"")."</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class=legend style='font-size:22px'>{fulluri}:</td>
		<td style='font-size:14px'>". Field_text("fulluri","$fulluri","font-size:22px;padding:3px;width:660px",null,null,null,false,"")."</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class=legend style='font-size:22px'>{fulluri} (ssl):</td>
		<td style='font-size:14px'>". Field_text("fulluriSSL","$fulluriSSL","font-size:22px;padding:3px;width:660px",null,null,null,false,"")."</td>
		<td>&nbsp;</td>
	</tr>				
	<tr>
		<td colspan=3 align='right'><hr>".$button."</td>
	</tr>	
	</table>
	</div>
<script>
function EnableSquidGuardHTTPService(){
	var LICENSE=$LICENSE;
	 document.getElementById('listen_port_squidguard').disabled=true;
	 document.getElementById('listen_port_squidguard_ssl').disabled=true;
	 document.getElementById('servername_squidguard').disabled=true;
	 document.getElementById('fulluri').disabled=true;
	 document.getElementById('fulluriSSL').disabled=true;
	 document.getElementById('SquidGuardWebFollowExtensions').disabled=true;
	 document.getElementById('SquidGuardWebSSLCertificate').disabled=true;
			 
			 if(document.getElementById('EnableSquidGuardHTTPService').value==1){
				 	document.getElementById('listen_port_squidguard').disabled=false;
				 	document.getElementById('listen_port_squidguard_ssl').disabled=false;
				 	document.getElementById('servername_squidguard').disabled=false;
				 	document.getElementById('SquidGuardWebFollowExtensions').disabled=false;
				 	document.getElementById('SquidGuardWebBlankReferer').disabled=false;
				 	document.getElementById('SquidGuardWebSSLCertificate').disabled=false;
			}
			 
			
		}
		
var x_SaveSquidGuardHTTPService$t=function(obj){
	 	Loadjs('dansguardian2.compile.php');
}

function SaveSquidGuardHTTPService$t(){
     var XHR = new XHRConnection();
  	 XHR.appendData('SquidGuardWebBlankReferer',document.getElementById('SquidGuardWebBlankReferer').value);
     XHR.appendData('SquidGuardWebFollowExtensions',document.getElementById('SquidGuardWebFollowExtensions').value);
     XHR.appendData('EnableSquidGuardHTTPService',document.getElementById('EnableSquidGuardHTTPService').value);
	 XHR.appendData('listen_port_squidguard',document.getElementById('listen_port_squidguard').value);
	 XHR.appendData('listen_port_squidguard_ssl',document.getElementById('listen_port_squidguard_ssl').value);
	 XHR.appendData('SquidGuardWebSSLCertificate',document.getElementById('SquidGuardWebSSLCertificate').value);
	 XHR.appendData('servername_squidguard',document.getElementById('servername_squidguard').value);
     XHR.appendData('fulluri',document.getElementById('fulluri').value);
     XHR.appendData('fulluriSSL',document.getElementById('fulluriSSL').value);
     XHR.sendAndLoad('$page', 'GET',x_SaveSquidGuardHTTPService$t);     	
}
	
EnableSquidGuardHTTPService();
LoadAjaxSilent('squid-guard-http-status','squidguardweb.service.php');
</script>";
	
	$tpl=new templates();
	echo $tpl->_ENGINE_parse_body($html);
	
	
}
Esempio n. 18
0
function popup()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $MimeDefangVersion = $sock->GET_INFO("MimeDefangVersion");
    $enable_amavisdeamon_ask = $tpl->javascript_parse_text("{enable_mimedefang_ask}");
    $disable_amavisdeamon_ask = $tpl->javascript_parse_text("{disable_mimedefang_ask}");
    $MimeDefangEnabled = trim($sock->GET_INFO("MimeDefangEnabled", true));
    $MimeDefangArchiver = intval($sock->GET_INFO("MimeDefangArchiver", true));
    $MimeDefangClamav = intval($sock->GET_INFO("MimeDefangClamav"));
    $MimeDefangDisclaimer = intval($sock->GET_INFO("MimeDefangDisclaimer"));
    $MimeDefangSpamAssassin = intval($sock->GET_INFO("MimeDefangSpamAssassin"));
    $MimeDefangAutoWhiteList = intval($sock->GET_INFO("MimeDefangAutoWhiteList"));
    $MimeDefangFilterExtensions = intval($sock->GET_INFO("MimeDefangFilterExtensions"));
    $MimeDefangAutoCompress = intval($sock->GET_INFO("MimeDefangAutoCompress"));
    if (!is_numeric($MimeDefangEnabled)) {
        $MimeDefangEnabled = 0;
    }
    $EnableMimeDefang = Paragraphe_switch_img("{enable_disable_this_service}", "{MIMEDEFANG_DEF}<br>{APP_VALVUAD_TEXT}", "MimeDefangEnabled", $MimeDefangEnabled, null, 990);
    $TOTAL_MEMORY_MB = $sock->getFrameWork("system.php?TOTAL_MEMORY_MB=yes");
    if ($TOTAL_MEMORY_MB < 1500) {
        $p = FATAL_ERROR_SHOW_128("{NO_ENOUGH_MEMORY_FOR_THIS_SECTION}<br><strong style='font-size:18px'>{require}:1500MB</strong>", false, true);
        $MimeDefangEnabled = 0;
        $EnableDaemonP = null;
        $EnableMimeDefang = Paragraphe_switch_disable("{enable_disable_this_service}", "{MIMEDEFANG_DEF}", "MimeDefangEnabled", $MimeDefangEnabled, null, 990);
    }
    if ($MimeDefangEnabled == 0) {
        $backupemail_behavior = Paragraphe_switch_disable("{backupemail_behavior}", "{enable_APP_MAILARCHIVER_text}<br>{mimedefang_is_currently_disabled_text}", "MimeDefangArchiver", $MimeDefangArchiver, null, 990);
        $clamav_behavior = Paragraphe_switch_disable("{enable_antivirus}", "{ACTIVATE_ANTIVIRUS_SERVICE_TEXT}", "MimeDefangClamav", $MimeDefangClamav, null, 990);
        $disclaimer = Paragraphe_switch_disable("{enable_disclaimer}", "{disclaimer_text}", "MimeDefangDisclaimer", $MimeDefangDisclaimer, null, 990);
        $enableSpamassassin = Paragraphe_switch_disable("{enable_spamasssin}", "{enable_spamasssin_text}", "MimeDefangSpamAssassin", $MimeDefangSpamAssassin, null, 990);
        $AutoWhiteList = Paragraphe_switch_disable("{smtp_AutoWhiteList}", "{smtp_AutoWhiteList_text}", "MimeDefangAutoWhiteList", $MimeDefangAutoWhiteList, null, 990);
        $extensions = Paragraphe_switch_disable("{title_mime}", "{mimedefang_attachments_text}", "MimeDefangFilterExtensions", $MimeDefangFilterExtensions, null, 990);
        $autcompress = Paragraphe_switch_disable("{automated_compression}", "{auto-compress_text}", "MimeDefangAutoCompress", $MimeDefangAutoCompress, null, 990);
    } else {
        $clamav_behavior = Paragraphe_switch_img("{enable_antivirus}", "{ACTIVATE_ANTIVIRUS_SERVICE_TEXT}", "MimeDefangClamav", $MimeDefangClamav, null, 990);
        $enableSpamassassin = Paragraphe_switch_img("{enable_spamasssin}", "{enable_spamasssin_text}", "MimeDefangSpamAssassin", $MimeDefangSpamAssassin, null, 990);
        $backupemail_behavior = Paragraphe_switch_img("{backupemail_behavior}", "{enable_APP_MAILARCHIVER_text}", "MimeDefangArchiver", $MimeDefangArchiver, null, 990);
        $disclaimer = Paragraphe_switch_img("{enable_disclaimer}", "{disclaimer_text}<br>{disclaimer_explain}", "MimeDefangDisclaimer", $MimeDefangDisclaimer, null, 990);
        $AutoWhiteList = Paragraphe_switch_img("{smtp_AutoWhiteList}", "{smtp_AutoWhiteList_text}", "MimeDefangAutoWhiteList", $MimeDefangAutoWhiteList, null, 990);
        $extensions = Paragraphe_switch_img("{title_mime}", "{mimedefang_attachments_text}", "MimeDefangFilterExtensions", $MimeDefangFilterExtensions, null, 990);
        $autcompress = Paragraphe_switch_img("{automated_compression}", "{auto-compress_text}", "MimeDefangAutoCompress", $MimeDefangAutoCompress, null, 990);
    }
    $tr[] = $EnableDaemonP;
    //$tr[]=Paragraphe32("service_options", "service_options_text", "Loadjs('mimedefang.service.php')", "32-parameters.png",500);
    //$tr[]=Paragraphe32("online_help", "online_help", "s_PopUpFull('http://www.mail-appliance.org/index.php?cID=305','1024','900');", "help_bg32.png",500);
    $table = CompileTr2($tr);
    $html = "<table style='width:100%'>\n\t<tr>\n\t\t<td width=1% valign='top'>\n\t\t\t<div id='status-{$t}'></div>\n\t\t</td>\n\t\t<td valign='top' style='padding-left:15px'>\n\t\t\t<div style='font-size:40px;margin:bottom:40px;text-align:right'>{APP_MIMEDEFANG} v{$MimeDefangVersion} <span style='font-size:18px'>(" . texttooltip("{reload_service}", "{reload_service_text}", "MimeDefangCompileRules()") . ")</span></div>\n\t\t\t{$p}\n\t\t\t<div style='width:98%' class=form>\n\t\t\t{$EnableMimeDefang}\n\t\t\t</div>\n\t\t\t<div style='width:98%' class=form>\n\t\t\t{$enableSpamassassin}\n\t\t\t{$AutoWhiteList}\n\t\t\t{$clamav_behavior}\n\t\t\t{$extensions}\n\t\t\t{$backupemail_behavior}\n\t\t\t{$disclaimer}\n\t\t\t{$autcompress}\n\t\t\t\n\t\t\t<div style='margin:20px;text-align:right'>" . button("{apply}", "Save{$t}()", 40) . "</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id='explain-{$t}'>{$table}</div>\n\t\t</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\n\tfunction MimeDefangCompileRules(){\n\t\tLoadjs('mimedefang.compile.php');\n\t}\n\t\n\tvar x_Enablemimedefang= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\t\n\t\tMimeDefangCompileRules();\n\t}\t\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('MimeDefangEnabled',document.getElementById('MimeDefangEnabled').value);\n\t\tXHR.appendData('MimeDefangClamav',document.getElementById('MimeDefangClamav').value);\n\t\tXHR.appendData('MimeDefangArchiver',document.getElementById('MimeDefangArchiver').value);\n\t\tXHR.appendData('MimeDefangDisclaimer',document.getElementById('MimeDefangDisclaimer').value);\n\t\tXHR.appendData('MimeDefangSpamAssassin',document.getElementById('MimeDefangSpamAssassin').value);\n\t\tXHR.appendData('MimeDefangAutoWhiteList',document.getElementById('MimeDefangAutoWhiteList').value);\n\t\tXHR.appendData('MimeDefangFilterExtensions',document.getElementById('MimeDefangFilterExtensions').value);\n\t\tXHR.appendData('MimeDefangAutoCompress',document.getElementById('MimeDefangAutoCompress').value);\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_Enablemimedefang);\n\t}\n\t\n\n\t\tLoadAjax('status-{$t}','{$page}?status=yes&t={$t}');\n\t\t\n\t\t\n\t</script>\n\t\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 19
0
function index(){
	$dar=new dar_back();
	$tpl=new templates();
	$page=CurrentPageName();
	$users=new usersMenus();
	if(!$users->dar_installed){
		$html=Paragraphe_switch_disable('{no_dar_installed}','{no_dar_installed_text}',null,300);
		echo $tpl->_ENGINE_parse_body($html);
		exit;
	}
	
	
	$html="<H1>{incremental_backup}</H1>
	<table style='width:100%'>
	<tr>
		<td valign='top'>
			<div id='index-dar'>". index_dar()."</div>
			<br>
			" . RoundedLightWhite("
			<table style='width:99%'>
			<tr>
				<td valign='top' width=1%><img src='img/dar-logo.png'></td>
				<td valign='top'><p class=caption>{dar_pub}</p></td>
			</tr>
			</table>")."
			
			
			</td>
			<td valign='top'>
				<div id='darstatus'>".dar_status()."</div>
			</td>
		</tr>
	</table>
";
			echo $tpl->_ENGINE_parse_body($html);
	
}
Esempio n. 20
0
function params()
{
    $sock = new sockets();
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $arrayConf = unserialize(base64_decode($sock->GET_INFO("ntopng")));
    $EnableBandwidthd = intval($sock->GET_INFO("EnableBandwidthd"));
    $BandwidthdInstalled = intval($sock->GET_INFO("BandwidthdInstalled"));
    $Enablentopng = $sock->GET_INFO("Enablentopng");
    if (!is_numeric($Enablentopng)) {
        $Enablentopng = 0;
    }
    if (!is_numeric($arrayConf["HTTP_PORT"])) {
        $arrayConf["HTTP_PORT"] = 3000;
    }
    if (!is_numeric($arrayConf["ENABLE_LOGIN"])) {
        $arrayConf["ENABLE_LOGIN"] = 0;
    }
    if (!is_numeric($arrayConf["MAX_DAYS"])) {
        $arrayConf["MAX_DAYS"] = 30;
    }
    if (!is_numeric($arrayConf["MAX_SIZE"])) {
        $arrayConf["MAX_SIZE"] = 5000;
    }
    $DisableNetDiscover = intval($sock->GET_INFO("DisableNetDiscover"));
    if ($DisableNetDiscover == 0) {
        $DisableNetDiscover = 1;
    } else {
        $DisableNetDiscover = 0;
    }
    $NetDiscoverSaved = $sock->GET_INFO("NetDiscoverSaved");
    if (!is_numeric($NetDiscoverSaved)) {
        $DisableNetDiscover = 1;
    }
    $days[1] = "1 {day}";
    $days[2] = "2 {days}";
    $days[5] = "5 {days}";
    $days[10] = "10 {days}";
    $days[15] = "15 {days}";
    $days[30] = "1 {month}";
    $maxsizes[500] = "500MB";
    $maxsizes[1000] = "1GB";
    $maxsizes[5000] = "5GB";
    $maxsizes[10000] = "10GB";
    $maxsizes[50000] = "50GB";
    if ($Enablentopng == 1) {
        $button = "<div style='margin-top:20px;text-align:right;width:100%'>" . button("{disable_service}", "Loadjs('system.ntopng.disable.php')", 28) . "</div>";
    }
    $enable = Paragraphe_switch_img("{enable_ntopng}", "{enable_ntopng_text}", "Enablentopng", $Enablentopng, null, 850);
    $EnableBandwidthd_par = Paragraphe_switch_img("{EnableBandwidthd}", "{EnableBandwidthd_explain}", "EnableBandwidthd", $EnableBandwidthd, null, 850);
    if ($BandwidthdInstalled == 0) {
        $EnableBandwidthd_par = Paragraphe_switch_disable("{EnableBandwidthd}", "{EnableBandwidthd_explain}", "EnableBandwidthd", 0, null, 850);
    }
    $DisableBWMng = intval($sock->GET_INFO("DisableBWMng"));
    $INSTALLED = $sock->getFrameWork("system.php?ntopng-installed=yes");
    if ($INSTALLED != "TRUE") {
        $error = $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{software_is_not_installed}"));
        $enable = null;
    }
    $xDisableBWMng = 1;
    if ($DisableBWMng == 1) {
        $xDisableBWMng = 0;
    }
    $html = "{$error}\n\t{$EnableBandwidthd_par}\n\t{$enable} \n\t<div style='margin-top:5px;width:100%;text-align:right'>{$button}</div>\t\t\n\t<br>" . Paragraphe_switch_img("{enable_login}", "{enable_login_ntopng_explain}", "ENABLE_LOGIN", $arrayConf["ENABLE_LOGIN"], null, 850) . "<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='middle' class=legend style='font-size:22px'>{listen_port}:</td>\n\t\t\t<td>" . Field_text("HTTP_PORT", $arrayConf["HTTP_PORT"], "font-size:22px;width:110px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='middle' class=legend style='font-size:22px'>{webconsole}:</td>\n\t\t\t<td><a href=\"http://{$_SERVER["SERVER_ADDR"]}:{$arrayConf["HTTP_PORT"]}/\" \n\t\t\tstyle='font-size:22px;text-decoration:underline'\n\t\t\ttarget=_new>http://{$_SERVER["SERVER_ADDR"]}:{$arrayConf["HTTP_PORT"]}</a></td>\n\t\t</tr>\n\t\t" . Field_list_table("MAX_SIZE", "{max_size}", $arrayConf["MAX_SIZE"], 22, $maxsizes) . "\t\t\t\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 42) . "</td>\n\t\t</tr>\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tRefreshTab('tabs_networktrack');\n}\n\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('Enablentopng')){XHR.appendData('Enablentopng',document.getElementById('Enablentopng').value);}\n\t\tif(document.getElementById('Enablentopng')){XHR.appendData('EnableBandwidthd',document.getElementById('EnableBandwidthd').value);}\n\t\t\n\t\t\n\t\tXHR.appendData('ENABLE_LOGIN',document.getElementById('ENABLE_LOGIN').value);\n\t\tXHR.appendData('MAX_SIZE',document.getElementById('MAX_SIZE').value);\n\t\tXHR.appendData('HTTP_PORT',document.getElementById('HTTP_PORT').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t\n\t}\t\n\nLoadAjax('APP_NTOPNG_STATUS','{$page}?status=yes',false);\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 21
0
function neighborhood_index()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $samba = new samba();
    $users = new usersMenus();
    $sock = new sockets();
    $EnableSambaActiveDirectory = $sock->GET_INFO("EnableSambaActiveDirectory");
    $currentrole = $sock->getFrameWork("cmd.php?samba-server-role=yes");
    $current_text = "<hr><div style='font-size:16px;font-weight:bold;margin-bottom:10px'>{current}:&nbsp;{{$currentrole}}</div>";
    if ($EnableSambaActiveDirectory == 1) {
        $html = "\n\t\t<center style='margin:10px;font-size:14px'>{this_server_is_an_ad_member}{$current_text}</center>\n\t\t";
        echo $tpl->_ENGINE_parse_body($html);
        exit;
    }
    /*ROLE_STANDALONE
    ROLE_DOMAIN_MEMBER
    ROLE_DOMAIN_BDC
    
    	 * 
    	 */
    $TypeOfSamba = $sock->GET_INFO("TypeOfSamba");
    if (!is_numeric($TypeOfSamba)) {
        switch ($currentrole) {
            case "ROLE_STANDALONE":
                $TypeOfSamba = 1;
                break;
            case "ROLE_DOMAIN_PDC":
                $TypeOfSamba = 3;
                break;
            default:
                $TypeOfSamba = 1;
                break;
        }
        $sock->SET_INFO("TypeOfSamba", $TypeOfSamba);
    }
    $hasApdc = 0;
    $hasLocalMaster = 0;
    $HasSingleMode = 0;
    switch ($TypeOfSamba) {
        case 1:
            $HasSingleMode = 1;
            break;
        case 2:
            $hasLocalMaster = 1;
            break;
        case 3:
            $hasApdc = 1;
            break;
        default:
            $HasSingleMode = 1;
            break;
    }
    $pdc = Paragraphe_switch_img("{ROLE_DOMAIN_PDC}", "{PDC_TEXT}", "HasPDC", $hasApdc);
    $standalone = Paragraphe_switch_img("{SINGLE_MODE}", "{SINGLE_MODE_TEXT}", "HasSingleMode", $HasSingleMode);
    $localmaster = Paragraphe_switch_img("{LOCAL_MASTER}", "{LOCAL_MASTER_TEXT}", "hasLocalMaster", $hasLocalMaster);
    if (!$users->WINBINDD_INSTALLED) {
        $pdc = Paragraphe_switch_disable("{ROLE_DOMAIN_PDC}", "{PDC_TEXT}");
    }
    //os level=32
    $html = "\n\t\n\t<div class=explain>{windows_network_neighborhood_text}</div>\n\t{$current_text}\n\t<div id='neighborhood_index'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valing='top'>{$pdc}</td>\n\t\t<td valign='top'><input type='button' OnClick=\"javascript:Save_neighborhood_form('HasPDC');\" value='{apply}&nbsp;&raquo;'></td>\n\t</tr>\n\t<tr><td colspan=2><hr></td></tr>\n\t<tr>\n\t\t\n\t\t<td valing='top'>{$standalone}</td>\n\t\t<td valign='top'><input type='button' OnClick=\"javascript:Save_neighborhood_form('HasSingleMode');\" value='{apply}&nbsp;&raquo;'></td>\n\t\t<tr><td colspan=2><hr></td></tr>\n\t</tr>\n\t<tr>\n\t\t\n\t\t<td valing='top'>{$localmaster}</td>\n\t\t<td valign='top'><input type='button' OnClick=\"javascript:Save_neighborhood_form('hasLocalMaster');\" value='{apply}&nbsp;&raquo;'></td>\n\t\t<tr><td colspan=2><hr></td></tr>\n\t</tr>\t\n\t</table>\n\t</div>\n\t\n\t<script>\n\tfunction x_Save_neighborhood_form(obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\n\t\tif(document.getElementById('main_config_samba')){RefreshTab('main_config_samba');}\n\t\tif(document.getElementById('admin_perso_tabs')){RefreshTab('admin_perso_tabs');}\n\t\tneighborhood();\n\t}\n\n\tfunction Save_neighborhood_form(field_id){\n\t\tvar value=document.getElementById(field_id).value;\n\t\tAnimateDiv('neighborhood_index');\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('neighborhood-save',field_id);\n\t\tXHR.appendData('value',value);\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_Save_neighborhood_form);\t\t\t\t\n\t\n\t}\n\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 22
0
function main_plugins(){
$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"];}
	$spam=new spamassassin();
	$users=new usersMenus();
	$page=CurrentPageName();
	$sock=new sockets();
	
	if(!$users->razor_installed){
		$razor_but=Paragraphe_switch_disable("Razor","{razor_text}");
		
	}else{
		$razor_but=Paragraphe_switch_img("Razor","{razor_text}","use_razor2",$spam->main_array["use_razor2"],"{enable_disable}",300);
		
	}
	
	if(!$users->pyzor_installed){
		$pyzor_but=Paragraphe_switch_disable("Pyzor","{pyzor_text}");
		
	}else{
		$pyzor_but=Field_numeric_checkbox_img('use_pyzor',$spam->main_array["use_pyzor"],'{enable_disable}');
		$pyzor_but=Paragraphe_switch_img("Pyzor","{pyzor_text}","use_pyzor",$spam->main_array["use_pyzor"],"{enable_disable}",300);
	}	

	$EnableSpamassassinWrongMX=$sock->GET_INFO("EnableSpamassassinWrongMX");
	if($EnableSpamassassinWrongMX==null){$EnableSpamassassinWrongMX=1;}	
	$wrongmx=Paragraphe_switch_img("WrongMX","{WrongMXPlugin}","EnableSpamassassinWrongMX",$EnableSpamassassinWrongMX,"{enable_disable}",300);
	
	$html="

	<form name='FFM_DANS5'>
	<input type='hidden' name='SaveGeneralSettings' value='yes'>
	
	<table style='width:100%'>
		<tr>
			<td width=1% valign='top'>$razor_but</td>
			<td width=1% valign='top'>$pyzor_but</td>
		</tr>
		<tr>
			<td width=1% valign='top'>$wrongmx</td>
			<td>&nbsp;</td>
		<tr>
			
			
		<tr>
	<td $style colspan=2 align='right' valign='top'>
	<hr>
	". button("{apply}","ParseForm('FFM_DANS5','$page',true);")."
	
	</tr>

	</table></FORM><br>";
	
	$tpl=new templates();
	echo $tpl->_ENGINE_parse_body($html);
	
	
	
	
}
Esempio n. 23
0
function transparent_HTTP(){
	
	$page=CurrentPageName();
	$sock=new sockets();
	$KERNEL_CONFIG=unserialize(base64_decode($sock->getFrameWork("services.php?KERNEL_CONFIG=yes")));
	$users=new usersMenus();
	$KERNEL_CONFIG=unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/web/KERNEL_CONFIG"));
	
	$CONFIG_NETFILTER_TPROXY=$KERNEL_CONFIG["CONFIG_NETFILTER_TPROXY"];
	if(!is_numeric($CONFIG_NETFILTER_TPROXY)){$CONFIG_NETFILTER_TPROXY=0;}
	$UseTProxyMode=intval($sock->GET_INFO("UseTProxyMode"));
	
	$squid=new squidbee();
	
	
	$KernelSendRedirects=$sock->GET_INFO("KernelSendRedirects");
	$SquidTransparentMixed=$sock->GET_INFO("SquidTransparentMixed");
	$SquidClientDSTPassThru=intval($sock->GET_INFO("SquidClientDSTPassThru"));
	$SquidTProxyInterface=$sock->GET_INFO("SquidTProxyInterface");
	
	if(!is_numeric($KernelSendRedirects)){$KernelSendRedirects=1;}
	if(!is_numeric($SquidTransparentMixed)){$SquidTransparentMixed=0;}	
	$EnableRemoteStatisticsAppliance=$sock->GET_INFO("EnableRemoteStatisticsAppliance");
	if(!is_numeric($EnableRemoteStatisticsAppliance)){$EnableRemoteStatisticsAppliance=0;}
	
	
	$nics=new networking();
	$Z=$nics->Local_interfaces(true);
	unset($Z["lo"]);
	
	
	while (list ($int, $none) = each ($Z) ){
		$nic=new system_nic($int);
		$ETHZ[$int]="{$int} - $nic->NICNAME - $nic->IPADDR";
	
	}
	
	$arpoisonning="
		<tr>
			<td width=1%><img src='img/arrow-right-24-grey.png'></td>
			<td><a href=\"javascript:blur();\" OnClick=\"javascript:blur()\"
			style='font-size:16px;text-decoration:underline;color:#949494'>ARP Poisonning</a>
			</td>
		</tr>			
			
		";
	
	if($users->ETTERCAP_INSTALLED){
		$arpoisonning="
		<tr>
			<td width=1%><img src='img/arrow-right-24.png'></td>
			<td><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('arp.spoof.php?js=yes')\"
			style='font-size:16px;text-decoration:underline;'>ARP Poisoning</a>
			</td>
		</tr>
		
		";		
		
	}
	
	
	$recompile="
		<tr>
			<td width=1%><img src='img/arrow-right-24.png'></td>
			<td><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.restart.php?firewall=yes')\"
			style='font-size:16px;text-decoration:underline;'>{reconfigure_transparent_rules}</a>
			</td>
		</tr>
		
		";	
	
	
	
	if($squid->hasProxyTransparent==1){
		$wizard_transparent_link=button("{wizard_transparent_button}", "Loadjs('squid.transparent.wizard.php')",14);
		$wizard_transparent_link="<div style='text-align:right;margin-top:-70px;margin-bottom:50px'>$wizard_transparent_link</div>";
		$seeiptables="
		<tr>
		<td colspan=2>
		<table>
		<tr>
			<td width=1%><img src='img/arrow-right-24.png'></td>
			<td><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.transparent.iptables.php');\"
			style='font-size:16px;text-decoration:underline'>{display_fw_rules}</a>
			</td>
		</tr>
				$arpoisonning
				$recompile
		</table>
		</td>
		</tr>
				
		";
		
	}else{
		
		$wizard_transparent=button("{wizard_transparent_button}", "Loadjs('squid.transparent.wizard.php')",32);
		$wizard_transparent="<center style='margin:20px'>$wizard_transparent</center>";
	}
	
	$field=Paragraphe_switch_img('{transparent_mode}','{transparent_mode_text}',
			'squid_transparent',$squid->hasProxyTransparent,null,650);
	
	
	$field_tproxy=Paragraphe_switch_img('{use_tproxy_mode} - Beta Mode','{use_tproxy_mode_text}',
			'UseTProxyMode',$UseTProxyMode,null,650);	
	
	
	if($CONFIG_NETFILTER_TPROXY==0){
		$field_tproxy=Paragraphe_switch_disable('{use_tproxy_mode} {disabled}','{use_tproxy_mode_text}<br>{use_tproxy_mode_text_disabled}',
				'UseTProxyMode',0,null,650);
	}
	

	
	$field1=Paragraphe_switch_img('{SquidTransparentMixed}','{SquidTransparentMixed_text}',
			'SquidTransparentMixed',$SquidTransparentMixed,null,650);	
	
	
	if($users->APP_SQUID27_INSTALLED){
		$EnableTransparent27=intval($sock->GET_INFO("EnableTransparent27"));
	
	
		$EnableTransparent27_field="
		<tr>
			<td colspan=2>".Paragraphe_switch_img("{enable_nat_compatibility}", "{squid_enable_nat_compatibility_text}",
			"EnableTransparent27",$EnableTransparent27,null,700)."</td>
		</tr>";
	}else{
		$EnableTransparent27_field="
		<tr>
			<td colspan=2>".
			Paragraphe_switch_disable("{enable_nat_compatibility}", "{squid_enable_nat_compatibility_text}",
			"EnableTransparent27",$EnableTransparent27,null,700)."</td>
		</tr>";
		
	}
	
	$image="hotspot-howto.png";
	if($EnableTransparent27==1){$image="squid-nat-howto.png";}
	
	$html="
	<table style='width:100%'>
	<tr>
	<td valign=top width=1%><div id='squid-nat-status'></div></td>
	<td valign=top width=99%>
	<div id='squid_transparentdiv'></div>
		<div style='float:right'>". help_icon("{transparent_mode_limitations}")."</div>
			<div class=text-info style='font-size:18px'>{transparent_mode_explain}</div>
			<center><img src='img/$image' style='margin:5px'></center>
		<table style='width:99%' class=form>
			<tr>
				<td colspan=2>$wizard_transparent$field$wizard_transparent_link</td>
			</tr>
			<tr><td colspan=2>$field_tproxy</td></tr>
			<tr>
				<td class=legend style='font-size:26px' nowrap>{interface} (TProxy):</td>
				<td style='width:99%'>". Field_array_Hash($ETHZ,"SquidTProxyInterface",$SquidTProxyInterface,"style:font-size:26px")."</td>
			</tr>	
			<tr><td colspan=2><p>&nbsp;</p></td></tr>
			
			$EnableTransparent27_field
			
			$seeiptables
					
			<tr>
				<td class=legend style='font-size:14px'>{KernelSendRedirects}:</td>
				<td>". Field_checkbox("KernelSendRedirects", 1,$KernelSendRedirects)."</td>
				<td>". help_icon("{KernelSendRedirects_explain}")."</td>
			</tr>
			<tr>
				<td class=legend style='font-size:14px'>{SquidClientDSTPassThru}:</td>
				<td>". Field_checkbox("SquidClientDSTPassThru", 1,$SquidClientDSTPassThru)."</td>
				<td>". help_icon("{SquidClientDSTPassThru_explain}")."</td>
			</tr>			
			
			
			
	<tr>
		<td style='font-size:26px' class=legend>{http_port}:</td>
		<td><a href=\"javascript:blur();\" 
			OnClick=\"javascript:Loadjs('squid.popups.php?script=listen_port')\"
			style='font-size:26px;font-weight:bold;text-decoration:underline'>
			$squid->listen_port</td>
			<td>&nbsp;</td>
	</tr>						
			<tr>
				<td colspan=2 align='right'><hr>". button("{apply}","SaveTransparentProxy();",35)."</tD>
			</tr>
		</table>
	</div>
	</td>
	</tr>
						
						
						
	</table>
	<div style='text-align:right'>". imgtootltip("refresh-32.png","{refresh}","RefreshTab('squid_transparent_popup_tabs')")."</div>
	
	<script>
	
	var x_SaveTransparentProxy= function (obj) {
		var tempvalue=obj.responseText;
		if(tempvalue.length>3){alert(tempvalue)};
		
		if(document.getElementById('main_squid_quicklinks_tabs')){RefreshTab('main_squid_quicklinks_tabs');}
		if(document.getElementById('listen_port_popup_tabs')){RefreshTab('listen_port_popup_tabs');}
		Loadjs('squid.restart.php?onlySquid=yes&ask=yes');
	}	
	
	function SaveTransparentProxy(){
		var XHR = new XHRConnection();
		var KernelSendRedirects=0;
		var SquidClientDSTPassThru=0;
		var EnableRemoteStatisticsAppliance=$EnableRemoteStatisticsAppliance;
		if(EnableRemoteStatisticsAppliance==1){Loadjs('$page?error-remote-appliance=yes');return;}
		XHR.appendData('squid_transparent',document.getElementById('squid_transparent').value);
		if(document.getElementById('SquidTransparentMixed')){
			XHR.appendData('SquidTransparentMixed',document.getElementById('SquidTransparentMixed').value);
		}
		
		XHR.appendData('EnableTransparent27',document.getElementById('EnableTransparent27').value);
		XHR.appendData('SquidTProxyInterface',document.getElementById('SquidTProxyInterface').value);
		
		XHR.appendData('UseTProxyMode',document.getElementById('UseTProxyMode').value);
		if(document.getElementById('KernelSendRedirects').checked){KernelSendRedirects=1;}
		if(document.getElementById('SquidClientDSTPassThru').checked){SquidClientDSTPassThru=1;}
		XHR.appendData('KernelSendRedirects',KernelSendRedirects);
		XHR.appendData('SquidClientDSTPassThru',SquidClientDSTPassThru);
		XHR.sendAndLoad('$page', 'GET',x_SaveTransparentProxy);		
		}	
	

	LoadAjax('squid-nat-status','$page?squid-nat-status=yes',false);
	</script>
	";
	
	$tpl=new templates();
	echo $tpl->_ENGINE_parse_body($html,'squid.index.php');	
	
}
Esempio n. 24
0
function plugins_popup()
{
    $squid = new squidbee();
    $users = new usersMenus();
    $dans = Paragraphe_switch_disable('{enable_dansguardian}', '{feature_not_installed}', '{feature_not_installed}');
    $cicap = Paragraphe_switch_disable('{enable_c_icap}', '{feature_not_installed}', '{feature_not_installed}');
    $squidguard = Paragraphe_switch_disable('{enable_squidguard}', '{feature_not_installed}', '{feature_not_installed}');
    //C_ICAP_INSTALLED
    if ($squid->isicap()) {
        $kav = Paragraphe_switch_img("{enable_kavproxy}", "{enable_kavproxy_text}", 'enable_kavproxy', $squid->enable_kavproxy, '{enable_disable}', 250);
    } else {
        $kav = Paragraphe_switch_disable('{enable_kavproxy}', "{feature_not_installed}<br><strong style='color:red'>{$squid->kav_accept_why}</strong>", '{feature_not_installed}');
    }
    if ($users->C_ICAP_INSTALLED) {
        if ($users->SQUID_ICAP_ENABLED) {
            $cicap = Paragraphe_switch_img("{enable_c_icap}", "{enable_c_icap_text}", 'enable_c_icap', $squid->enable_cicap, '{enable_disable}', 250);
        }
    }
    if ($users->DANSGUARDIAN_INSTALLED) {
        $dans = Paragraphe_switch_img("{enable_dansguardian}", "{enable_dansguardian_text}", 'enable_dansguardian', $squid->enable_dansguardian, '{enable_disable}', 250);
    }
    if ($users->SQUIDGUARD_INSTALLED) {
        $squidguard = Paragraphe_switch_img("{enable_squidguard}", "{enable_squidguard_text}", 'enable_squidguard', $squid->enable_squidguard, '{enable_disable}', 250);
    }
    if ($users->KASPERSKY_WEB_APPLIANCE) {
        $dans = null;
        $cicap = null;
    }
    $form = "<div id='div-poubelle'></div>\n\t\t<table style='width:100%'>\n\t\t\t<tr>\n\t\t\t<td valign='top'>{$cicap}<br>{$kav}</td>\n\t\t\t<td valign='top'>{$squidguard}<br>{$dans}</td>\n\t\t\t\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t<td  valign='top' colspan=2 align='right'><hr>" . button("{edit}", "save_plugins()") . "</td>\n\t\t</table>\t\t\t\n\t\t";
    $html = "<H1>{activate_plugins}</H1>{$form}";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'squid.index.php');
}
Esempio n. 25
0
function main_plugins()
{
    $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"];
    }
    $spam = new spamassassin();
    $users = new usersMenus();
    $page = CurrentPageName();
    if (!$users->razor_installed) {
        $razor_but = Paragraphe_switch_disable("Razor", "{razor_text}");
    } else {
        $razor_but = Paragraphe_switch_img("Razor", "{razor_text}", "use_razor2", $spam->main_array["use_razor2"], "{enable_disable}", 600);
    }
    if (!$users->pyzor_installed) {
        $pyzor_but = Paragraphe_switch_disable("Pyzor", "{pyzor_text}");
    } else {
        $pyzor_but = Field_numeric_checkbox_img('use_pyzor', $spam->main_array["use_pyzor"], '{enable_disable}');
        $pyzor_but = Paragraphe_switch_img("Pyzor", "{pyzor_text}", "use_pyzor", $spam->main_array["use_pyzor"], "{enable_disable}", 600);
    }
    $html = "\n\n\t<form name='FFM_DANS5'>\n\t<input type='hidden' name='SaveGeneralSettings' value='yes'>\n\t\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td width=1% valign='top'>{$razor_but}</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td width=1% valign='top'>{$pyzor_but}</td>\n\t\t\t\n\t\t<tr>\n\t<td {$style} colspan=2 align='right' valign='top'>\n\t<hr>\n\t" . button("{edit}", "ParseForm('FFM_DANS5','{$page}',true);") . "\n\t\n\t</tr>\n\n\t</table></FORM><br>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 26
0
function status()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $t = time();
    $error = null;
    $GraphsDiv = null;
    $setTimeout = null;
    $EnableProxyCompressor = intval($sock->GET_INFO("EnableProxyCompressor"));
    $ZipProxyUnrestricted = intval($sock->GET_INFO("ZipProxyUnrestricted"));
    $SquidAsMasterPeer = intval($sock->GET_INFO("SquidAsMasterPeer"));
    $p1 = Paragraphe_switch_img("{enable_http_compression_service}", "{enable_http_compression_service_text}", "EnableProxyCompressor", $EnableProxyCompressor, null, 600);
    $p2 = Paragraphe_switch_img("{unrestricted_networks}", "{unrestricted_networks_text}", "ZipProxyUnrestricted", $ZipProxyUnrestricted, null, 600);
    $apply = "<div style='margin-top:15px;text-align:right'>" . button("{apply}", "Save{$t}()", 24) . "</div>";
    if ($SquidAsMasterPeer == 0) {
        $error = "<p class=text-error style='font-size:16px'>{this_server_is_not_enabled_proxy_parent}</p>";
        $p1 = Paragraphe_switch_disable("{enable_http_compression_service}", "{enable_http_compression_service_text}", "EnableProxyCompressor", $EnableProxyCompressor, null, 600);
        $p2 = Paragraphe_switch_disable("{unrestricted_networks}", "{unrestricted_networks_text}", "ZipProxyUnrestricted", $ZipProxyUnrestricted, null, 600);
        $apply = null;
    }
    if (is_file("/usr/share/artica-postfix/ressources/logs/zipproxy_stats.db")) {
        $GraphsDiv = "<hr><div id='Graphdiv' style='width:650px;height:450px;margin-top:10px'></div>";
        $setTimeout = "setTimeout(\"Fsix{$t}()\",800);";
    }
    $html = "<div style='width:98%' class=form>\n<table style='width:100%'>\n<tr>\n\t<td valign='top' style='width:450px'>\n\t\t\t<div id='zipproxy_status'></div>\n\t</div>\t\n\t<td valign='top' width=100%>\n\t{$error}\n\t\t{$p1}\n\t\t<br>\n\t\t{$p2}\n\t\t{$apply}\t\n\t\t{$GraphsDiv}\n\t</td>\n</tr>\n</table>\t\n</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\tRefreshTab('main_zipproxy_tabs');\n}\n\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('EnableProxyCompressor',document.getElementById('EnableProxyCompressor').value);\n\tXHR.appendData('ZipProxyUnrestricted',document.getElementById('ZipProxyUnrestricted').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\nfunction Fsix{$t}(){\n\tAnimateDiv('Graphdiv');\n\tLoadjs('{$page}?graph=yes&container=Graphdiv',true);\n}\n\n\nLoadAjax('zipproxy_status','{$page}?service-status=yes');\n{$setTimeout}\n</script>\t\n\t\n";
    echo $tpl->_ENGINE_parse_body($html);
}
function params()
{
    $t = time();
    $sock = new sockets();
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 1) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled_see_performance}"));
        return;
    }
    $DisableArticaProxyStatistics = $sock->GET_INFO("DisableArticaProxyStatistics");
    $EnableSquidRemoteMySQL = $sock->GET_INFO("EnableSquidRemoteMySQL");
    $CleanArticaSquidDatabases = $sock->GET_INFO("CleanArticaSquidDatabases");
    $EnableProxyLogHostnames = $sock->GET_INFO("EnableProxyLogHostnames");
    $MacResolvInterface = $sock->GET_INFO("MacResolvInterface");
    if (!is_numeric($EnableSquidRemoteMySQL)) {
        $EnableSquidRemoteMySQL = 0;
    }
    if (!is_numeric($DisableArticaProxyStatistics)) {
        $DisableArticaProxyStatistics = 0;
    }
    if (!is_numeric($CleanArticaSquidDatabases)) {
        $CleanArticaSquidDatabases = 0;
    }
    if (!is_numeric($EnableProxyLogHostnames)) {
        $EnableProxyLogHostnames = 0;
    }
    $net = new networking();
    $interfaces = $net->Local_interfaces();
    $array[null] = "{none}";
    while (list($eth, $line) = each($interfaces)) {
        if ($eth == "lo") {
            continue;
        }
        $ip = new system_nic($eth);
        $array[$eth] = $ip->IPADDR . " (" . $ip->NICNAME . ")";
    }
    $p = Paragraphe_switch_img("{DisableArticaProxyStatistics}", "{DisableArticaProxyStatistics_explain}", "DisableArticaProxyStatistics", $DisableArticaProxyStatistics, null, 600);
    $p1 = Paragraphe_switch_img("{CleanArticaSquidDatabases}", "{CleanArticaSquidDatabases_explain}", "CleanArticaSquidDatabases", $CleanArticaSquidDatabases, null, 600);
    $p2 = Paragraphe_switch_img("{EnableProxyLogHostnames}", "{EnableProxyLogHostnames_explain}", "EnableProxyLogHostnames", $EnableProxyLogHostnames, null, 600);
    if ($EnableSquidRemoteMySQL == 1) {
        $TuningParameters = unserialize(base64_decode($sock->GET_INFO("MySQLSyslogParams")));
        $error = "<div style='font-size:16px' class=explain>{remote_mysqlsquidserver_text}<br><strong>mysql://{$TuningParameters["mysqlserver"]}:{$TuningParameters["RemotePort"]}</strong></div>";
        $p = Paragraphe_switch_disable("{DisableArticaProxyStatistics}", "{DisableArticaProxyStatistics_explain}", null, 600) . "" . Field_hidden("DisableArticaProxyStatistics", 0);
    }
    $html = "\n\t<div id={$t}></div>\n\t<div style='width:98%' class=form>\n\t{$error}\n\t<table>\n\t<tr>\n\t\t<td colspan=3>{$p}</td>\n\t</tr>\n\t<tr><td colspan=3><hr></td></tr>\n\t<tr>\n\t\t<td colspan=3>{$p1}</td>\n\t</tr>\n\n\t\n\t<tr>\n\t\t<td colspan=3 align='right'>" . button("{apply}", "SaveStopArticaStats()", 16) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t<div style='width:98%' class=form>\n\t<table>\n\t<tr>\n\t\t<td colspan=3>{$p2}</td>\n\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:16px'>{mac_resolv_interface}:</td>\n\t\t<td>" . Field_array_Hash($array, "MacResolvInterface", $MacResolvInterface, null, null, 0, "font-size:16px") . "</td>\n\t\t<td width=1%>" . help_icon("{mac_resolv_interface_help}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td  align='right' colspan=3>" . button("{apply}", "SaveOptions{$t}()", 16) . "</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t<script>\n\tvar x_SaveStopArticaStats= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\tRefreshTab('artica_stats_tabs');\n\t\tCacheOff();\n\t\tConfigureYourserver();\n\t}\n\n\t\t\n\t\t\n\tfunction SaveStopArticaStats(){\n\t\t\tvar XHR = new XHRConnection();\t\n\t\t\tXHR.appendData('DisableArticaProxyStatistics',document.getElementById('DisableArticaProxyStatistics').value);\n\t\t\tXHR.appendData('CleanArticaSquidDatabases',document.getElementById('CleanArticaSquidDatabases').value);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveStopArticaStats);\n\t\t\t}\n\t\t\t\n\tvar xSaveOptions{$t}= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\n\t}\t\t\t\n\t\t\t\n\tfunction SaveOptions{$t}(){\n\t\t\tvar XHR = new XHRConnection();\t\n\t\t\tXHR.appendData('EnableProxyLogHostnames',document.getElementById('EnableProxyLogHostnames').value);\n\t\t\tXHR.appendData('MacResolvInterface',document.getElementById('MacResolvInterface').value);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',xSaveOptions{$t});\n\t\t\t}\t\t\t\n\t\t\t\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 28
0
function main()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $sock = new sockets();
    $t = time();
    $SquidGuardIPWeb = $sock->GET_INFO("SquidGuardIPWeb");
    $SquidGuardApachePort = intval($sock->GET_INFO("SquidGuardApachePort"));
    if ($SquidGuardApachePort == 0) {
        $SquidGuardApachePort = 9020;
    }
    $UseRemoteUfdbguardService = intval($sock->GET_INFO("UseRemoteUfdbguardService"));
    $UfdbGuardThreads = $sock->GET_INFO("UfdbGuardThreads");
    $ufdbclass = new compile_ufdbguard();
    $UFDB = unserialize(base64_decode($sock->GET_INFO("ufdbguardConfig")));
    $UFDB = $ufdbclass->SetDefaultsConfig($UFDB);
    $datas = $UFDB;
    $EnableKerbAuth = $sock->GET_INFO("EnableKerbAuth");
    $EnableGoogleSafeSearch = $sock->GET_INFO("EnableGoogleSafeSearch");
    $EnableGoogleSafeBrowsing = intval($sock->GET_INFO("EnableGoogleSafeBrowsing"));
    $EnableGoogleSafeBrowsing_popupon = $tpl->javascript_parse_text("{EnableGoogleSafeBrowsing_popupon}");
    $EnableGoogleSafeBrowsing_popupoff = $tpl->javascript_parse_text("{EnableGoogleSafeBrowsing_popupoff}");
    $DisableGoogleSSL = intval($sock->GET_INFO("DisableGoogleSSL"));
    $PhishTankApiKey = $sock->GET_INFO("PhishTankApiKey");
    $EnableSquidPhishTank = intval($sock->GET_INFO("EnableSquidPhishTank"));
    if (!is_numeric($EnableGoogleSafeSearch)) {
        $EnableGoogleSafeSearch = 1;
    }
    $SquidUrgency = intval($sock->GET_INFO("SquidUrgency"));
    $ufdbguardConfig = unserialize(base64_decode($sock->GET_INFO("ufdbguardConfig")));
    if (!is_numeric($ufdbguardConfig["DebugAll"])) {
        $ufdbguardConfig["DebugAll"] = 0;
    }
    if ($ufdbguardConfig["DebugAll"] == 1) {
        echo FATAL_ERROR_SHOW_128("<strong>{webfiltering_in_debug_mode}</strong><p>&nbsp;</p>{webfiltering_in_debug_mode_text}\n\t\t\t\t<div style='margin:20px;text-align:right'>" . button("{disable}", "Loadjs('ufdbguard.debug.php')", 20) . "</div>\n\t\t\t\t\n\t\t\t\t");
    }
    if ($SquidUrgency == 1) {
        echo FATAL_ERROR_SHOW_128("<strong>{proxy_in_emergency_mode}</strong><p>&nbsp;</p>{proxy_in_emergency_mode_explain}\n\t\t<div style='margin:20px;text-align:right'>" . button("{urgency_mode}", "Loadjs('squid.urgency.php?justbutton=yes')", 20) . "</div>\n\t\t");
    }
    $GoogleSafeBrowsingApiKey = $sock->GET_INFO("GoogleSafeBrowsingApiKey");
    $UfdbUseArticaClient = $sock->GET_INFO("UfdbUseArticaClient");
    if (!is_numeric($UfdbUseArticaClient)) {
        $UfdbUseArticaClient = 1;
    }
    $GoogleSafeBrowsingApiKey_color = "#04A910";
    $GoogleSafeBrowsingApiKey_link = $tpl->_ENGINE_parse_body("{defined}");
    $PhishTankApiKey_color = "#04A910";
    $PhishTankApiKey_link = $tpl->_ENGINE_parse_body("{defined}");
    if (strlen($PhishTankApiKey) < 10) {
        $PhishTankApiKey_color = "#A90404";
        $PhishTankApiKey_link = $tpl->_ENGINE_parse_body("{not_set}");
    }
    if (strlen($GoogleSafeBrowsingApiKey) < 10) {
        $GoogleSafeBrowsingApiKey_color = "#A90404";
        $GoogleSafeBrowsingApiKey_link = $tpl->_ENGINE_parse_body("{not_set}");
    }
    $EnableGoogleSafeBrowsing_field = Paragraphe_switch_img("{EnableGoogleSafeBrowsing}", "{EnableGoogleSafeBrowsing_explain}\n\t\t\t\t<div style='margin-top:10px;text-align:right'>\n\t\t\t\t\t<a href=\"javascript:Loadjs('{$page}?GoogleSafeBrowsingApiKey-js=yes')\"\n\t\t\t\t\tstyle='font-size:22px;color:{$GoogleSafeBrowsingApiKey_color};text-decoration:underline'>{API_KEY}:{$GoogleSafeBrowsingApiKey_link}</a>\n\t\t\t\n\t\t\t\t\t</div>\n\t\t\t<div style='margin-top:10px;text-align:right'>\n\t\t\t\t\t<a href=\"https://developers.google.com/safe-browsing/key_signup\"\n\t\t\t\t\tstyle='font-size:18px;text-decoration:underline' target=_new>Google:&nbsp;{free_register}</a>\n\t\t\t\t\t</div>\n\t\t\t\t", "EnableGoogleSafeBrowsing-{$t}", $EnableGoogleSafeBrowsing, null, 750);
    $EnablePhishtank = Paragraphe_switch_img("{PhishTank_enable}", "{PhishTank_about}\n\t\t\t<div style='margin-top:10px;text-align:right'>\n\t\t\t<a href=\"javascript:Loadjs('{$page}?PhishTankApiKey-js=yes')\"\n\t\t\tstyle='font-size:22px;color:{$PhishTankApiKey_color};text-decoration:underline'>{API_KEY}:{$PhishTankApiKey_link}</a>\n\t\t\t\t\n\t\t\t</div>\n\t\t\t<div style='margin-top:10px;text-align:right'>\n\t\t\t<a href=\"https://www.phishtank.com/api_register.php\"\n\t\t\tstyle='font-size:18px;text-decoration:underline' target=_new>PhishTank:&nbsp;{free_register}</a>\n\t\t\t</div>\n\t\t\t", "EnableSquidPhishTank-{$t}", $EnableSquidPhishTank, null, 750);
    $EnableGoogleSafeBrowsing_button = button("{apply}", "EnableGoogleSafeBrowsing{$t}()", 26);
    $EnablePhishtank_button = button("{apply}", "EnablePhishtank{$t}()", 26);
    if ($UfdbUseArticaClient == 0) {
        $EnableGoogleSafeBrowsing_field = Paragraphe_switch_disable("{EnableGoogleSafeBrowsing}", "{EnableGoogleSafeBrowsing_explain}", "EnableGoogleSafeBrowsing-{$t}", $EnableGoogleSafeBrowsing, null, 750);
        $EnablePhishtank = Paragraphe_switch_disable("{PhishTank_enable}", "{PhishTank_about}", "EnableSquidPhishTank-{$t}", $EnableSquidPhishTank, null, 750);
        $EnableGoogleSafeBrowsing_button = null;
        $EnablePhishtank_button = null;
    }
    if ($UFDB["UseRemoteUfdbguardService"] == 1) {
        $sock->SET_INFO("UseRemoteUfdbguardService", 1);
        $UseRemoteUfdbguardService = 1;
    }
    if ($DisableGoogleSSL == 1) {
        $DisableGoogleSSL_text = "{enabled}";
    } else {
        $DisableGoogleSSL_text = "{disabled}";
    }
    echo $tpl->_ENGINE_parse_body("<div style='margin-bottom:20px;margin-top:20px;width:98%' class=form>\n\t\t\t{$EnablePhishtank}\n\t\t\t<div style='text-align:right'>{$EnablePhishtank_button}</div>\n\t\t\t</div>");
    if ($UseRemoteUfdbguardService == 0) {
        echo $tpl->_ENGINE_parse_body("<div style='margin-bottom:20px;margin-top:20px;width:98%' class=form>" . Paragraphe_switch_img("{EnableGoogleSafeSearch}", "{safesearch_explain}\n\t\t\t\t<div style='margin-top:10px;text-align:right'>\n\t\t\t\t\t<a href=\"javascript:Loadjs('squid.google.ssl.php')\" \n\t\t\t\t\tstyle='font-size:22px;text-decoration:underline'>{disable_google_ssl} ({$DisableGoogleSSL_text})</a></div>\n\t\t\t\t\n\t\t\t\t", "EnableGoogleSafeSearch-{$t}", $EnableGoogleSafeSearch, null, 750) . "\n\t\t\t\t\t\n\t\t<div style='text-align:right'>" . button("{apply}", "EnableGoogleSafeSearch{$t}()", 26) . "</div>\t\t\t\n\t\t</div>");
    }
    echo $tpl->_ENGINE_parse_body("<div style='margin-bottom:20px;margin-top:20px;width:98%' class=form>\n\t\t{$EnableGoogleSafeBrowsing_field}\n\t\t<div style='text-align:right'>{$EnableGoogleSafeBrowsing_button}</div>\n\t\t</div>");
    if ($SquidGuardIPWeb == null) {
        $SquidGuardIPWeb = "http://" . $_SERVER['SERVER_ADDR'] . ':' . $SquidGuardApachePort . "/exec.squidguard.php";
        $fulluri = "http://" . $_SERVER['SERVER_ADDR'] . ':' . $SquidGuardApachePort . "/exec.squidguard.php";
        $sock->SET_INFO("SquidGuardIPWeb", $fulluri);
    } else {
        $fulluri = $SquidGuardIPWeb;
    }
    if (!$users->CORP_LICENSE) {
        $MyVersion = "{license_error}";
    } else {
        $q = new mysql_squid_builder();
        $MyVersion = trim($sock->getFrameWork("ufdbguard.php?articawebfilter-database-version=yes"));
        $MyVersion = $q->time_to_date($MyVersion, true);
    }
    if ($UseRemoteUfdbguardService == 0) {
        $wizard = "\n\t\t<tr><td colspan=3>&nbsp;</td></tr>\n\t\t<tr>\n\t\t\t<td colspan=3 align='center'>" . button("{wizard_rule}", "Loadjs('dansguardian2.wizard.rule.php')", 26) . "\n\t\t\t\t\t<div style='font-size:14px;margin-top:15px'>{wizard_rule_ufdb_explain}</div>\n\t\t\t\t\t\n\t\t\t\t\t</td>\n\t\t\t\n\t\t</tr>";
        $build_rules = "<tr><td colspan=3>&nbsp;</td></tr>\n\t\t<tr>\n\t\t\t<td colspan=3 align='center'>" . button("{compile_rules}", "Loadjs('dansguardian2.compile.php');", 26) . "\n\t\t\t\t\t<div style='font-size:14px;margin-top:15px'>{wizard_rule_ufdb_compile_explain}</div>\n\t\t\t\t\t\n\t\t\t\t\t</td>\n\t\t\t\n\t\t</tr>";
    }
    $t = time();
    $html = "\n\t<div style='width:98%' class=form>\n\t\t<div style='font-size:28px;font-weight:bold'>\n\t\t<table style='width:100%;margin-top:30px'>\n\t\t<tr>\n\t\t\t<td style='vertical-align:middle;font-size:18px' class=legend>{listen_address}:</td>\n\t\t\t<td style='vertical-align:middle;font-size:18px'>{$datas["listen_addr"]}:{$datas["listen_port"]}</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\t\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\t\n\t\t<tr>\n\t\t\t<td style='vertical-align:middle;font-size:18px' class=legend>{webpage_deny_url}:</td>\n\t\t\t<td style='vertical-align:middle;font-size:18px'>{$fulluri}</td>\n\t\t\t<td>" . button("{options}", "Loadjs('ufdbguard.urichange.php')", 16) . "</td>\n\t\t</tr>\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t<tr>\n\t\t\t<td style='vertical-align:middle;font-size:18px' class=legend>{artica_databases}:</td>\n\t\t\t<td style='vertical-align:middle;font-size:18px'>{$MyVersion}</td>\n\t\t\t<td>" . button("{options}", "LoadAjax('BodyContent','artica.update.php?webfiltering-tabs=yes&from-ufdbguard=yes')", 16) . "</td>\n\t\t</tr>\n\n\t\t{$wizard}\n\t\t{$build_rules}\n\t\t\n\t\t\n\t\t</table>\n\n\t\t\n\t\t<script>\n\t\t\n\tvar xEnableGoogleSafeSearch{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tLoadjs('dansguardian2.compile.php');\n\t\t\n\t}\t\t\n\t\t\n\tfunction EnableGoogleSafeSearch{$t}(){\n\t\tif(!document.getElementById('EnableGoogleSafeSearch-{$t}')){ alert('Error in field, please refresh...'); return; }\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('EnableGoogleSafeSearch', document.getElementById('EnableGoogleSafeSearch-{$t}').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xEnableGoogleSafeSearch{$t});  \n\t}\n\t\n\tvar xEnableGoogleSafeBrowsing{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tLoadAjaxRound('main-ufdb-frontend','ufdbguard.status.php');\n\t\tLoadjs('squid.compile.progress.php');\n\t\t\n\t}\t\n\t\n\tfunction EnableGoogleSafeBrowsing{$t}(){\n\t\tif(!document.getElementById('EnableGoogleSafeBrowsing-{$t}')){alert('Error in field, please refresh...'); return; }\n\t\tvar XHR = new XHRConnection();\n\t\tvar EnableGoogleSafeBrowsing=document.getElementById('EnableGoogleSafeBrowsing-{$t}').value;\n\t\tif(EnableGoogleSafeBrowsing==1){ if(!confirm('{$EnableGoogleSafeBrowsing_popupon}')){return;} }\n\t\tif(EnableGoogleSafeBrowsing==0){if(!confirm('{$EnableGoogleSafeBrowsing_popupoff}')){return;} }\n\t\tXHR.appendData('EnableGoogleSafeBrowsing', EnableGoogleSafeBrowsing);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xEnableGoogleSafeBrowsing{$t}); \t\n\t\n\t}\n\t\n\tfunction  EnablePhishtank{$t}(){\n\t\tif(!document.getElementById('EnableSquidPhishTank-{$t}')){alert('Error in field, please refresh...'); return; }\n\t\tvar XHR = new XHRConnection();\n\t\tvar EnableSquidPhishTank=document.getElementById('EnableSquidPhishTank-{$t}').value;\n\t\tXHR.appendData('EnableSquidPhishTank', EnableSquidPhishTank);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xEnableGoogleSafeBrowsing{$t}); \n\t}\n\t\n</script>\n\t\t\n\t\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 29
0
function global_parameters_popup()
{
    $sock = new sockets();
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $t = $_GET["t"];
    $ejabberdEnabled = $sock->GET_INFO("ejabberdEnabled");
    $ejabberdInsideZarafa = $sock->GET_INFO("ejabberdInsideZarafa");
    if (!is_numeric($ejabberdEnabled)) {
        $ejabberdEnabled = 1;
    }
    if (!is_numeric($ejabberdInsideZarafa)) {
        $ejabberdInsideZarafa = 0;
    }
    $paragraph = Paragraphe_switch_img("{activate_instant_messaging}", "{APP_EJABBERD_ABOUT}", "ejabberdEnabled-{$t}", $ejabberdEnabled, null, 550);
    $paragraph2 = Paragraphe_switch_img("{activate_instant_messaging_Zarafa}", "{activate_instant_messaging_Zarafa_explain}", "ejabberdInsideZarafa-{$t}", $ejabberdInsideZarafa, null, 550);
    if (!$users->ZARAFA_INSTALLED) {
        $paragraph2 = Paragraphe_switch_disable("{activate_instant_messaging_Zarafa}", "{activate_instant_messaging_Zarafa_explain}", null, 550);
    }
    $html = "\n\t\t<div id='{$t}-div'></div>\n\t\t{$paragraph}<hr>\n\t\t{$paragraph2}\n\t\t<hr>\n\t\t<div style='text-align:right'>" . button("{apply}", "SaveejabberdEnabled()", 18) . "</div>\n\t\t\t\t\n<script>\n\tvar x_SaveejabberdEnabled= function (obj) {\n\t\tdocument.getElementById('{$t}-div').innerHTML='';\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);return;}\n\t\t\$('#jabberd-table-{$t}').flexReload();\n\t\tYahooWin2Hide();\n\t}\t\t\t\n\t\t\n\tfunction SaveejabberdEnabled(){\n\t\tvar valuz=document.getElementById('ejabberdEnabled-{$t}').value;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('ejabberdEnabled',valuz);\n\t\tif(document.getElementById('ejabberdInsideZarafa-{$t}')){\n\t\t\tXHR.appendData('ejabberdInsideZarafa',document.getElementById('ejabberdInsideZarafa-{$t}').value);\n\t\t}\n\t\tAnimateDiv('{$t}-div');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveejabberdEnabled);\t\n\t}\t\n</script>\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 30
0
function parameters_client()
{
    $sock = new sockets();
    $tpl = new templates();
    $page = CurrentPageName();
    $RemoteUfdbCat = intval($sock->GET_INFO("RemoteUfdbCat"));
    $ufdbCatPort = intval($sock->GET_INFO("ufdbCatPort"));
    $ufdbCatInterface = $sock->GET_INFO("ufdbCatInterface");
    $EnableLocalUfdbCatService = intval($sock->GET_INFO("EnableLocalUfdbCatService"));
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    $EnableIntelCeleron = intval(file_get_contents("/etc/artica-postfix/settings/Daemons/EnableIntelCeleron"));
    if ($SquidPerformance == 0) {
        if ($EnableLocalUfdbCatService == 0) {
            $p00 = Paragraphe_switch_img("{local_categories_services_activated}", "{use_local_categories_services_perf}</strong>", "none", 1, null, 800, "blur()") . "<hr><p>&nbsp;</p>";
        }
    }
    if ($ufdbCatPort == 0) {
        $ufdbCatPort = 3978;
    }
    $p0 = Paragraphe_switch_img("{use_local_categories_services}", "{use_remote_categories_services_explain}<br><strong>{use_local_categories_services_explain_warn}</strong>", "EnableLocalUfdbCatService", $EnableLocalUfdbCatService, null, 800, "EnableLocalUfdbCatServiceCheck()");
    if ($SquidPerformance > 2) {
        $EnableLocalUfdbCatService = 0;
        $p0 = Paragraphe_switch_disable("{use_local_categories_services}", "{use_remote_categories_services_explain}<br><strong>{use_local_categories_services_explain_warn}</strong>", "EnableLocalUfdbCatService", $EnableLocalUfdbCatService, null, 800, "EnableLocalUfdbCatServiceCheck()");
    }
    if ($EnableIntelCeleron == 1) {
        $EnableLocalUfdbCatService = 0;
        $p0 = Paragraphe_switch_disable("{use_local_categories_services}", "{use_remote_categories_services_explain}<br><strong>{CELERON_METHOD_EXPLAIN}</strong>", "EnableLocalUfdbCatService", $EnableLocalUfdbCatService, null, 800, "EnableLocalUfdbCatServiceCheck()");
    }
    $p1 = Paragraphe_switch_img("{use_remote_categories_services}", "{use_remote_categories_services_explain}", "RemoteUfdbCat", $RemoteUfdbCat, null, 800);
    $ip = new networking();
    $ips = $ip->ALL_IPS_GET_ARRAY();
    $ufdbCatInterface = $sock->GET_INFO("ufdbCatInterface");
    $ufdbCatPort = intval($sock->GET_INFO("ufdbCatPort"));
    $UfdbCatThreads = intval($sock->GET_INFO("UfdbCatThreads"));
    unset($ips["127.0.0.1"]);
    for ($i = 1; $i < 65; $i++) {
        $threads[$i] = $i;
    }
    if ($UfdbCatThreads == 0) {
        $UfdbCatThreads = 4;
    }
    if ($ufdbCatPort == 0) {
        $ufdbCatPort = 3978;
    }
    $ips[null] = "{none}";
    reset($ips);
    $t = time();
    $html = "\n<div style='width:98%' class=form>\n\t\t\t{$p00}{$p0}\n\t\t\t<table style='width:100%'>" . Field_list_table("ufdbCatInterface1", "{listen_address}", $ufdbCatInterface, 22, $ips) . Field_text_table("ufdbCatPort1", "{listen_port}", $ufdbCatPort, 22, null, 120) . Field_list_table("UfdbCatThreads1", "{threads}", $UfdbCatThreads, 22, $threads) . "</table>\n\t\t\t<div id='design1-{$t}'>{$p1}\n\t<table style='width:100%'>\n\t " . Field_text_table("ufdbCatInterface", "{remote_address}", $ufdbCatInterface, 22, null, 230) . Field_text_table("ufdbCatPort", "{listen_port}", $ufdbCatPort, 22, null, 120) . "</table>\n\t</div>" . "\n\t\t\t\n\t\t\t\n<table style='width:100%'>" . Field_button_table_autonome("{apply}", "Save{$t}()", 32) . "\n\t\t</table>\n\t\t</div>\n\t\t<script>\nvar xSave{$t}=function (obj) {\n\tRefreshTab('main_ufdbguard_config');\n\tLoadjs('squid.reconfigure.simple.php');\n}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar EnableLocalUfdbCatService=document.getElementById('EnableLocalUfdbCatService').value;\n\t\n\tif(EnableLocalUfdbCatService==0){\n\t\tXHR.appendData('ufdbCatInterface',document.getElementById('ufdbCatInterface').value);\n\t\tXHR.appendData('ufdbCatPort',document.getElementById('ufdbCatPort').value);\n\t\tXHR.appendData('RemoteUfdbCat',document.getElementById('RemoteUfdbCat').value);\n\t}else{\n\t\tXHR.appendData('ufdbCatInterface',document.getElementById('ufdbCatInterface1').value);\n\t\tXHR.appendData('ufdbCatPort',document.getElementById('ufdbCatPort1').value);\n\t\tXHR.appendData('UfdbCatThreads',document.getElementById('UfdbCatThreads1').value);\n\t\n\t}\n\tXHR.appendData('EnableLocalUfdbCatService',document.getElementById('EnableLocalUfdbCatService').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\t\n\t\n\tfunction EnableLocalUfdbCatServiceCheck(){\n\tvar EnableLocalUfdbCatService=document.getElementById('EnableLocalUfdbCatService').value;\n\t\t\tdocument.getElementById('ufdbCatInterface').disabled=false;\n\t\t\tdocument.getElementById('ufdbCatPort').disabled=false;\n\t\t\tdocument.getElementById('RemoteUfdbCat').disabled=false;\n\t\t\tdocument.getElementById('ufdbCatInterface1').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatPort1').disabled=true;\n\t\t\tdocument.getElementById('UfdbCatThreads1').disabled=true;\n\t\t\t\n\t\t\tdocument.getElementById('design1-{$t}').style.visibility='visible';\n\t\t\t\n\t\t\n\t\tif(EnableLocalUfdbCatService==1){\n\t\t\tdocument.getElementById('RemoteUfdbCat').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatInterface').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatPort').disabled=true;\n\t\t\tdocument.getElementById('RemoteUfdbCat').disabled=true;\n\t\t\tdocument.getElementById('ufdbCatInterface1').disabled=false;\n\t\t\tdocument.getElementById('ufdbCatPort1').disabled=false;\n\t\t\tdocument.getElementById('UfdbCatThreads1').disabled=false;\n\t\t\t\n\t\t\tdocument.getElementById('design1-{$t}').style.visibility='hidden';\n\t\t}\n\t\t\n\t\tCheckBoxDesignHidden();\n\t}\n\tEnableLocalUfdbCatServiceCheck();\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}