Esempio n. 1
0
function start()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $users = new usersMenus();
    $zarafa = $tpl->_ENGINE_parse_body(quicklinks_paragraphe("zarafa-logo-48.png", "APP_ZARAFA", null, "QuickLinkSystems('section_zarafa')"));
    $postfix = $tpl->_ENGINE_parse_body(quicklinks_paragraphe("mass-mailing-postfix-48.png", "APP_POSTFIX", null, "QuickLinkSystems('section_postfix')"));
    if (!$users->ZARAFA_INSTALLED) {
        $zarafa = null;
    }
    $tr[] = $zarafa;
    $tr[] = $postfix;
    $tr[] = $tpl->_ENGINE_parse_body(quicklinks_paragraphe("48-bouclier.png", "security", "", "QuickLinkSystems('section_security')"));
    $tr[] = $tpl->_ENGINE_parse_body(quicklinks_paragraphe("folder-queue-48.png", "queue_management", "", "QuickLinkSystems('section_queue')"));
    $tr[] = $tpl->_ENGINE_parse_body(quicklinks_paragraphe("48-categories-white.png", "white list", "", "QuickLinkSystems('section_whitelist')"));
    $tr[] = $tpl->_ENGINE_parse_body(quicklinks_paragraphe("web-site-48.png", "main_interface", "main_interface_back_interface_text", "QuickLinksHide()"));
    $count = 1;
    while (list($key, $line) = each($tr)) {
        if ($line == null) {
            continue;
        }
        $f[] = "<li id='kwick1'>{$line}</li>";
        $count++;
    }
    $html = "\n            <div id='QuickLinksTop'>\n                <ul class='kwicks'>\n\t\t\t\t\t" . @implode("\n", $f) . "\n                    \n                </ul>\n            </div>\n\t\n\t<div id='BodyContent' style='width:900px'></div>\n\t\n\t\n\t<script>\n\t\tfunction LoadQuickTaskBar(){\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$('#QuickLinksTop .kwicks').kwicks({max: 205,spacing:  5});\n\t\t\t});\n\t\t}\n\t\t\n\t\n\t\tfunction QuickLinkSystems(sfunction){\n\t\t\tSet_Cookie('QuickLinkCachePostfix', '{$page}?function='+sfunction, '3600', '/', '', '');\n\t\t\tLoadAjax('BodyContent','{$page}?function='+sfunction);\n\t\t}\n\t\t\n\t\tfunction QuickLinkMemory(){\n\t\t\tvar memorized=Get_Cookie('QuickLinkCachePostfix');\n\t\t\tif(!memorized){QuickLinkSystems('section_postfix');return;}\n\t\t\tif(memorized.length>0){LoadAjax('BodyContent',memorized);}else{QuickLinkSystems('section_mynic');}\n\t\t\n\t\t}\n\t\t\n\t\tLoadQuickTaskBar();\n\t\tQuickLinkMemory();\n\t</script>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function tabs()
{
    $uuid = $_GET["uuid"];
    $fontsize = 18;
    $tpl = new templates();
    $page = CurrentPageName();
    $array["RTT"] = "{realtime}";
    $array["WEEK"] = "{this_week}";
    $array["websites"] = "{websites}";
    while (list($num, $ligne) = each($array)) {
        if ($num == "RTT") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.bandwidth.rtt.week.php?uuid={$uuid}&meta=1\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "WEEK") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.bandwidth.rttw.week.php?uuid={$uuid}&meta=1\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "websites") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.bandwidth.rweb.week.php?uuid={$uuid}&meta=1\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n");
    }
    $html = build_artica_tabs($html, 'main_bandwidth_meta_tabs');
    echo $html;
}
Esempio n. 3
0
function countries_list()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $free = new freeweb($_GET["servername"]);
    $GEOIP = $free->Params["GEOIP"];
    $tables[] = "<table style='width:100%'><tr>";
    $t = 0;
    while (list($key, $line) = each($free->COUNTRIES_ISO)) {
        $line = trim($line);
        if ($line == null) {
            continue;
        }
        $t = $t + 1;
        if ($_GET["onlyS"] == 1) {
            if ($GEOIP[$line] != 1) {
                continue;
            }
        }
        //$js[]="";
        $content = "<td class=legend nowrap>{$key}</td><td>" . Field_checkbox("CT_{$line}", 1, $GEOIP[$line], "CheckAPGEO('{$line}')") . "</td>";
        $tables[] = $content;
        if ($t == 2) {
            $t = 0;
            $tables[] = "</tr><tr>";
        }
    }
    if ($t < 2) {
        for ($i = 0; $i <= $t; $i++) {
            $tables[] = "<td valign='top' width=1%>&nbsp;</td>";
        }
    }
    $tables[] = "</table>\n\t<script>\n\t\t\tvar x_CheckAPGEO=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);}\t\n\t\t\t\n\t\t}\t\n\t\n\t\n\t\tfunction CheckAPGEO(geo){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById('CT_'+geo).checked){XHR.appendData('value',1);}else{XHR.appendData('value',0);}\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\t\t\t\n\t\t\tXHR.appendData('country',geo);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_CheckAPGEO);\n\t\t}\n\t\n\t</script>\n\t";
    echo @implode("\n", $tables);
}
function Page()
{
    $ruleid = $_GET["ID"];
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $this_feature_is_disabled_corp_license = $tpl->javascript_parse_text("{this_feature_is_disabled_corp_license}");
    $CORP = 0;
    if ($users->CORP_LICENSE) {
        $CORP = 1;
    }
    $sock = new wifidog_settings($ruleid);
    $wifidog_templates = new wifidog_templates($ruleid);
    $users = new usersMenus();
    $CORP = 0;
    if ($users->CORP_LICENSE) {
        $CORP = 1;
    }
    $BACK_REPEAT["no-repeat"] = "no-repeat";
    $BACK_REPEAT["repeat-y"] = "repeat-y";
    $BACK_REPEAT["repeat-x"] = "repeat-x";
    $BACK_REPEAT["repeat"] = "repeat";
    $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td style='width:500px;'>\n\t\t<div style='width:500px;height:500px;border-radius:5px 5px 5px 5px;\n-moz-border-radius:5px;\n\t\t-webkit-border-radius:5px;background-repeat: {$wifidog_templates->BackgroundRepeat};background-position: {$wifidog_templates->BackgroundTOP}% {$wifidog_templates->BackgroundBottom}%;\n\t\tbackground-image:url(\"{$wifidog_templates->BackgroundPicturePath}\");background-color:#{$wifidog_templates->backgroundColor}'>&nbsp;</div>\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px'>{picture}:</td>\n\t\t\t\t\t<td style='font-size:16px'>" . button("{upload}", "Loadjs('webauth.rules.picture.upload.php?ruleid={$ruleid}')", 26) . "</td>\n\t\t\t\t</tr>\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px'>{top_position}:</td>\n\t\t\t\t\t<td style='font-size:22px'>" . Field_text("BackgroundTOP-{$t}", $wifidog_templates->BackgroundTOP, "font-size:22px;width:100px") . "%</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px'>{bottom_position}:</td>\n\t\t\t\t\t<td style='font-size:22px'>" . Field_text("BackgroundBottom-{$t}", $wifidog_templates->BackgroundBottom, "font-size:22px;width:100px") . "%</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{repeat}", null) . ":</td>\n\t\t\t\t\t<td style='font-size:22px'>" . Field_array_Hash($BACK_REPEAT, "BackgroundRepeat-{$t}", $wifidog_templates->BackgroundRepeat, null, null, 0, "font-size:22px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", "42px") . "</td>\n\t\t\t\t\t</tr>\t\t\t\t\t\t\t\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t</table>\n\t</td>\n\t</table>\n\t</div>\n\t<script>\n\t\n\tvar xSave{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\t\$('#HOSTPOT_RULES').flexReload();\n\t\tRefreshTab('HOTSPOT_TAB');\n\t}\t\n\t\n\tfunction Save{$t}(){\n\t\tvar CORP={$CORP};\n\t\tif(CORP==0){alert('{$this_feature_is_disabled_corp_license}');return;}\t\t\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('ruleid',{$ruleid});\n\t\tXHR.appendData('BackgroundTOP',encodeURIComponent(document.getElementById('BackgroundTOP-{$t}').value));\n\t\tXHR.appendData('BackgroundBottom',encodeURIComponent(document.getElementById('BackgroundBottom-{$t}').value));\n\t\tXHR.appendData('BackgroundRepeat',encodeURIComponent(document.getElementById('BackgroundRepeat-{$t}').value));\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\t\n\t}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 5
0
function tabs()
{
    $tpl = new templates();
    $array["index"] = '{parameters}';
    $array["rules"] = '{rules}';
    $array["transparent"] = '{transparent_rules}';
    $array["events"] = '{events}';
    //$array["plugins"]='{squid_plugins}';
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql();
    $style = "style='font-size:22px'";
    $t = time();
    while (list($num, $ligne) = each($array)) {
        if ($num == "index") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.php\" {$style}><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "events") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.events.php\" {$style}><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "rules") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.rules.php\" {$style}><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "transparent") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.transparent.php\" {$style}><span>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" {$style}><span>{$ligne}</span></a></li>\n");
    }
    echo build_artica_tabs($html, "ss5_main", 1490);
}
function items()
{
    //1.4.010916
    $t = $_GET["t"];
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql();
    $CommonName = $_GET["CommonName"];
    $data = array();
    $data['page'] = 1;
    $data['total'] = 0;
    $data['rows'] = array();
    $title = $tpl->javascript_parse_text("{privkey}");
    $jsEdit = "Loadjs('certificates.center.srca.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "srca", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>PRIVATE KEY</a></span>"));
    $title = $tpl->javascript_parse_text("{RSA_PRIVATE_KEY}");
    $jsEdit = "Loadjs('certificates.center.privkey.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "privkey", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>RSA PRIVATE KEY</a></span>"));
    $title = $tpl->javascript_parse_text("{certificate}");
    $jsEdit = "Loadjs('certificates.center.crt.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "certificate", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>CERTIFICATE</a></span>"));
    $title = $tpl->javascript_parse_text("{CSR}");
    $jsEdit = "Loadjs('certificates.center.csr.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "CSR", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>CERTIFICATE REQUEST</a></span>"));
    $data['total'] = count($data['rows']);
    echo json_encode($data);
}
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $ArticaHotSpotEmergency = intval($sock->GET_INFO("ArticaHotSpotEmergency"));
    $ArticaHotSpotPort = $sock->GET_INFO("ArticaHotSpotPort");
    $ArticaSSLHotSpotPort = $sock->GET_INFO("ArticaSSLHotSpotPort");
    $ArticaSplashHotSpotPort = $sock->GET_INFO("ArticaSplashHotSpotPort");
    $ArticaSplashHotSpotPortSSL = $sock->GET_INFO("ArticaSplashHotSpotPortSSL");
    if (!is_numeric($ArticaHotSpotPort)) {
        $ArticaHotSpotPort = 0;
    }
    if (!is_numeric($ArticaSplashHotSpotPort)) {
        $ArticaSplashHotSpotPort = 16080;
    }
    if (!is_numeric($ArticaSplashHotSpotPortSSL)) {
        $ArticaSplashHotSpotPortSSL = 16443;
    }
    $HotSpotGatewayAddr = $sock->GET_INFO("HotSpotGatewayAddr");
    $HotSpotGatewayAddr_org = $HotSpotGatewayAddr;
    $HotSpotGatewayAddrZ = explode(".", $HotSpotGatewayAddr);
    $HotSpotGatewayAddrz[3] = rand(1, 254);
    $HotSpotGatewayAddr = @implode(".", $HotSpotGatewayAddrz);
    $t = time();
    $ipaddr = $tpl->javascript_parse_text("{ipaddr}");
    $emergency_bt = "<center style='margin:30px'>" . button("{global_urgency_mode}", "Loadjs('squid.hostspot.emergency.enable.progress.php')", 40) . "</center>";
    if ($ArticaHotSpotEmergency == 1) {
        $emergency_bt = "<center style='margin:30px'>" . button("{disable_emergency_mode}", "Loadjs('squid.hostspot.emergency.disable.progress.php')", 40) . "</center>";
        $error = FATAL_ERROR_SHOW_128("{hotspot_in_emergency_mode_explain}");
    }
    $html = "\n\t<inpuyt type='hidden' id='layer-hotspot-maintenance' value='1'>\n\t{$error}\n\t<div style='width:98%' class=form>\n\t<center style='margin:30px'>" . button("{restart_web_service}", "Loadjs('squid.hostspot.restart.web.progress.php')", 40) . "</center>\n\t{$emergency_bt}\n\t\n\t\t\t\n\t\t\t\n\t</div>\n\t<script>\n\n\t</script>\t\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 8
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $cache_mgr_user = $sock->GET_INFO("cache_mgr_user");
    $cachemgr_passwd = $sock->GET_INFO("cachemgr_passwd");
    $cachemgr_left_menu = $sock->GET_INFO("cachemgr_left_menu");
    $sql = "SELECT servername,useSSL FROM freeweb WHERE `groupware`='cachemgr' LIMIT 0,1";
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if ($ligne["servername"] != null) {
        $FreeWebListenPort = $sock->GET_INFO("FreeWebListenPort");
        $FreeWebListenSSLPort = $sock->GET_INFO("FreeWebListenSSLPort");
        if (!is_numeric($FreeWebListenPort)) {
            $FreeWebListenPort = 80;
        }
        if (!is_numeric($FreeWebListenSSLPort)) {
            $FreeWebListenSSLPort = 443;
        }
        $prefix = "http";
        if ($ligne["useSSL"] == 1) {
            $FreeWebListenPort = $FreeWebListenSSLPort;
            $prefix = "https";
        }
        $link = "{$prefix}://{$ligne["servername"]}:{$FreeWebListenPort}";
        $linkjs = "javascript:s_PopUpFull('{$link}',800,800,'Squid Cache Manager')";
        $link = "<a href=\"javascript:blur();\" OnClick=\"{$linkjs}\" style='font-size:14px;text-decoration:underline'>{$link}</a>";
        $edit_www = "<a href=\"javascript:blur();\" OnClick=\"Loadjs('freeweb.edit.php?hostname={$ligne["servername"]}');\" style='font-size:14px;text-decoration:underline'>{edit}</a>";
    }
    $html = "\n\t<div class=explain>{cachemgr_text}</div><div style='text-align:right;margin-bottom:5px'><i>{$link}</i></div>\n\t<div id='cachemgr-div'>\n\t<div style='font-size:16px'>{cachemgr}:: {authentication}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend>{add_to_left_menu}:</td>\n\t\t<td>" . Field_checkbox("cachemgr_left_menu", 1, $cachemgr_left_menu, "cachemgr_left_menu_save();") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{username}:</td>\n\t\t<td>" . Field_text("cache_mgr_user", "{$cache_mgr_user}", "font-size:14px;padding:3px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{password}:</td>\n\t\t<td>" . Field_password("cachemgr_passwd", "{$cachemgr_passwd}", "font-size:14px;padding:3px") . "</td>\n\t</tr>\t\n\t</table>\n\t<br>\n\t\n\t<div style='font-size:16px'>{cachemgr}:: {website_name}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend>{website}:</td>\n\t\t<td>" . Field_text("website", $ligne["servername"], "font-size:14px;padding:3px;width:220px") . "&nbsp;{$edit_www}</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'>\n\t\t<hr>" . button("{apply}", "SaveCacheManagerParams()") . "</td>\n\t</tr>\n\t</table>\n\t<br>\t\n\t</div>\n\t<script>\n\n\tvar x_SaveCacheManagerParams= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\t\n\t\t\n\t}\n\n\tvar x_cachemgr_left_menu_save= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\t\n\t\tCacheOff();\n\t}\t\n\t\n\tfunction cachemgr_left_menu_save(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('cachemgr_left_menu').checked){\n\t\t\tXHR.appendData('cachemgr_left_menu',1)\n\t\t}else{\n\t\t\tXHR.appendData('cachemgr_left_menu',0)\n\t\t}\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_cachemgr_left_menu_save);\n\t\t\n\t}\n\t\n\t\n\tfunction SaveCacheManagerParams(key){\n\t\tvar XHR = new XHRConnection();\n\t\tvar a=document.getElementById('cache_mgr_user').value;\n\t\tif(a.length<3){return;}\n\t\ta=document.getElementById('cachemgr_passwd').value;\n\t\tif(a.length<3){return;}\t\t\n\t\ta=document.getElementById('website').value;\n\t\tif(a.length<3){return;}\t\t\t\n\t\t\n\t\tXHR.appendData('cache_mgr_user',document.getElementById('cache_mgr_user').value);\t\n\t\tXHR.appendData('cachemgr_passwd',document.getElementById('cachemgr_passwd').value);\n\t\tXHR.appendData('website',document.getElementById('website').value);\n\t\tdocument.getElementById('cachemgr-div').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveCacheManagerParams);\n\t\t}\t\n\n\t</script>\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 9
0
function popup()
{
    $sock = new sockets();
    $page = CurrentPageName();
    $CyrusEnableLMTPUnix = $sock->GET_INFO("CyrusEnableLMTPUnix");
    if ($CyrusEnableLMTPUnix == null) {
        $CyrusEnableLMTPUnix = 1;
    }
    $nets["127.0.0.1"] = "127.0.0.1";
    $net = new networking();
    while (list($num, $ipaddr) = each($net->array_TCP)) {
        if ($ipaddr == null) {
            continue;
        }
        $nets[$ipaddr] = $ipaddr;
    }
    $CyrusLMTPListen = trim($sock->GET_INFO("CyrusLMTPListen"));
    if ($CyrusLMTPListen == null) {
        $CyrusLMTPListen = "127.0.0.1:2005";
    }
    if (preg_match("#(.+?):(.+)#", $CyrusLMTPListen, $re)) {
        $ipaddr_listen = $re[1];
        $port = $re[2];
    }
    $lmtp_unix = "/var/spool/postfix/var/run/cyrus/socket/lmtp";
    $html = "\n\t<div id='cyrus_lmtp_div'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td width=1% valign='top'><img src='img/database-connect-settings-90.png'></td>\n\t\t<td valign='top'>\n\t<div style='font-size:13px;padding:5px'>{cyrus_lmtp_howto}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{enable_lmtp_unix}:</td>\n\t\t<td>" . Field_checkbox("CyrusEnableLMTPUnix", 1, $CyrusEnableLMTPUnix, "CyrusEnableLMTPUnixSwitch()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{listen_ip}:</td>\n\t\t<td>\n\t\t\t<table style='width:1%'>\n\t\t\t<tr>\n\t\t\t\t<td width=1%>" . Field_array_Hash($nets, "lmtp_ipaddr", $ipaddr_listen, null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t\t\t<td width=1%>:</td>\n\t\t\t\t<td width=1%>" . Field_text("lmtp_port", $port, "font-size:13px;padding:3px;width:40px") . "</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>\n\t\t\t" . button("{apply}", "CyrusEnableLMTPUnixSave()") . "</td>\n\t</tr>\n\t</table>\n\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\t\n\tvar x_CyrusEnableLMTPUnixSave= function (obj) {\n\t\tYahooWinHide();\n\t}\t\n\t\n\tfunction CyrusEnableLMTPUnixSave(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('CyrusEnableLMTPUnix').checked){XHR.appendData('CyrusEnableLMTPUnix',1);}else{XHR.appendData('CyrusEnableLMTPUnix',0);}\n\t\tXHR.appendData('CyrusLMTPListen',document.getElementById('lmtp_ipaddr').value+':'+document.getElementById('lmtp_port').value);\n\t\tdocument.getElementById('cyrus_lmtp_div').innerHTML='<div style=\"width:100%\"><center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center></div>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_CyrusEnableLMTPUnixSave);\n\t}\n\t\t\n\t\tCyrusEnableLMTPUnixSwitch();\n\t</script>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 10
0
function etch()
{
    $interface = $_GET["etch"];
    $cmdr[] = "ressources/logs/vnstat-{$interface}-resume.png";
    $cmdr[] = "ressources/logs/vnstat-{$interface}-hourly.png";
    $cmdr[] = "ressources/logs/vnstat-{$interface}-daily.png";
    $cmdr[] = "ressources/logs/vnstat-{$interface}-monthly.png";
    $cmdr[] = "ressources/logs/vnstat-{$interface}-top.png";
    $imgs = array();
    $tpl = new templates();
    $page = CurrentPageName();
    $error = "<center style='font-size:18px;color:red;margin:5px;font-weight:bolder'>{NO_DATA_COME_BACK_LATER}</center><center><img src='img/report-warning-256.png'></center>";
    while (list($num, $filename) = each($cmdr)) {
        if (!is_file($filename)) {
            continue;
        }
        $t = time();
        $imgs[] = "<center style='margin:10px'><img src='{$filename}?{$t}'></center>";
    }
    if (count($imgs) == 0) {
        echo $tpl->_ENGINE_parse_body("{$error}");
        return;
    }
    echo $tpl->_ENGINE_parse_body(@implode("\n", $imgs));
}
Esempio n. 11
0
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $EnableZarafaIndexer = $sock->GET_INFO("EnableZarafaIndexer");
    $ZarafaIndexerInterval = $sock->GET_INFO("ZarafaIndexerInterval");
    $ZarafaIndexerThreads = $sock->GET_INFO("ZarafaIndexerThreads");
    if (!is_numeric($ZarafaIndexerInterval)) {
        $ZarafaIndexerInterval = 60;
    }
    if (!is_numeric($ZarafaIndexerThreads)) {
        $ZarafaIndexerThreads = 2;
    }
    $ZarafaIndexerIntervals[5] = "5Mn";
    $ZarafaIndexerIntervals[15] = "15Mn";
    $ZarafaIndexerIntervals[30] = "30Mn";
    $ZarafaIndexerIntervals[60] = "1h";
    $ZarafaIndexerIntervals[120] = "2h";
    $ZarafaIndexerIntervals[180] = "3h";
    $ZarafaIndexerIntervals[360] = "6h";
    $ZarafaIndexerIntervals[720] = "12h";
    $ZarafaIndexerIntervals[720] = "12h";
    $ZarafaIndexerIntervals[1440] = "1 {day}";
    $html = "\n\t<div class=explain>{zarafa_indexer_explain}</div>\n\t<div id='zarafa-indexer-div'>\n\t<p>&nbsp;</p>\n\t<table style='width:100%' class=form>\n\t<tr>\n\t\t<td class=legend>{enable}:</td>\n\t\t<td>" . Field_checkbox("EnableZarafaIndexer", 1, $EnableZarafaIndexer, "ValidZIndexerForm()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{indexing_interval}:</td>\n\t\t<td>" . Field_array_Hash($ZarafaIndexerIntervals, "ZarafaIndexerInterval", $ZarafaIndexerInterval, "style:font-size:13px;padding:3px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{threads_max_number}:</td>\n\t\t<td>" . Field_text("ZarafaIndexerThreads", $ZarafaIndexerThreads, "font-size:13px;padding:3px;width:90px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "SaveIndexerConfig()") . "</td>\n\t</tr>\n\t</table>\n\t\n\t\n\t</div>\t\n\t<script>\n\t\tfunction ValidZIndexerForm(){\n\t\t\tdocument.getElementById('ZarafaIndexerInterval').disabled=true;\n\t\t\tdocument.getElementById('ZarafaIndexerThreads').disabled=true;\n\t\t\t\n\t\t\tif(!document.getElementById('EnableZarafaIndexer').checked){return;}\n\t\t\tdocument.getElementById('ZarafaIndexerInterval').disabled=false;\n\t\t\tdocument.getElementById('ZarafaIndexerThreads').disabled=false;\n\t\t\n\t\t}\n\t\t\nvar x_SaveIndexerConfig=function(obj){\n      var tempvalue=obj.responseText;\n     RefreshTab('main_config_zarafa');\n      }\t\n\t\t\n\tfunction SaveIndexerConfig(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('EnableZarafaIndexer').checked){XHR.appendData('EnableZarafaIndexer',1);}else{XHR.appendData('EnableZarafaIndexer',0);}\n\t\tXHR.appendData('ZarafaIndexerInterval',document.getElementById('ZarafaIndexerInterval').value);\n\t\tXHR.appendData('ZarafaIndexerThreads',document.getElementById('ZarafaIndexerThreads').value);\n\t\tdocument.getElementById('zarafa-indexer-div').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveIndexerConfig);\n\t}\t\t\n\tValidZIndexerForm();\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 12
0
function popup()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $SquidGuardApachePort = $sock->GET_INFO("SquidGuardApachePort");
    if (!is_numeric($SquidGuardApachePort)) {
        $SquidGuardApachePort = 9020;
    }
    $SquidGuardServerName = $sock->GET_INFO("SquidGuardServerName");
    $SquidGuardStorageDir = $sock->GET_INFO("SquidGuardStorageDir");
    $SquidGuardMaxStorageDay = $sock->GET_INFO("SquidGuardMaxStorageDay");
    $StreamCacheYoutubeEnable = $sock->GET_INFO("StreamCacheYoutubeEnable");
    $t = time();
    if ($SquidGuardStorageDir == null) {
        $SquidGuardStorageDir = "/home/artica/cache";
    }
    if (!is_numeric($SquidGuardMaxStorageDay)) {
        $SquidGuardMaxStorageDay = 30;
    }
    if ($SquidGuardServerName == null) {
        $SquidGuardServerName = $_SERVER['SERVER_ADDR'];
    }
    $html = "\n\t<div id='{$t}'>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{enable_youtube_caching}:</td>\n\t\t<td>" . Field_checkbox("StreamCacheYoutubeEnable", 1, $StreamCacheYoutubeEnable, "StreamCacheYoutubeEnableCheck()") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{listen_port}:</td>\n\t\t<td>" . Field_text("SquidGuardApachePort", $SquidGuardApachePort, "font-size:14px;padding:3px;width:60px", null, null, null, false, "") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{servername}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("SquidGuardServerName", $SquidGuardServerName, "font-size:14px;padding:3px;width:180px", null, null, null, false, "") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{storage_directory}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("SquidGuardStorageDir", "{$SquidGuardStorageDir}", "font-size:14px;padding:3px;width:290px", null, null, null, false, "") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:14px'>{MaxStorageDay}:</td>\n\t\t<td style='font-size:14px'>" . Field_text("SquidGuardMaxStorageDay", $SquidGuardMaxStorageDay, "font-size:14px;padding:3px;width:60px", null, null, null, false, "") . "&nbsp;{days}</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "SaveStreamGet()") . "</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t<script>\n\t\n\t\tvar x_SaveStreamGet=function(obj){\n\t\t  YahooWin5Hide();\n      \t  Loadjs('{$page}');\n\t\t}\n\t\t\n\tfunction StreamCacheYoutubeEnableCheck(){\n\t\tdocument.getElementById('SquidGuardApachePort').disabled=true;\n\t\tdocument.getElementById('SquidGuardServerName').disabled=true;\n\t\tdocument.getElementById('SquidGuardStorageDir').disabled=true;\n\t\tdocument.getElementById('SquidGuardMaxStorageDay').disabled=true;\n\t\tif(document.getElementById('StreamCacheYoutubeEnable').checked){\n\t\t\tdocument.getElementById('SquidGuardApachePort').disabled=false;\n\t\t\tdocument.getElementById('SquidGuardServerName').disabled=false;\n\t\t\tdocument.getElementById('SquidGuardStorageDir').disabled=false;\n\t\t\tdocument.getElementById('SquidGuardMaxStorageDay').disabled=false;\t\t\n\t\t}\n\t}\n\n\tfunction SaveStreamGet(){\n      var XHR = new XHRConnection();\n     XHR.appendData('SquidGuardApachePort',document.getElementById('SquidGuardApachePort').value);\n     XHR.appendData('SquidGuardServerName',document.getElementById('SquidGuardServerName').value);\n     XHR.appendData('SquidGuardStorageDir',document.getElementById('SquidGuardStorageDir').value);\n     XHR.appendData('SquidGuardMaxStorageDay',document.getElementById('SquidGuardMaxStorageDay').value);\n     AnimateDiv('{$t}');\n     XHR.sendAndLoad('{$page}', 'POST',x_SaveStreamGet);     \t\n\t\n\t}\n\tStreamCacheYoutubeEnableCheck();\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 13
0
function tabs()
{
    $sock = new sockets();
    $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)));
    if (!isset($COMPILATION_PARAMS["enable-ident-lookups"])) {
        echo "<div id='squid-identd-upd-error'></div>" . FATAL_ERROR_SHOW_128("{error_squid_ident_not_compiled}<center>\n\t\t\t\t" . button("{update2}", "Loadjs('squid.compilation.status.php');", 32) . "</center>");
        return;
    }
    $page = CurrentPageName();
    $users = new usersMenus();
    $array["status"] = '{status}';
    $array["networks"] = '{networks}';
    $sock = new sockets();
    $tpl = new templates();
    while (list($num, $ligne) = each($array)) {
        if ($num == "networks") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.identd.network.php\" style='font-size:20px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" style='font-size:20px'><span>{$ligne}</span></a></li>\n");
        //$html=$html . "<li><a href=\"javascript:LoadAjax('squid_main_config','$page?main=$num&hostname={$_GET["hostname"]}')\" $class>$ligne</a></li>\n";
    }
    echo build_artica_tabs($html, "debug_identd_config", 1024) . "<script>LeftDesign('users-white-256.png');</script>";
}
Esempio n. 14
0
function rules()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $q = new mysql_squid_builder();
    $action_delete_rule = $tpl->javascript_parse_text("{action_delete_rule}");
    $rule_text = $tpl->_ENGINE_parse_body("{rule}");
    $sql = "SELECT ID,enabled,groupmode,groupname FROM webfilter_rules ORDER BY groupname";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<H2>{$q->mysql_error}</H2>";
    }
    $add = imgtootltip("plus-24.png", "{add} {rule}", "DansGuardianEditRule(-1)");
    $select = imgtootltip("32-parameters.png", "{edit}", "DansGuardianEditRule('0','default')");
    $style = "style='font-size:14px;font-weight:bold;color:black'";
    $html = "<center><span id='DansAnimate'></span>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:99%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>{$add}</th>\n\t\t<th width=99%>{rules}</th>\n\t\t<th width=1%>{groups}</th>\n\t\t<th width=1%>{blacklists}</th>\n\t\t<th width=1%>{whitelists}</th>\n\t\t<th width=1%>&nbsp;</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>\n\t\t<tr class=oddRow>\n\t\t\t<td width=1%>{$select}</td>\n\t\t\t<td {$style} width=99%>" . texthref("Default", "DansGuardianEditRule('0','default')") . "<div><i style='font-size:10px'>{$ligne["ipaddr"]}</i></div></a></td>\n\t\t\t<td width=1% align='center' {$style}>-</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBLKS(0) . "</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBWLS(0) . "</td>\n\t\t\t<td width=1% >&nbsp;</td>\n\t\t</tr>\n";
    $classtr = "oddRow";
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $select = imgtootltip("32-parameters.png", "{edit}", "DansGuardianEditRule('{$ligne["ID"]}','{$ligne["groupname"]}')");
        $delete = imgtootltip("delete-32.png", "{delete}", "DansGuardianDeleteMainRule('{$ligne["ID"]}')");
        $color = "black";
        if ($ligne["enabled"] == 0) {
            $color = "#CCCCCC";
        }
        $style = "style='font-size:14px;font-weight:bold;color:{$color}'";
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1%>{$select}</td>\n\t\t\t<td {$style} width=99%>" . texthref($ligne["groupname"], "DansGuardianEditRule('{$ligne["ID"]}','{$ligne["groupname"]}')") . "<div><i style='font-size:10px'>{$ligne["ipaddr"]}</i></div></a></td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGROUPES($ligne["ID"]) . "</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBLKS($ligne["ID"]) . "</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBWLS($ligne["ID"]) . "</td>\n\t\t\t<td width=1% >{$delete}</td>\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>\n\t</center>\n\t<script>\n\t\tfunction DansGuardianEditRule(ID,rname){\n\t\t\tYahooWin3('600','dansguardian2.edit.php?ID='+ID,'{$rule_text}::'+ID+'::'+rname);\n\t\t}\n\t\t\n\t\tvar x_DansGuardianDeleteMainRule= function (obj) {\n\t\t\tvar res=obj.responseText;\n\t\t\tif (res.length>3){alert(res);}\n\t\t\tif(document.getElementById('main_dansguardian_tabs')){RefreshTab('main_dansguardian_tabs');}\n\t\t\tGroupsDansRuleSearch();\t\t\n\t\t\t\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\tfunction DansGuardianDeleteMainRule(ID){\n\t\t\tif(confirm('{$action_delete_rule}')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tAnimateDiv('DansAnimate');\n\t\t     \tXHR.appendData('DansGuardianDeleteMainRule', ID);\n\t\t      \tXHR.sendAndLoad('{$page}', 'POST',x_DansGuardianDeleteMainRule);  \n\t\t\t}\n\t\t}\n\t\n\t\n\t</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
function certificate_edit_crt()
{
    $t = $_GET["t"];
    $CommonName = $_GET["CommonName"];
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $users = new usersMenus();
    $q = new mysql();
    $apply = $tpl->_ENGINE_parse_body("{apply}");
    $tt = time();
    $upload_text = $tpl->_ENGINE_parse_body("{upload_content}");
    $sql = "SELECT `crt`,`SquidCert`,`UsePrivKeyCrt`,`UseGodaddy`  FROM sslcertificates WHERE CommonName='{$CommonName}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    $warn_gen_x50 = $tpl->javascript_parse_text("{warn_gen_x509}");
    $CommonNameURL = urlencode($CommonName);
    $button_upload = button("{$upload_text}", "Loadjs('certificates.center.upload.php?certificate-upload-js=yes&CommonName={$CommonNameURL}&type=crt&t={$_GET["t"]}&textid=crt{$tt}&RunAfter=VerifyCertificate{$tt}',true)", 22);
    $button_extract = $tpl->_ENGINE_parse_body(button("{info}", "Loadjs('{$page}?certificate-info-crt-js=yes&CommonName={$CommonNameURL}&type=crt&t={$_GET["t"]}&textid=crt{$tt}',true)", 22));
    $button_save = $tpl->_ENGINE_parse_body(button($apply, "SaveCRT{$tt}()", 22));
    $field = "crt";
    if ($ligne["UsePrivKeyCrt"] == 0) {
        $field = "SquidCert";
        $button_upload = null;
        $button_save = null;
    }
    if ($ligne["UseGodaddy"] == 1) {
        $field = "crt";
    }
    $html = "\n\t\t<div class=explain style='font-size:18px' id='{$tt}-adddis'>{public_key_ssl_explain}</div>\n\t\t<div id='verify-{$tt}'></div>\n\t\t<center>{$button_upload}&nbsp;{$button_extract}</center>\n\t\t<textarea\n\t\tstyle='margin-top:5px;font-family:Courier New;\n\t\tfont-weight:bold;width:100%;height:520px;border:5px solid #8E8E8E;\n\t\toverflow:auto;font-size:16px !important;width:99%;height:390px' id='crt{$tt}'>{$ligne[$field]}</textarea>\n\t\t<center style='margin:10px'>{$button_save}</center>\n\t\t<script>\n\t\tvar x_SaveCRT{$tt}=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tdocument.getElementById('{$tt}-adddis').innerHTML='';\n\t\tif (results.length>3){alert(results);return;}\n\t}\nfunction SaveCRT{$tt}(){\n\tif(!confirm('{$warn_gen_x50}')){return;}\n\tvar XHR = new XHRConnection();\n\tvar pp=encodeURIComponent(document.getElementById('crt{$tt}').value);\n\tXHR.appendData('save-crt',pp);\n\tXHR.appendData('CommonName','{$CommonName}');\n\tAnimateDiv('{$tt}-adddis');\n\tXHR.sendAndLoad('{$page}', 'POST',x_SaveCRT{$tt});\n}\n\t\nfunction VerifyCertificate{$tt}(){\n\tLoadAjax('verify-{$tt}','{$page}?verify-crt=yes&CommonName={$CommonNameURL}',true);\n}\nVerifyCertificate{$tt}();\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 16
0
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    if (!$users->APACHE_MOD_BW) {
        echo FATAL_ERROR_SHOW_128("{the_specified_module_is_not_installed}");
        return;
    }
    $servername_enc = urlencode($_GET["servername"]);
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql();
    $sock = new sockets();
    $free = new freeweb($_GET["servername"]);
    $Params = $free->Params;
    $t = time();
    $ForceBandWidthModule = intval($Params["ModeBw"]["ForceBandWidthModule"]);
    $BandwidthAll = intval($Params["ModeBw"]["BandwidthAll"]);
    if ($BandwidthAll == 0) {
        $BandwidthAll = 1536000;
    }
    $BandwidthAll = $BandwidthAll / 1024;
    $html = "\n\n\t<div style='width:98%' class=form>\n\t" . Paragraphe_switch_img("{apache_Bandwidth_enable}", "{apache_Bandwidth_explain}", "bandlimit", "{$free->bandlimit}", null, 650) . "\n\t<table style='width:100%'>\n\t<td colspan=3 align=right>" . button("{rules}", "Loadjs('freeweb.mod.bw.php?servername={$servername_enc}')", 24) . "</td>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{limit_all_requests}:</td>\n\t\t<td>" . Field_checkbox("ForceBandWidthModule", 1, $ForceBandWidthModule) . "</td>\n\t\t<td></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{default_limit}:</td>\n\t\t<td style='font-size:18px'>" . Field_text("BandwidthAll", $BandwidthAll, "font-size:18px;width:90px") . "&nbsp;KB/s</td>\n\t\t<td></td>\n\t</tr>\n\n\t<tr>\n\t\t<td colspan=3 align=right><hr>" . button("{apply}", "Save{$t}()", 24) . "</td>\n\t</tr>\n\t</table>\n\t<p>&nbsp;</p>\n\t</div>\n<script>\n\tvar xSave{$t}=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tRefreshTab('main_freeweb_qos');\n\t}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('bandlimit',document.getElementById('bandlimit').value);\n\tif(document.getElementById('ForceBandWidthModule').checked){\n\t\tXHR.appendData('ForceBandWidthModule',1);\n\t}else{\n\t\tXHR.appendData('ForceBandWidthModule',0);\n\t}\n\t\n\t\n\tXHR.appendData('BandwidthAll',document.getElementById('BandwidthAll').value);\n\tXHR.appendData('servername','{$_GET["servername"]}');\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 17
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $t = time();
    $EnableMacAddressFilter = $sock->GET_INFO("EnableMacAddressFilter");
    if (!is_numeric($EnableMacAddressFilter)) {
        $EnableMacAddressFilter = 1;
    }
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    $UnlockWebStats = $sock->GET_INFO("UnlockWebStats");
    if (!is_numeric($UnlockWebStats)) {
        $UnlockWebStats = 0;
    }
    if ($UnlockWebStats == 1) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    if ($EnableRemoteStatisticsAppliance == 1) {
        $EnableMacAddressFilterCentral = $sock->GET_INFO("EnableMacAddressFilterCentral");
        if (!is_numeric($EnableMacAddressFilterCentral)) {
            $EnableMacAddressFilterCentral = 1;
        }
        $EnableMacAddressFilter = $EnableMacAddressFilterCentral;
    }
    $p = Paragraphe_switch_img("{enable_mac_squid_filters}", "{enable_mac_squid_filters_explain}", "EnableMacAddressFilter", $EnableMacAddressFilter, null, 400);
    $html = "\n\t<div id='{$t}'></div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t\n\t\t<td colspan=2>{$p}</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 16) . "</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\t\tvar x_Save{$t}= function (obj) {\n\t\t\tdocument.getElementById('{$t}').innerHTML='';\n\t\t\tvar res=obj.responseText;\n\t\t\tif (res.length>3){alert(res);}\t\t\t\n\t\t\tYahooWin2Hide();\n\t\t}\n\t\n\t\n\tfunction Save{$t}(){\n\t\tvar lock={$EnableRemoteStatisticsAppliance};\n\t\tif(lock==1){Loadjs('squid.newbee.php?error-remote-appliance=yes');return;}\n\t\tvar XHR = new XHRConnection();\n\t\t\n\t\tXHR.appendData('EnableMacAddressFilter',document.getElementById('EnableMacAddressFilter').value);\n\t\tAnimateDiv('{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_Save{$t});\n\t}\n</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 18
0
function tabs()
{
    $fontsize = 18;
    $tpl = new templates();
    $page = CurrentPageName();
    $users = new usersMenus();
    $sock = new sockets();
    $SquidUrgency = intval($sock->GET_INFO("SquidUrgency"));
    if ($SquidUrgency == 1) {
        echo FATAL_ERROR_SHOW_128("<div style='font-size:22px'>{proxy_in_emergency_mode}</div>\n\t\t\t<div style='font-size:18px'>{proxy_in_emergency_mode_explain}</div>\n\t\t\t<div style='text-align:right'><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.urgency.php?justbutton=yes');\"\n\t\t\tstyle='text-decoration:underline'>{disable_emergency_mode}</a></div>\t\n\t\t\t");
        return;
    }
    $array["thishour"] = '{this_hour}';
    $array["thishour2"] = '{this_hour} ({compressed})';
    while (list($num, $ligne) = each($array)) {
        if ($num == "thishour") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "thishour2") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.compressed.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "thishour3") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.day.compressed.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}={$time}\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
    }
    echo build_artica_tabs($html, "main_squid_logs_subtabs");
}
Esempio n. 19
0
function popup()
{
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $page = CurrentPageName();
    $tpl = new templates();
    $kas_enabled = 0;
    $amavis_enabled = 0;
    $kas = new kas_mysql("default");
    if ($kas->GET_KEY("ACTION_SPAM_MODE") == 2) {
        $ACTION_SPAM_MODE = 1;
    }
    if ($kas->GET_KEY("ACTION_PROBABLE_MODE") == 2) {
        $ACTION_PROBABLE_MODE = 1;
    }
    if ($kas->GET_KEY("ACTION_FORMAL_MODE") == 2) {
        $ACTION_FORMAL_MODE = 1;
    }
    $amavis = new amavis();
    $sa_tag3_level_defltl = $tpl->_ENGINE_parse_body('{sa_tag3_level_deflt}');
    if ($users->kas_installed) {
        if ($users->KasxFilterEnabled == 1) {
            $kas_enabled = 1;
        }
    }
    if ($users->AMAVIS_INSTALLED) {
        if ($users->EnableAmavisDaemon == 1) {
            $amavis_enabled = 1;
        }
    }
    $html = "\n\t<div id='kas3feature'>\n\t\t<table style='width:100%' class=form>\n\t\t<tr>\n\t\t\t<td colspan=2><strong style='font-size:16px'>{APP_KAS3}</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 1}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_SPAM_MODE", 1, $ACTION_SPAM_MODE) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 2}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_PROBABLE_MODE", 1, $ACTION_PROBABLE_MODE) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 4}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_FORMAL_MODE", 1, $ACTION_FORMAL_MODE) . "</td>\n\t\t</tr>\t\n\t\t</table>\n\t</div>\n\t\n\t<div id='amavisfeature'>\n\t\t<table style='width:100%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2><strong style='font-size:16px'>{APP_AMAVIS}/{APP_SPAMASSASSIN}</strong></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{spam option 1} <b>({score} {$amavis->main_array["BEHAVIORS"]["sa_tag3_level_deflt"]})</b></td>\n\t\t\t\t<td>" . Field_checkbox("EnableQuarantineSpammy2", 1, $amavis->EnableQuarantineSpammy2) . "</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{spam option 2} <b>({score} {$amavis->main_array["BEHAVIORS"]["sa_tag2_level_deflt"]})</b></td>\n\t\t\t\t<td>" . Field_checkbox("EnableQuarantineSpammy", 1, $amavis->EnableQuarantineSpammy) . "</td>\n\t\t\t</tr>\n\t\n\t\t\t</table>\n\t</div>\n\t\n\t\n\t<div style='text-align:right;width:100%'><hr>" . button("{apply}", "SaveQuarPolicies()") . "</div>\n\t\n\t<script>\n\t\tfunction DisableQuarPolicies(){\n\t\t\tvar kas_enabled={$kas_enabled};\n\t\t\tvar amavis_enabled={$amavis_enabled};\n\t\t\tif(kas_enabled!==1){\n\t\t\t\tdocument.getElementById('ACTION_SPAM_MODE').disabled=true;\n\t\t\t\tdocument.getElementById('ACTION_PROBABLE_MODE').disabled=true;\n\t\t\t\tdocument.getElementById('ACTION_FORMAL_MODE').disabled=true;\n\t\t\t}\n\t\t\t\n\t\t\tif(amavis_enabled!==1){\n\t\t\t\tdocument.getElementById('EnableQuarantineSpammy2').disabled=true;\n\t\t\t\tdocument.getElementById('EnableQuarantineSpammy').disabled=true;\n\t\t\t}\t\t\t\n\t\t\n\t\t}\n\t\t\nvar x_SaveQuarPolicies= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tYahooWin3Hide();\n}\t\t\n\t\n\t\n\t\tfunction SaveQuarPolicies(){\n\t\t\tvar kas_enabled={$kas_enabled};\n\t\t\tvar amavis_enabled={$amavis_enabled};\t\t\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('SAVE_QUAR',1);\n\t\t\tif(kas_enabled==1){\n\t\t\t\tXHR.appendData('SAVE_KAS',1);\n\t\t\t\tif(document.getElementById('ACTION_SPAM_MODE').checked){XHR.appendData('ACTION_SPAM_MODE',1);}else{XHR.appendData('ACTION_SPAM_MODE',0);}\n\t\t\t\tif(document.getElementById('ACTION_PROBABLE_MODE').checked){XHR.appendData('ACTION_PROBABLE_MODE',1);}else{XHR.appendData('ACTION_PROBABLE_MODE',0);}\n\t\t\t\tif(document.getElementById('ACTION_FORMAL_MODE').checked){XHR.appendData('ACTION_FORMAL_MODE',1);}else{XHR.appendData('ACTION_FORMAL_MODE',0);}\n\t\t\t}\n\t\t\t\n\t\t\tif(amavis_enabled==1){\n\t\t\t\tXHR.appendData('SAVE_AMAVIS',1);\n\t\t\t\tif(document.getElementById('EnableQuarantineSpammy2').checked){XHR.appendData('EnableQuarantineSpammy2',1);}else{XHR.appendData('EnableQuarantineSpammy2',0);}\n\t\t\t\tif(document.getElementById('EnableQuarantineSpammy').checked){XHR.appendData('EnableQuarantineSpammy',1);}else{XHR.appendData('EnableQuarantineSpammy',0);}\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById('kas3feature').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tdocument.getElementById('amavisfeature').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveQuarPolicies);\t\t\t\n\t\t\n\t\t}\n\t\n\t\n\tDisableQuarPolicies();\n\t</script>\n\t\n\t\n\n\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 20
0
function json_root($path = null)
{
    $tpl = new templates();
    $path = $_POST["dir"];
    $text = $tpl->_ENGINE_parse_body("{APP_PHILESIGHT}");
    echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
    $page = CurrentPageName();
    $sock = new sockets();
    if ($path == null) {
        $path = "/";
        $datas = unserialize(base64_decode($sock->getFrameWork("cmd.php?B64-dirdir=" . base64_encode('/'))));
    } else {
        $datas = unserialize(base64_decode($sock->getFrameWork("cmd.php?B64-dirdir=" . base64_encode($path))));
    }
    if (!is_array($datas)) {
        return null;
    }
    echo "<li class=\"file ext_settings\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir']) . "\">" . htmlentities("{$text}: " . basename($_POST['dir'])) . "</a></li>";
    while (list($num, $val) = each($datas)) {
        if (trim($val) == null) {
            continue;
        }
        $newpath = "{$path}/{$val}";
        $newpathsmb = str_replace('//', '/', $newpath);
        echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . '/' . $val) . "/\">" . $val . "</a></li>";
    }
}
Esempio n. 21
0
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $html = "<div style='width:98%' class=form>\n\t\t\t<div style='font-size:18px' class=explain>{squid_articadb_restore_explain}</div>\n\t\t\t\n\t\t\t<center style='margin:30px'>" . button("{upload_backuped_container}", "Loadjs('squid.articadb.restore.upload.php')", 32) . "</center>\n\t</div>";
    echo $tpl->_ENGINE_parse_body($html);
}
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{listen_port}");
    echo "\n\t\tYahooWin6(350,'{$page}?popup=yes&nodeid={$_GET["nodeid"]}','{$title}');\n\t\t\n\t\tvar x_listenport= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);return;}\n\t\t\tYahooWin6Hide();\n\t\t\tif(document.getElementById('main_squid_quicklinks_tabs{$_GET["nodeid"]}')){RefreshTab('main_squid_quicklinks_tabs{$_GET["nodeid"]}');}\n\t\t}\n\t\t\n\t\tfunction listenport(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('listenport',document.getElementById('listen_port').value);\n\t\t\tXHR.appendData('second_listen_port',document.getElementById('second_listen_port').value);\n\t\t\tXHR.appendData('nodeid',{$_GET["nodeid"]});\t\t\t\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_listenport);\t\n\t\t}\t\t\n\t\t";
}
Esempio n. 23
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $ID = $_GET["ID"];
    $sql = "SELECT * FROM webfilter_rules WHERE ID={$ID}";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
    $more8chars = $tpl->javascript_parse_text("{more8chars}");
    if ($ID == 0) {
        $sock = new sockets();
        $ligne = unserialize(base64_decode($sock->GET_INFO("DansGuardianDefaultMainRule")));
    }
    if ($ligne["BypassSecretKey"] == null) {
        $ligne["BypassSecretKey"] = md5(time());
    }
    $TIMES[0] = "{none}";
    $TIMES[300] = "5 {minutes}";
    $TIMES[900] = "15 {minutes}";
    $TIMES[1800] = "30 {minutes}";
    $TIMES[3600] = "1 {hour}";
    $TIMES[7200] = "2 {hours}";
    $TIMES[14400] = "4 {hours}";
    $t = time();
    $html = "\n\t<div id='{$t}'>\n\t<div class=text-info style='font-size:14px'>{TemporaryDeniedPageBypassExplain}<br>{BypassSecretKeyExplain}</div>\n\t<table style='width:99%' class=form>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{bypassFor}:</td>\n\t\t\t<td>" . Field_array_Hash($TIMES, "bypass{$t}", $ligne["bypass"], "style:font-size:16px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{BypassSecretKey}:</td>\n\t\t\t<td>" . Field_password("BypassSecretKey{$t}", $ligne["BypassSecretKey"], "font-size:16px;width:220px") . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "bypassForSave()") . "</td>\n\t\t</tr>\n\t\t\n\t</tbody>\n\t</table>\n\t</div>\n\t<script>\n\tvar x_bypassForSave= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tvar ID='{$ID}';\n\t\tif (res.length>3){alert(res);}\n\t\tYahooWin4Hide();\n\t}\n\t\n\t\tfunction bypassForSave(){\n\t\t      var XHR = new XHRConnection();\n\t\t      \n\t\t      var bypass=document.getElementById('bypass{$t}').value;\n\t\t      if(bypass.length<8){alert('{$more8chars}');return;}\n\t\t      XHR.appendData('bypass', document.getElementById('bypass{$t}').value);\n\t\t      XHR.appendData('BypassSecretKey', document.getElementById('BypassSecretKey{$t}').value);\n\t\t      XHR.appendData('ID','{$ID}');\n\t\t      AnimateDiv('{$t}');\n\t\t      XHR.sendAndLoad('{$page}', 'POST',x_bypassForSave);  \t\t\n\t\t}\n\t</script>\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 24
0
function table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $dnsmasq_address_text = $tpl->_ENGINE_parse_body("{dnsmasq_address_text}");
    $hosts = $tpl->_ENGINE_parse_body("{hosts}");
    $addr = $tpl->_ENGINE_parse_body("{addr}");
    $new_interface = $tpl->_ENGINE_parse_body("{new_interface}");
    $rulename = $tpl->_ENGINE_parse_body("{rulename}");
    $explain = $tpl->javascript_parse_text("{explain}");
    $title = $tpl->_ENGINE_parse_body("{rules}");
    $category = $tpl->_ENGINE_parse_body("{category}");
    $enabled = $tpl->_ENGINE_parse_body("{enabled}");
    $q = new mysql();
    if (!$q->TABLE_EXISTS("suricata_rules_packages", "artica_backup")) {
        $sql = "CREATE TABLE IF NOT EXISTS `artica_backup`.`suricata_rules_packages` (\n\t\t`rulefile` VARCHAR(128) NOT NULL PRIMARY KEY ,\n\t\t`category` VARCHAR(40) NOT NULL,\n\t\t`enabled` smallint(1) NOT NULL DEFAULT 0,\n\t\tINDEX ( `category`),\n\t\tINDEX ( `enabled`)\n\t\t)";
        $q->QUERY_SQL($sql, 'artica_backup');
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    if ($q->COUNT_ROWS("suricata_rules_packages", "artica_backup") == 0) {
        $sql = "INSERT IGNORE INTO suricata_rules_packages (rulefile,enabled,category) VALUES \n\t\t\t\t('botcc.rules',0,'DMZ'),('ciarmy.rules',0,'DMZ'),('compromised.rules','0','DMZ'),\n\t\t\t\t('drop.rules',1,'DMZ'),\n\t\t\t\t('dshield.rules',1,'DMZ'),('snort.rules',1,'ALL'),\n\t\t\t\t('emerging-activex.rules',1,'WEB'),\n\t\t\t\t('emerging-attack_response.rules',1,'ALL'),\n\t\t\t\t('emerging-chat.rules',0,'WEB'),\n\t\t\t\t('emerging-current_events.rules',0,'ALL'),\n\t\t\t\t('emerging-dns.rules',0,'DMZ'),\n\t\t\t\t('emerging-dos.rules',0,'DMZ'),\n\t\t\t\t('emerging-exploit.rules',0,'DMZ'),\n\t\t\t\t('emerging-ftp.rules',0,'DMZ'),\n\t\t\t\t('emerging-games.rules',0,'ALL'),\n\t\t\t\t('emerging-icmp_info.rules',0,'ALL'),\n\t\t\t\t('emerging-icmp.rules',0,'ALL'),\n\t\t\t\t('emerging-imap.rules',0,'DMZ'),\n\t\t\t\t('emerging-inappropriate.rules',0,'WEB'),\n\t\t\t\t('emerging-malware.rules',1,'WEB'),\n\t\t\t\t('emerging-mobile_malware.rules',0,'WEB'),\n\t\t\t\t('emerging-netbios.rules',0,'ALL'),\n\t\t\t\t('emerging-p2p.rules',0,'WEB'),\n\t\t\t\t('emerging-policy.rules',1,'WEB'),\n\t\t\t\t('emerging-pop3.rules',0,'DMZ'),\n\t\t\t\t('emerging-rpc.rules',0,'ALL'),\n\t\t\t\t('emerging-scada.rules',0,'ALL'),\n\t\t\t\t('emerging-scan.rules',1,'ALL'),\n\t\t\t\t('emerging-shellcode.rules',1,'ALL'),\n\t\t\t\t('emerging-smtp.rules',0,'DMZ'),\n\t\t\t\t('emerging-snmp.rules',0,'ALL'),\n\t\t\t\t('emerging-sql.rules',0,'ALL'),\n\t\t\t\t('emerging-telnet.rules',0,'ALL'),\n\t\t\t\t('emerging-tftp.rules',0,'ALL'),\n\t\t\t\t('emerging-trojan.rules',1,'ALL'),\n\t\t\t\t('emerging-user_agents.rules',0,'ALL'),\n\t\t\t\t('emerging-voip.rules',0,'ALL'),\n\t\t\t\t('emerging-web_client.rules',1,'HTTP'),\n\t\t\t\t('emerging-web_server.rules',0,'HTTP'),\n\t\t\t\t('emerging-web_specific_apps.rules',0,'HTTP'),\n\t\t\t\t('emerging-worm.rules',1,'ALL'),\n\t\t\t\t('tor.rules',0,'ALL'),\n\t\t\t\t('decoder-events.rules',0,'ALL'),\n\t\t\t\t('stream-events.rules',0,'ALL'),\n\t\t\t\t('http-events.rules',0,'HTTP'),\n\t\t\t\t('smtp-events.rules',0,'DMZ'),\n\t\t\t\t('dns-events.rules',0,'DMZ'),\n\t\t\t\t('tls-events.rules',0,'DMZ')";
        $q->QUERY_SQL($sql, 'artica_backup');
    }
    $apply = $tpl->javascript_parse_text("{apply}");
    $buttons = "\n\tbuttons : [\n\t\n\t{name: '<strong style=font-size:18px>{$apply}</strong>', bclass: 'Apply', onpress : Apply{$t}},\n\t],";
    $html = "\n\t\n\t\n\t<table class='TABLE_SURICATA_MAIN_RULES' style='display: none' id='TABLE_SURICATA_MAIN_RULES'\n\tstyle='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\tvar md5H='';\n\t\$('#TABLE_SURICATA_MAIN_RULES').flexigrid({\n\turl: '{$page}?list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\n\t{display: '<span style=font-size:22px>{$rulename}</span>', name : 'rulefile', width : 300, sortable : true, align: 'left'},\n\t{display: '<span style=font-size:22px>{$category}</span>', name : 'category', width : 156, sortable : true, align: 'center'},\n\t{display: '<span style=font-size:22px>{$explain}</span>', name : 'none', width : 833, sortable : false, align: 'left'},\n\t{display: '<span style=font-size:22px>{$enabled}</span>', name : 'enabled', width : 105, sortable : true, align: 'center'},\n\n\t],\n\t{$buttons}\nsearchitems : [\n\t\t{display: '{$rulename}', name : 'rulefile'},\n\t\t{display: '{$category}', name : 'category'},\n\t\t\n\n\t],\t\n\tsortname: 'rulefile',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});\n\t});\n\t\n\t\nfunction Add{$t}(){\n\tLoadjs('{$page}?add-interface-js=yes&t={$t}');\n}\nvar xSuricataRuleEnabled= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\t\$('#TABLE_SURICATA_MAIN_RULES').flexReload();\n}\n\t\nfunction SuricataRuleEnabled(filename){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('filename',filename);\n\tXHR.sendAndLoad('{$page}', 'POST',xSuricataRuleEnabled);\n}\nfunction Apply{$t}(){\n\tLoadjs('suricata.progress.php');\n}\n</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 25
0
function popup()
{
    $page = CurrentPageName();
    $html = "\n\t<H3>{PLEASE_WAIT_RESTARTING_ALL_SERVICES}</H3>\n\t<div style='margin:5px;padding:3px;border:1px solid #CCCCCC;width:95%;height:450px;overflow:auto' id='squid-restart'>\n\t</div>\n\t\n\t<script>\n\t\tLoadAjax('squid-restart','{$page}?start=yes');\n\t</script>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 26
0
function auth_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $html = "\n\t<span id='postresults'></span>\n\t<form id='authform'>\n\t<table style='width:100%' >\n\t<tr>\n\t\t<td class=legend>{username}:</td>\n\t\t<td>" . Field_text("username-logon", null, "font-size:16px;padding:5px", "script:SuBmitAuthCheck(event)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{password}:</td>\n\t\t<td>" . Field_password("username-password", null, "font-size:16px;padding:5px", "script:SuBmitAuthCheck(event)") . "</td>\n\t</tr>\t\n\t<tr>\n\t<td colspan=2 align='right' style='font-size:16px;padding:5px'>" . button("{submit}", "SuBmitAuth()") . "</td>\n\t</tr>\n\t</table>\n\t</form>\n\t\n\t<script>\n\t\tfunction SuBmitAuthCheck(e){\n\t\t\tif(checkEnter(e)){SuBmitAuth();}\n\t\t}\n\t\n\t\n\t\tvar x_DeleteAllArticaEvents= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tLoadAjax('articaevents','{$page}?events-table=yes&LockBycontext={$_GET["LockBycontext"]}');\n\t\t\t\t\n\t\t}\t\t\t\n\t\t\n\t\tfunction SuBmitAuth(){\n\t\t\tAnimateDiv('postresults');\n\t\t\t\$.post('{$page}',  \$('#authform').serialize(),\n\t\t\t\tfunction(data) {\n  \t\t\t\t\t\$('#postresults').html(data);\n\t\t\t\t}\n\t\t\t);\n\t\t\n\t\t}\t\n\tdocument.title='Artica {$_SERVER["SERVER_NAME"]}'; \n\t\n\t</script>\n\t\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $q = new mysql();
    $sql = "SELECT * FROM officials_domains ORDER BY domain";
    writelogs("{$sql}", __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo "<H2>{$q->mysql_error}</H2>";
    }
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $domains[$ligne["domain"]] = $ligne["domain"];
    }
    $OverWriteRestrictedDomains = 0;
    if ($users->OverWriteRestrictedDomains) {
        $OverWriteRestrictedDomains = 1;
    }
    if ($OverWriteRestrictedDomains == 1) {
        $over = "\n\t\t<hr>\n\t\t<div class=explain>{OverWriteRestrictedDomains_allow_text}</div>\n\t\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend>{domain}:</td>\n\t\t<td width=100%>" . Field_text("overwrite-domain", null, "font-size:16px;padding:3px;width:320px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{add}", "AddSubdomainOUOver()") . "</td>\n\t</tr>\n\t</table>\n\t\t";
    }
    $_GET["ou"] = urlencode($_GET["ou"]);
    $domains[null] = "{select}";
    $html = "\n\t<div id='add_subdomain_explain'></div>\n\t<div class=explain >{add_subdomain_explain}</div>\n\t\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend>{subdomain}:</td>\n\t\t<td width=50%>" . Field_text("subdomain", null, "font-size:16px;padding:3px;width:220px") . "</td>\n\t\t<td style='font-size:16px;padding:3px' width=1%><strong>.</strong></td>\n\t\t<td width=50%>" . Field_array_Hash($domains, "maindomain", null, "style:font-size:16px;padding:3px;") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=4 align='right'><hr>" . button("{add}", "AddSubdomainOU()") . "</td>\n\t</tr>\n\t</table>\n\t{$over}\n\t<script>\n\tvar x_AddSubdomainOU= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tdocument.getElementById('subdomain').innerHTML='';\n\t\tif(results.length>3){alert(results);return;}\n\t\tYahooWin4Hide();\n\t\tLoadAjax('LocalDomainsList','domains.edit.domains.php?LocalDomainList=yes&ou={$_GET["ou"]}');\n\t}\t\t\n\t\t\n\t\tfunction AddSubdomainOU(){\n\t\t\tvar maindomain=document.getElementById('maindomain').value;\n\t\t\tvar subdomain=document.getElementById('subdomain').value;\n\t\t\tif(maindomain.length<3){return;}\n\t\t\tif(subdomain.length<3){return;}\n\t\t\tvar domain=subdomain+'.'+maindomain;\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('AddNewInternetDomain','{$_GET["ou"]}');\n\t\t\tXHR.appendData('AddNewInternetDomainDomainName',domain);\t\n\t\t\tAnimateDiv('add_subdomain_explain');\n\t\t\tXHR.sendAndLoad('domains.edit.domains.php', 'GET',x_AddSubdomainOU);\n\t\t\t\n\t\t}\n\t\t\n\t\tfunction AddSubdomainOUOver(){\n\t\t\tvar maindomain=document.getElementById('overwrite-domain').value;\n\t\t\tif(maindomain.length<3){return;}\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('AddNewInternetDomain','{$_GET["ou"]}');\n\t\t\tXHR.appendData('AddNewInternetDomainDomainName',maindomain);\t\n\t\t\tAnimateDiv('add_subdomain_explain');\n\t\t\tXHR.sendAndLoad('domains.edit.domains.php', 'GET',x_AddSubdomainOU);\t\t\t\n\t\t}\n\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 28
0
function js(){
$page=CurrentPageName();
$users=new usersMenus();
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body('{APP_ZARAFA}');
$ou_decrypted=base64_decode($_GET["ou"]);
$html="

function ZARAFA_OU_LOAD(){
	YahooWin3('530','$page?popup=yes&ou=$ou_decrypted','$title');
	
	}
	
var X_ENABLE_ZARAFA_COMPANY= function (obj) {
	var results=obj.responseText;
	if(results.length>0){alert(results);}
	ZARAFA_OU_LOAD();
	}	
	
function ENABLE_ZARAFA_COMPANY(){
	var XHR = new XHRConnection();
	XHR.appendData('zarafaEnabled',document.getElementById('zarafaEnabled').value);
	XHR.appendData('ou','$ou_decrypted');
	document.getElementById('img_zarafaEnabled').src='img/wait_verybig.gif';
	XHR.sendAndLoad('$page', 'GET',X_ENABLE_ZARAFA_COMPANY);	
}
	
ZARAFA_OU_LOAD();
";

echo $html;	
	
}
Esempio n. 29
0
function formulaire()
{
    $users = new usersMenus();
    $ldap = new clladp();
    $tpl = new templates();
    $page = CurrentPageName();
    if ($users->AsAnAdministratorGeneric) {
        $hash = $ldap->hash_get_ou(false);
    } else {
        $hash = $ldap->Hash_Get_ou_from_users($_SESSION["uid"], 1);
    }
    if (count($hash) == 1) {
        $org = $hash[0];
        $hash_groups = $ldap->hash_groups($org, 1);
        $hash_domains = $ldap->hash_get_domains_ou($org);
        $groups = Field_array_Hash($hash_groups, 'groupid', null, null, null, 0, "font-size:14px;padding:3px");
        $domains = Field_array_Hash($hash_domains, 'domain', null, null, null, 0, "font-size:14px;padding:3px");
    }
    $artica = new artica_general();
    $EnableVirtualDomainsInMailBoxes = $artica->EnableVirtualDomainsInMailBoxes;
    while (list($num, $ligne) = each($hash)) {
        $ous[$ligne] = $ligne;
    }
    $ou = Field_array_Hash($ous, 'organization', null, "ChangeFormValues()", null, 0, "font-size:14px;padding:3px");
    $form = "\n\t\n\t<input type='hidden' id='EnableVirtualDomainsInMailBoxes' value='{$EnableVirtualDomainsInMailBoxes}'>\n\t<table style='width:100%' class=form>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{organization}:</td>\n\t\t\t<td>{$ou}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{group}:</td>\n\t\t\t<td><span id='select_groups'>{$groups}</span>\n\t\t</tr>\n\t\t<tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{firstname}:</td>\n\t\t\t<td>" . Field_text('firstname', null, 'width:120px;font-size:14px;padding:3px', null, 'ChangeFormValues()') . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{lastname}:</td>\n\t\t\t<td>" . Field_text('lastname', null, 'width:120px;font-size:14px;padding:3px', null, "ChangeFormValues()") . "</td>\n\t\t</tr>\t\t\n\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{email}:</td>\n\t\t\t<td>" . Field_text('email', null, 'width:120px;font-size:14px;padding:3px', null, "ChangeFormValues()") . "@<span id='select_domain'>{$domains}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{uid}:</td>\n\t\t\t<td>" . Field_text('login', null, 'width:120px;font-size:14px;padding:3px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px'>{password}:</td>\n\t\t\t<td>" . Field_password('password', null, "font-size:14px;padding:3px") . "</td>\n\t\t</tr>\t\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr>" . button("{add}", "SaveAddUser()") . "\n\t\t\t\t\n\t\t\t</td>\n\t\t</tr>\n\t\t\n\t\t</table>\n\t";
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=1%><div id='ffform'><img src='img/identity-add-96.png'></div></td>\n\t\t<td valign='top' width=99%><div>{$form}</div></td>\n\t</tr>\n\t</table>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 30
0
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $t = time();
    $EnableMilterGreylistExternalDB = intval($sock->GET_INFO("EnableMilterGreylistExternalDB"));
    $MilterGreylistExternalDBSchedule = intval($sock->GET_INFO("MilterGreylistExternalDBSchedule"));
    if ($MilterGreylistExternalDBSchedule == 0) {
        $MilterGreylistExternalDBSchedule = 4;
    }
    $MilterGreyListPatternTime = intval($sock->GET_INFO("MilterGreyListPatternTime"));
    $MilterGreyListPatternCount = intval($sock->GET_INFO("MilterGreyListPatternCount"));
    $EnableArticaTechSpamAssassin = intval($sock->GET_INFO("EnableArticaTechSpamAssassin"));
    $schedules[1] = "1 {hour}";
    $schedules[2] = "2 {hours}";
    $schedules[4] = "4 {hours}";
    $schedules[8] = "8 {hours}";
    $schedules[24] = "1 {day}";
    $p = Paragraphe_switch_img("{EnableMilterGreylistExternalDB}", "{EnableMilterGreylistExternalDB_explain}", "EnableMilterGreylistExternalDB-{$t}", $EnableMilterGreylistExternalDB, null, 960);
    $p1 = Paragraphe_switch_img("{EnableArticaTechSpamAssassin}", "{EnableArticaTechSpamAssassin_explain}", "EnableArticaTechSpamAssassin-{$t}", $EnableArticaTechSpamAssassin, null, 960);
    $field = Field_array_Hash($schedules, "MilterGreylistExternalDBSchedule-{$t}", $MilterGreylistExternalDBSchedule, "blur()", null, 0, "font-size:26px");
    $html = "\n\t<div style='font-size:30px;margin-bottom:20px'>{rules_update}, {current}: v{$MilterGreyListPatternTime} {$MilterGreyListPatternCount} {rules}</div>\t\t\n\t\n\t<div style='width:98%' class=form>\n\t{$p}\n\t{$p1}\n\t\n\t<table style='width:100%'>\n\t<tbody>\n\t<tr>\n\t<td class=legend style='font-size:26px'>{schedule}:</td>\n\t<td style='font-size:16px'>{$field}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 45) . "</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t</div>\n\t\t\t<script>\n\t\n\t\t\tvar xSave{$t}= function (obj) {\n\t\t\tvar res=obj.responseText;\n\t\t\tif (res.length>3){alert(res);}\n\t}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('EnableArticaTechSpamAssassin', document.getElementById('EnableArticaTechSpamAssassin-{$t}').value);\n\tXHR.appendData('MilterGreylistExternalDBSchedule', document.getElementById('MilterGreylistExternalDBSchedule-{$t}').value);\n\tXHR.appendData('EnableMilterGreylistExternalDB', document.getElementById('EnableMilterGreylistExternalDB-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}