Exemple #1
0
function tasks()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $GLOBALS["ICON_FAMILY"] = "STATISTICS";
    $schedule_recategorize = Paragraphe("64-categories-task.png", "{recategorize_schedule}", "{recategorizewww_schedule_text}", "javascript:Loadjs('{$page}?re-categorize-js=yes')");
    $tr[] = $schedule_recategorize;
    echo $tpl->_ENGINE_parse_body("<table><tbody>" . CompileTr2($tr) . "</tbody></table>");
}
function squid_cache_status()
{
    $page = CurrentPageName();
    $squid = new squidnodes($_GET["nodeid"]);
    $tpl = new templates();
    $q = new mysql_blackbox();
    $t = $_GET["t"];
    $sql = "SELECT * FROM cachestatus WHERE nodeid='{$_GET["nodeid"]}'";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<H3>Error: {$q->mysql_error}</H3>";
        return;
    }
    //$squid->
    $tr[] = "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/parameters2-64.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top><strong style='font-size:14px'>\n\t\t\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('nodes.squid.caches32.parms.php?hostid={$_GET["hostid"]}&nodeid={$_GET["nodeid"]}');\"\n\t\t\t\t\t\t\tstyle='font-size:14px;text-decoration:underline;font-weight:bold'>\n\t\t\t\t\t\t\t{caches_parameters}</a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><span style='font-size:14px'>{cache_parameters_node_explain}</span></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $tr[] = "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/disk-64.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top><strong style='font-size:14px'>" . basename($ligne["cachedir"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><strong style='font-size:14px'>" . FormatBytes($ligne["currentsize"]) . "/" . FormatBytes($ligne["maxsize"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'>" . pourcentage($ligne["pourc"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
    }
    $html = CompileTr2($tr);
    $html = $html . "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('squid-caches-status{$t}','{$page}?squid-caches-status=yes&nodeid={$_GET["nodeid"]}');") . "</div>";
    echo $tpl->_ENGINE_parse_body($html);
}
function loggers_status()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $data = unserialize(base64_decode($sock->getFrameWork("squid.php?loggers-status=yes")));
    if (!is_array($data)) {
        return;
    }
    while (list($PID, $ARRAY) = each($data)) {
        $timettl = $ARRAY["TTL"];
        $PURGED = $ARRAY["PURGED"];
        $COUNT_RQS = $ARRAY["COUNT_RQS"];
        $PURGED = FormatNumber($PURGED);
        $COUNT_RQS = FormatNumber($COUNT_RQS);
        if ($ARRAY["LASTTIME"] > 0) {
            $Laststatus = distanceOfTimeInWords($ARRAY["LASTTIME"], time(), true);
        } else {
            $Laststatus = "-";
        }
        $f[] = "\n\t\t<div style='width:550px;margin-bottom:20px' class=form>\n\t\t<table>\n\t\t<tr>\n\t\t\t<td style='min-width:68px;vertical-align:top'><img src='img/process-64.png'></td>\n\t\t\t<td style='min-width:482px;vertical-align:top'>\t\t\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{PID}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$PID}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{running_since}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$timettl}mn</td>\n\t\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{purged_events}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$PURGED}</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{received_connections}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$COUNT_RQS}</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{last_status}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px'>{$Laststatus}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t</div>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t";
    }
    echo $tpl->_ENGINE_parse_body(CompileTr2($f) . "\n\t\t\t<div style='width:100%;height:160px'>\n\t\t\t <div style='float:right;margin-left:10px;'>" . button("{refresh}", "LoadAjax('logger-status','{$page}?logger-status=yes',true);", 26) . "</div>\n\t\t\t<div style='float:right'>" . button("{reload_proxy}", "Loadjs('squid.reload.php');", 26) . "</div></div>");
}
Exemple #4
0
function status_section()
{
    $page = CurrentPageName();
    $user = new usersMenus();
    $sock = new sockets();
    $tpl = new templates();
    if (!$user->POWER_DNS_INSTALLED) {
        not_installed();
        return null;
    }
    $PDNSRestartIfUpToMB = $sock->GET_INFO("PDNSRestartIfUpToMB");
    $DisablePowerDnsManagement = $sock->GET_INFO("DisablePowerDnsManagement");
    $EnablePDNS = $sock->GET_INFO("EnablePDNS");
    $PowerDNSMySQLEngine = $sock->GET_INFO("PowerDNSMySQLEngine");
    $PowerDNSDisableLDAP = $sock->GET_INFO("PowerDNSDisableLDAP");
    $rebuild_database_warn = $tpl->javascript_parse_text("{rebuild_database_warn}");
    if (!is_numeric($EnablePDNS)) {
        $EnablePDNS = 0;
    }
    if (!is_numeric($PowerDNSMySQLEngine)) {
        $PowerDNSMySQLEngine = 1;
    }
    if (!is_numeric($PDNSRestartIfUpToMB)) {
        $PDNSRestartIfUpToMB = 700;
    }
    if (!is_numeric($DisablePowerDnsManagement)) {
        $DisablePowerDnsManagement = 0;
    }
    if (!is_numeric($PowerDNSDisableLDAP)) {
        $PowerDNSDisableLDAP = 1;
    }
    $PowerDNSMySQLEngine = 1;
    $DisablePowerDnsManagement_text = $tpl->javascript_parse_text("{DisablePowerDnsManagement_text}");
    $add = Paragraphe("dns-cp-add-64.png", "{ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "javascript:AddPDNSEntry()");
    $restart = Paragraphe("64-recycle.png", "{restart_pdns}", "{restart_pdns_text}", "javascript:RestartPDNS()");
    $nic = Buildicon64('DEF_ICO_IFCFG');
    $check_resolution = $tpl->_ENGINE_parse_body("{check_resolution}");
    $tests = Paragraphe("check-64.png", "{$check_resolution}", "{check_resolution_dns_engine}", "javascript:YahooWin5('650','{$page}?digg=yes','{$check_resolution}')");
    if ($DisablePowerDnsManagement == 1) {
        $add = Paragraphe("dns-cp-add-64-grey.png", "{ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "");
    }
    if ($EnablePDNS == 0) {
        $add = Paragraphe("dns-cp-add-64-grey.png", "{ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "");
    }
    if ($PowerDNSDisableLDAP == 1) {
        $add = null;
    }
    $t = time();
    $ADD_DNS_ENTRY = $tpl->_ENGINE_parse_body("{ADD_DNS_ENTRY}");
    if ($PowerDNSMySQLEngine == 1) {
        $add = Paragraphe("dns-cp-add-64.png", "{$ADD_DNS_ENTRY}", "{ADD_DNS_ENTRY_TEXT}", "javascript:YahooWin5('550','pdns.mysql.php?item-id=0&t={$t}','PowerDNS:{$ADD_DNS_ENTRY}');");
        if ($user->POWERADMIN_INSTALLED) {
            if ($EnablePDNS == 1) {
                $poweradmin = Paragraphe("poweradmin-64.png", "{APP_POWERADMIN}", "{APP_POWERADMIN_TEXT}", "javascript:s_PopUp('powerdns/index.php',750,650);");
                if (!function_exists('mcrypt_encrypt')) {
                    $poweradmin = Paragraphe("warning64.png", "{APP_POWERADMIN}", "{APP_POWERADMIN_NO_MCRYPT_ENCRYPT}", "");
                }
            }
        }
    }
    if ($PowerDNSMySQLEngine == 1) {
        $repair_database = Paragraphe("database-error-64.png", "{recreate_database}", "{recreate_database_text}", "javascript:RebuildPDNSDB();");
    }
    if ($user->APP_UFDBGUARD_INSTALLED) {
        $dns_filter = Paragraphe("Firewall-Secure-64.png", "{dns_filter}", "{dns_filters_ufdb_text}", "javascript:Loadjs('pdns.ufdb.php')");
    }
    $help = Paragraphe("help-64.png", "{help}", "{online_help}", "javascript:s_PopUpFull('http://nas-appliance.org/index.php?cID=177','1024','900');");
    $POWER_DNS_MYSQL = 1;
    //if(!$user->POWER_DNS_MYSQL){$POWER_DNS_MYSQL=0;$PowerDNSMySQLEngine=0;}
    $t = time();
    $time = time();
    $ttr[] = $dns_filter;
    $ttr[] = $add;
    $ttr[] = $repair_database;
    $ttr[] = $help;
    $ttr[] = $tests;
    $buttons = CompileTr2($ttr, "form");
    if ($EnablePDNS == 1) {
        $q = new mysql();
        if (!$q->TABLE_EXISTS("records", "powerdns")) {
            $errordb = $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{error_missing_tables_click_to_repair}", true) . "\n\t\t\t\t\t<hr>\n\t\t\t\t\t<center id='{$t}'>" . button("{repair}", "RepairPDNSTables()", "22px") . "</center>\n\t\t\t\t\t<p>&nbsp;</p>\n\t\t\t\t\t<script>\n\t\t\t\t\t\tvar x_RepairPDNSTables=function (obj) {\n\t\t\t\t\t\t\tvar results=obj.responseText;\n\t\t\t\t\t\t\tif(results.length>0){alert(results);}\n\t\t\t\t\t\t\tRefreshTab('main_config_pdns');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfunction RepairPDNSTables(){\n\t\t\t\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\t\t\t\tXHR.appendData('RepairPDNSTables','yes');\n\t\t\t\t\t\t\tAnimateDiv('{$t}');\n\t\t\t\t\t\t\tXHR.sendAndLoad('pdns.mysql.php', 'POST',x_RepairPDNSTables);\n\t\t\t\t\t\t}\n\t\t\t\t\t</script>\n\t\t\n\t\t\t\t\t");
        }
    }
    $html = "\n\t<div id='t-{$time}'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=99%>\n\t\t\t<div id='pdns_status'></div>\n\t\t\t<div style='text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshPDNSStatus()") . "</div>\n\t\t\t\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2>\n\t\t\t\t\t{$errordb}\n\t\t\t\t\t" . Paragraphe_switch_img("{EnablePDNS}", "{pdns_explain}", "EnablePDNS{$t}", $EnablePDNS, null, 630) . "\n\t\t\t\t\t<hr>\n\t\t\t\t\t<div style='width:100%;text-align:right;margin-bottom:15px'>\n\t\t\t\t\t\t\t" . button("{apply}", "SaveEnablePowerDNS()", 30) . "</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n{$buttons}\n\t\t\t\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\t\tfunction RefreshPDNSStatus(){\n\t\t\tLoadAjax('pdns_status','{$page}?PowerDNS-status=yes');\n\t\t\t\n\t\t\n\t\t}\n\t\t\n\tvar x_RestartPDNS=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif (results.length>0){alert(results);}\n\t\t\tRefreshPDNSStatus();\n\t\t\t\n\t\t}\n\t\t\n\tvar x_SaveEnablePowerDNS=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif (results.length>0){alert(results);}\n\t\t\tRefreshTab('main_config_pdns');\n\t\t\t\n\t\t}\n\t\n\tfunction RestartPDNS(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('RestartPDNS','yes');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_RestartPDNS);\n\t}\n\t\n\tfunction SaveEnablePowerDNS(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('SaveEnablePowerDNS',document.getElementById('EnablePDNS{$t}').value);\n\t\tAnimateDiv('t-{$time}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveEnablePowerDNS);\t\n\t\n\t}\n\t\n\tfunction RebuildPDNSDB(){\n\t\tif(confirm('{$rebuild_database_warn}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('RebuildPDNSDB','yes');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_RestartPDNS);\n\t\t\n\t\t}\n\t\n\t}\n\t\n\t\t\n\t\tRefreshPDNSStatus();\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function home_b(){
	$t=$_GET["t"];
	$page=CurrentPageName();
	$tpl=new templates();
	$tr[]=icon_memory();
	$tr[]=Paragraphe("perfs-64.png","{artica_performances}","{artica_performances_text}","javascript:Loadjs('artica.performances.php');");
	$tr[]=Paragraphe("ChemicalsMoveDown-64.png","{clean_memory}","{clean_memory_text}","javascript:Loadjs('$page?clean-mem-js=yes&t=$t');");
	
	$table=CompileTr2($tr,"form");
	echo $tpl->_ENGINE_parse_body($table);
	
}
Exemple #6
0
function index_page()
{
    $bind9 = Paragraphe('folder-64-bind9-grey.png', '{APP_BIND9}', '{APP_BIND9_TEXT}', "", null, 210, null, 0, false);
    $openvpn = Paragraphe('64-openvpn-grey.png', '{APP_OPENVPN}', '{APP_OPENVPN_TEXT}', "", null, 210, null, 0, false);
    $users = new usersMenus();
    if ($users->dhcp_installed) {
        $dhcp = Buildicon64('DEF_ICO_DHCP');
    }
    if ($users->BIND9_INSTALLED == true) {
        $bind9 = ICON_BIND9();
    }
    $gateway = Buildicon64('DEF_ICO_GATEWAY');
    $tr[] = $gateway;
    $tr[] = $dhcp;
    $tr[] = $bind9;
    $tr[] = $comp;
    $tr[] = $openvpn;
    $html = CompileTr2($tr, "form");
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, "system.index.php");
}
Exemple #7
0
function tweaks()
{
    if (GET_CACHED(__FILE__, __FUNCTION__, null)) {
        return;
    }
    $sock = new sockets();
    $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
    $users = new usersMenus();
    $page = CurrentPageName();
    $tpl = new templates();
    if ($users->ALTERMIME_INSTALLED) {
        $altermime = Paragraphe('icon_settings-64.png', '{disclaimer}', '{disclaimer_text}', "javascript:Loadjs('amavis.index.php?altermime-js=yes')", 90);
    } else {
        //$altermime=ParagrapheTEXT_disabled('icon_settings-48.png','{disclaimer}','{disclaimer_text}',null,90);
    }
    if ($users->POMMO_INSTALLED) {
        $pommo = Paragraphe('64-pommo.png', '{APP_POMMO}', '{APP_POMMO_TEXT}', "javascript:Loadjs('pommo.index.php?pommo-js=yes')", 90);
    } else {
        //$pommo=ParagrapheTEXT_disabled('48-pommo.png','{APP_POMMO}','{APP_POMMO_TEXT}',null,90);
    }
    if ($users->zip_installed) {
        if ($users->AMAVIS_INSTALLED) {
            if ($users->EnableAmavisDaemon == 1) {
                $winzip = Paragraphe('64-winzip.png', '{auto-compress}', '{auto-compress_text}', "javascript:Loadjs('auto-compress.php?script=winzip')", 90);
            }
        }
    }
    if ($users->POSTMULTI) {
        $multi = Paragraphe('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', "javascript:Loadjs('postfix.network.php?POSTFIX_MULTI_INSTANCE_JS=yes')", 90);
    } else {
        //$multi=ParagrapheTEXT_disabled('postfix-multi-48.png','{POSTFIX_MULTI_INSTANCE}','{POSTFIX_MULTI_INSTANCE_TINY_TEXT}',null,90);
    }
    if ($users->MEM_TOTAL_INSTALLEE < 700000) {
        $multi = ParagrapheTEXT_disabled('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', null, 90);
        $multi = null;
    }
    $postfixStop = Paragraphe('pause-64.png', '{stop_messaging}', '{stop_messaging_text}', "javascript:Loadjs('postfix.stop.php',true)", 90);
    //$postfix_restrictions_classes=Paragraphe('folder-64-restrictions-classes.png','{postfix_restrictions_classes}','{restriction_classes_minitext}',"javascript:Loadjs('postfix.restrictions.classes.php?js=yes')",90);
    $events = Paragraphe('64-mailevents.png', '{postfix_events}', '{logs_viewer_text}', "javascript:s_PopUp('postfix.events.php?pop=true',450,400)", 90);
    //$storage=Paragraphe('folder-storage2-64.png','{storage_rules}','{storage_rules_text}',"javascript:Loadjs('postfix.storage.rules.php')",90);
    //$main_src=Paragraphe('folder-script-database-64.png','{main_ldap}','{main_ldap_explain}',"javascript:s_PopUp(\"postfix.report.php\",500,500,true)",90);
    $watchdog_queue = Paragraphe('folder-watch-64.png', '{watchdog_queue}', '{watchdog_queue_text}', "javascript:Loadjs('postfix.postqueuep.php',true)", 90);
    $postmaster = Paragraphe('postmaster-64.png', '{postmaster}', '{postmaster_text}', "javascript:Loadjs('postfix.postmaster.php')", 90);
    $postmaster_identity = Paragraphe('postmaster-identity.png', '{postmaster_identity}', '{postmaster_identity_text}', "javascript:Loadjs('postfix.postmaster-ident.php',true)", 90);
    $UnknownUsers = Paragraphe('unknown-user-64.png', '{unknown_users}', '{postfix_unknown_users_tinytext}', "javascript:Loadjs('postfix.luser_relay.php',true)", 90);
    $RemoveMessaging = Paragraphe('delete-64.png', '{disable_messaging}', '{disable_messaging_text}', "javascript:Loadjs('postfix.disable.php',true)", 90);
    $ActiveDirectory = Paragraphe('wink-64.png', '{active_directory_link}', '{active_directory_linkmail_text}', "javascript:Loadjs('{$page}?active_directory_link=yes')", 90);
    //$massmailing=ParagrapheTEXT_disabled('mass-mailing-postfix-48.png','{emailings}','{ENABLE_MASSMAILING_TEXT}',null,90);
    if ($users->EMAILRELAY_INSTALLED) {
        $massmailing = Paragraphe('mass-mailing-postfix-64.png', '{emailings}', '{ENABLE_MASSMAILING_TEXT}', "javascript:Loadjs('postfix.massmailing.php',true)", 90);
    }
    //$multi_infos=ParagrapheTEXT_disabled('postfix-multi-48-info.png','{POSTFIX_MULTI_INSTANCE_INFOS}',
    ///'{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}',null,90);
    if ($EnablePostfixMultiInstance == 1) {
        $main_src = null;
        $performances = ParagrapheTEXT_disabled('folder-performances-64.png', '{performances_settings}', '{performances_settings_text}', null, 90);
        $performances = null;
        $mastercf = null;
        $maincfedit = null;
        $maincf = null;
        $postfix_restrictions_classes = null;
        $storage = null;
        $other = null;
        $multi_infos = Paragraphe('postfix-multi-64-info.png', '{POSTFIX_MULTI_INSTANCE_INFOS}', '{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}', "javascript:Loadjs('postfix.multiple.instances.infos.php')");
        $postfixStop = Paragraphe('pause-64-grey.png', '{stop_messaging}', '{stop_messaging_text}', "", 90);
    }
    $q = new mysql();
    $table_storage = $q->TABLE_STATUS("storage", "artica_backup");
    if ($table_storage["Rows"] > 0) {
        $backup_query = Paragraphe('64-backup.png', "{$table_storage["Rows"]} {backuped_mails}", '{all_mailbackup_text}', "javascript:Loadjs('domains.backup.php?js=yes&Master=yes')");
    }
    if ($users->MAILMAN_INSTALLED) {
        $mailman = Paragraphe('mailman-64.png', '{APP_MAILMAN}', '{manage_distribution_lists}', "javascript:Loadjs('mailman.php?script=yes')");
    }
    $tr[] = $multi;
    $tr[] = $multi_infos;
    $tr[] = $postfixStop;
    $tr[] = $RemoveMessaging;
    $tr[] = $watchdog_queue;
    $tr[] = $massmailing;
    $tr[] = $pommo;
    $tr[] = $postmaster;
    $tr[] = $postmaster_identity;
    $tr[] = $UnknownUsers;
    $tr[] = $backup_query;
    $tr[] = $mailman;
    $tr[] = $events;
    $tr[] = $altermime;
    $tr[] = $maincf;
    $tr[] = $main_src;
    $tr[] = $maincfedit;
    $tr[] = $mastercf;
    $tr[] = $storage;
    $tr[] = $postfix_restrictions_classes;
    $tr[] = $other;
    $icons = CompileTr2($tr, 'form');
    $refresh = "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshIndexPostfixAjax()") . "</div>";
    $main = "<input type='hidden' id='monitor_page' value='1' name='monitor_page'>\n{$refresh}\n<table style='width:100%'>\n<tbody>\n<tr>\n\t<td style='width:99%'>{$icons}</td>\n\t<td style='vertical-align:top'><div id='Postfixservinfos' style='width:450px'></div>\n</tr>\n</tbody>\n</table>\n";
    $html = "{$main}\n\n<script>\n\t\t\n</script>\n";
    $datas = $tpl->_ENGINE_parse_body($html);
    $datas = $datas . "\n<script>\n\tLoadAjax('Postfixservinfos','{$page}?postfix-status=yes');\n</script>\n";
    SET_CACHED(__FILE__, __FUNCTION__, null, $datas);
    return $datas;
}
function filter2_section()
{
    $sock = new sockets();
    $users = new usersMenus();
    $SpamAssMilterEnabled = intval($sock->GET_INFO("SpamAssMilterEnabled"));
    $SpamassassinDelegation = intval($sock->GET_INFO("SpamassassinDelegation"));
    $MimeDefangEnabled = intval($sock->GET_INFO('MimeDefangEnabled'));
    $MimeDefangAutoWhiteList = intval($sock->GET_INFO("MimeDefangAutoWhiteList"));
    $MimeDefangFilterExtensions = intval($sock->GET_INFO("MimeDefangFilterExtensions"));
    if ($MimeDefangEnabled == 1) {
        $SpamAssMilterEnabled = 1;
    }
    $TTDOMS = array();
    $OK_SPAMASS = false;
    if ($SpamAssMilterEnabled == 1) {
        if ($SpamassassinDelegation == 1) {
            $OK_SPAMASS = true;
        }
    }
    if (!$users->MIMEDEFANG_INSTALLED) {
        $MimeDefangEnabled = 0;
    }
    if ($MimeDefangEnabled == 0) {
        $MimeDefangClamav = 0;
        $MimeDefangSpamAssassin = 0;
        $MimeDefangAutoWhiteList = 0;
        $MimeDefangFilterExtensions = 0;
    }
    $AutoWhite_icon = "arrow-right-24.png";
    $AutoWhite_color = "#000000";
    $AutoWhite_js = "GotoAutoWhite()";
    $AutoWhite_text = null;
    $ExtCheck_icon = "arrow-right-24.png";
    $ExtCheck_color = "#000000";
    $ExtCheck_js = "GotoMimeDefangExtensions()";
    $ExtCheck_text = null;
    if ($MimeDefangAutoWhiteList == 0) {
        $AutoWhite_icon = "arrow-right-24-grey.png";
        $AutoWhite_color = "#898989";
        $AutoWhite_js = "blur()";
        $AutoWhite_text = " <span style='font-size:14px'>({disabled})</span>";
    }
    if ($MimeDefangFilterExtensions == 0) {
        $ExtCheck_icon = "arrow-right-24-grey.png";
        $ExtCheck_color = "#898989";
        $ExtCheck_js = "blur()";
        $ExtCheck_text = " <span style='font-size:14px'>({disabled})</span>";
    }
    if (!$users->MIMEDEFANG_INSTALLED) {
        $mimedefang_icon = "arrow-right-24-grey.png";
        $mimedefang_color = "#898989";
        $mimedefang_js = "GotoMessagingSecurityUpdate()";
        $mimedefang_text = " <span style='font-size:14px'>({not_installed})</span>";
        $AutoWhite_text = " <span style='font-size:14px'>({not_installed})</span>";
        $ExtCheck_text = " <span style='font-size:14px'>({not_installed})</span>";
    }
    $ldap = new clladp();
    $domains = $ldap->hash_get_domains_ou($_SESSION["ou"]);
    $ouencoded = urlencode($_SESSION["ou"]);
    $TTDOMS[] = "<table style='width:100%'>\n\t<tr>\n\t<td valign='middle' style='width:25px'><img src='img/arrow-right-24.png'></td>\n\t<td valign='middle' style='font-size:18px;width:99%;color:black'>" . texttooltip("{safety_standards}", "position:right:{safety_standards}", "GoToRFCDomain('{$ouencoded}')") . "</td>\n\t</tr></table>";
    $TTDOMS[] = "\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='middle' style='width:25px'><img src='img/{$AutoWhite_icon}'></td>\n\t\t\t<td valign='middle' style='font-size:18px;width:99%;color:{$AutoWhite_color}'>" . texttooltip("{smtp_AutoWhiteList}{$AutoWhite_text}", "position:right:{smtp_AutoWhiteList}", $AutoWhite_js) . "</td>\n\t\t</tr>\n\t</table>";
    $TTDOMS[] = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='middle' style='width:25px'><img src='img/{$ExtCheck_icon}'></td>\n\t<td valign='middle' style='font-size:18px;width:99%;color:{$ExtCheck_color}'>" . texttooltip("{title_mime}{$ExtCheck_text}", "position:right:{mimedefang_attachments_text}", $ExtCheck_js) . "</td>\n\t\t</tr>\n\t</table>";
    while (list($num, $ligne) = each($domains)) {
        $icon = "arrow-right-24.png";
        $Color = "#000000";
        $js = "GoToAntiSpamsDomain('{$num}')";
        $text = null;
        if (!$OK_SPAMASS) {
            $icon = "arrow-right-24-grey.png";
            $js = "blur()";
            $text = " <span style='font-size:14px'>({disabled})</span>";
            $Color = "#898989";
        }
        $TTDOMS[] = "<table style='width:100%'>\n\t\t<tr>\n\t<td valign='middle' style='width:25px'>\n\t\t<img src='img/{$icon}'>\n\t</td>\n\t\t<td valign='middle' style='font-size:18px;width:99%;color:{$Color}'>" . texttooltip("Anti-Spam: {$num}{$text}", "{$num}", "{$js}") . "</td>\n\t</tr>\n\t</table>";
    }
    if (count($TTDOMS) > 0) {
        $final = CompileTr2($TTDOMS);
    }
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($final);
}
Exemple #9
0
function services_toolbox()
{
    $sock = new sockets();
    $tpl = new templates();
    $ini = new Bs_IniHandler();
    $page = CurrentPageName();
    $EnableKlms = $sock->GET_INFO("EnableKlms");
    if (!is_numeric($EnableKlms)) {
        $EnableKlms = 1;
    }
    $TOTAL_MEMORY_MB = $sock->getFrameWork("system.php?TOTAL_MEMORY_MB=yes");
    if ($TOTAL_MEMORY_MB < 1500) {
        $EnableKlms = 0;
        $p = FATAL_ERROR_SHOW_128("{NO_ENOUGH_MEMORY_FOR_THIS_SECTION}<br><strong style='font-size:18px'>{require}:1500MB</strong>", false, true);
    } else {
        $p = Paragraphe_switch_img("{activate_klms}", "{activate_klms_explain}", "EnableKlms", $EnableKlms, null, 550);
    }
    $tr[] = Paragraphe32("watchdog", "watchdog_klms8_text", "Loadjs('klms8.watchdog.php')", "watchdog-32.png");
    $tr[] = Paragraphe32("tasks", "tasks_klms8_text", "Loadjs('klms.tasks.php')", "folder-tasks-32.png");
    $tr[] = Paragraphe32("license_info", "license_info_text", "Loadjs('klms.license.php')", "kl-license-32.png");
    $tr[] = Paragraphe32("mta_link", "mta_link_text", "Loadjs('klms.mta.php')", "comut-32.png");
    $tr[] = Paragraphe32("apply_config", "apply_klms_config_text", "ApplyConfigKLMS()", "32-settings-refresh.png");
    $tr[] = Paragraphe32("reset_admin_password", "reset_admin_password_text", "Loadjs('klms.password.php')", "32-key.png");
    $table = CompileTr2($tr, "form");
    $html = "\n\t{$p}<hr>\n\t{$table}\n\t<script>\n\t\tvar X_applycf= function (obj) {\n \t\t\tvar tempvalue=obj.responseText;\n\t      \tif(tempvalue.length>3){alert(tempvalue);}\n\t\t}\n\t\t\t\n\t\tfunction ApplyConfigKLMS(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('apply-config','yes');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',X_applycf);\t\n\t\t}\t\t\n\t\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function section_computers_infos_OS(){
	$page=CurrentPageName();
	if(CACHE_SESSION_GET( __FUNCTION__,__FILE__,120)){return;}
	$syslog=Paragraphe("syslog-64.png","{system_log}","{system_log_text}","javascript:Loadjs('syslog.engine.php?windows=yes');");
	$dmesg=Paragraphe("syslog-64.png","{kernel_infos}","{kernel_infos_text}","javascript:Loadjs('syslog.dmesg.php?windows=yes');");
	$articacron=Paragraphe("folder-tasks-64.png","{internal_scheduler}","{internal_scheduler_text}","javascript:Loadjs('artica.internal.cron.php');");
	
	
	$tr[]=sysinfos();
	$tr[]=icon_system();
	$tr[]=icon_memory();
	$tr[]=icon_harddrive();
	$tr[]=icon_terminal();
	$tr[]=$syslog;
	$tr[]=$dmesg;
	$tr[]=$articacron;
	$tr[]=scancomputers();
	


$links=CompileTr2($tr);
$t=time();
$html="
<table style='width:100%'>
<tr>
	<td valign='top'><span id='$t'></span></td>
	<td valign='top'>$links</td>
</tr>
</table>
<script>
	QuickLinkShow('quicklinks-system_information');
	LoadAjax('$t','$page?function=section_computer_header');
</script>
";

	$tpl=new templates();
	CACHE_SESSION_SET(__FUNCTION__,__FILE__, $tpl->_ENGINE_parse_body($html));
	
}
function PageDeGarde()
{
    $page = CurrentPageName();
    $time = time();
    $tpl = new templates();
    $f1[] = $tpl->_ENGINE_parse_body("<div style='font-size:26px;margin-bottom:20px'>{top_web} {today}</div>");
    $file = "/usr/share/artica-postfix/ressources/logs/web/TOP_MIME.db";
    if (is_file($file)) {
        $tr[] = "<div style='width:500px;height:500px' id='{$time}-000'></div>";
        $f2[] = "function X000{$time}(){\n\t\tAnimateDiv('{$time}-000');\n\t\tLoadjs('{$page}?graphMime=yes&container={$time}-000&time={$time}',true);\n\t}\n\tsetTimeout(\"X000{$time}()\",500);";
    }
    $file1 = "/usr/share/artica-postfix/ressources/logs/web/TOP_CACHED.db";
    $file2 = "/usr/share/artica-postfix/ressources/logs/web/TOP_NOT_CACHED.db";
    if (is_file($file1)) {
        $tr[] = "<div style='width:500px;height:500px' id='{$time}-001'></div>";
        $f2[] = "function X001{$time}(){\n\t\tAnimateDiv('{$time}-001');\n\t\tLoadjs('{$page}?graph001=yes&container={$time}-001&time={$time}',true);\n\t\t}\n\t\tsetTimeout(\"X001{$time}()\",500);";
    }
    if (is_file($file2)) {
        $tr[] = "<div style='width:500px;height:500px' id='{$time}-002'></div>";
        $f2[] = "function X002{$time}(){\n\t\tAnimateDiv('{$time}-002');\n\t\tLoadjs('{$page}?graph002=yes&container={$time}-002&time={$time}',true);\n\t\t}\n\t\tsetTimeout(\"X002{$time}()\",500);";
    }
    $file = "/usr/share/artica-postfix/ressources/logs/web/TOP_PROTO_SIZE.db";
    if (is_file($file)) {
        $tr[] = "<div style='width:500px;height:500px' id='{$time}-100'></div>";
        $f2[] = "function X100{$time}(){\n\t\tAnimateDiv('{$time}-100');\n\t\tLoadjs('{$page}?graphProtoSize=yes&container={$time}-100&time={$time}',true);\n\t}\n\tsetTimeout(\"X100{$time}()\",500);";
    }
    $file = "/usr/share/artica-postfix/ressources/logs/web/TOP_PROTO_HITS.db";
    if (is_file($file)) {
        $tr[] = "<div style='width:500px;height:500px' id='{$time}-200'></div>";
        $f2[] = "function X200{$time}(){\n\t\tAnimateDiv('{$time}-200');\n\t\tLoadjs('{$page}?graphProtoHits=yes&container={$time}-200&time={$time}',true);\n\t}\n\tsetTimeout(\"X200{$time}()\",500);";
    }
    $tr[] = "<div style='width:500px;height:500px' id='{$time}-01'></div>";
    $tr[] = "<div style='width:500px;height:500px' id='{$time}-02'></div>";
    $tr[] = "<div style='width:500px;height:500px' id='{$time}-03'></div>";
    $f1[] = CompileTr2($tr);
    if (is_file("/usr/share/artica-postfix/ressources/logs/bandwith_stats_today-fam.db")) {
        $f2[] = "function XDeux{$time}(){\n\t\tAnimateDiv('{$time}-01');\n\t\tLoadjs('{$page}?graph1=yes&container={$time}-01&time={$time}',true);\n\t}\n\tsetTimeout(\"XDeux{$time}()\",500);";
    }
    $html = @implode("\n", $f1) . "<script>" . @implode("\n", $f2) . "</script>";
    echo $html;
}
Exemple #12
0
function dansguardian_service_status()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $ini = new Bs_IniHandler();
    $users = new usersMenus();
    $ini->loadString(base64_decode($sock->getFrameWork('cmd.php?squid-ini-status=yes')));
    $squid = new squidbee();
    $CicapEnabled = $sock->GET_INFO('CicapEnabled');
    $EnableClamavInCiCap = $sock->GET_INFO("EnableClamavInCiCap");
    if (!is_numeric($CicapEnabled)) {
        $CicapEnabled = 0;
    }
    if (!is_numeric($EnableClamavInCiCap)) {
        $EnableClamavInCiCap = 1;
    }
    $squid_status = DAEMON_STATUS_ROUND("SQUID", $ini, null, 1);
    $dansguardian_status = DAEMON_STATUS_ROUND("DANSGUARDIAN", $ini, null, 1);
    $APP_SQUIDGUARD_HTTP = DAEMON_STATUS_ROUND("APP_SQUIDGUARD_HTTP", $ini, null, 1);
    $APP_UFDBGUARD = DAEMON_STATUS_ROUND("APP_UFDBGUARD", $ini, null, 1);
    $KAV4PROXY = DAEMON_STATUS_ROUND("KAV4PROXY", $ini, null, 1);
    $CICAP = DAEMON_STATUS_ROUND("C-ICAP", $ini, null, 1);
    $FRESHCLAM = DAEMON_STATUS_ROUND("FRESHCLAM", $ini, null, 1);
    if ($users->KASPERSKY_WEB_APPLIANCE) {
        $FRESHCLAM = null;
    }
    if ($users->KAV4PROXY_INSTALLED) {
        $FRESHCLAM = null;
    }
    if (!$users->FRESHCLAM_INSTALLED) {
        $FRESHCLAM = null;
    }
    if ($CicapEnabled == 0) {
        $FRESHCLAM = null;
    }
    if ($EnableClamavInCiCap == 0) {
        $FRESHCLAM = null;
    }
    $tr[] = $squid_status;
    $tr[] = $dansguardian_status;
    $tr[] = $APP_SQUIDGUARD_HTTP;
    $tr[] = $CICAP;
    $tr[] = $APP_UFDBGUARD;
    $tr[] = $KAV4PROXY;
    $tr[] = $FRESHCLAM;
    $html = "{$okFilterText}\n\t\t<center style='padding-left:5px;margin-right:-5px'>\n\t\t\t<div id='nofilters'></div>\n\t\t\t<div style='width:550px'>" . CompileTr2($tr) . "</div>\n\t\t</center>\n\t\t<div style='text-align:right;width:100%'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshDansguardianMainService()") . "</div>\n\t<script>\n\t\tLoadAjax('nofilters','{$page}?dansguardian-service_status-nofilters=yes');\n\t\t\n\t\tUnlockPage();\n\t</script>\n\t\n\t";
    $off = "<script>UnlockPage();</script>";
    $tpl = new templates();
    $html = $tpl->_ENGINE_parse_body($html, 'squid.index.php');
    echo $html;
}
function page()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $q = new mysql();
    $tpl = new templates();
    $error = null;
    $defined_size = $tpl->_ENGINE_parse_body("{Defined_size}");
    $DisableAnyCache = intval($sock->GET_INFO("DisableAnyCache"));
    $COUNT_DE_CACHES = intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/COUNT_DE_CACHES"));
    $COUNT_DE_MEMBERS = intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/MEMBERS_COUNT"));
    $users = new usersMenus();
    if ($DisableAnyCache == 1) {
        echo FATAL_ERROR_SHOW_128("{DisableAnyCache_enabled_warning}");
        return;
    }
    $cachefile = "/usr/share/artica-postfix/ressources/logs/web/squid_get_cache_infos.db";
    $MAIN_CACHES = unserialize(@file_get_contents($cachefile));
    $curs = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\" \n\tOnClick=\"javascript:Loadjs('squid.caches.center.wizard.php',true);\"";
    $curs2 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"javascript:Loadjs('squid.caches.progress.php',true);\"";
    $curs3 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"javascript:Loadjs('squid.refresh-status.php',true);\"";
    $curs4 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"javascript:Loadjs('squid.rebuild.caches.progress.php');\"";
    $curs5 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"LoadAjaxRound('proxy-store-caches','admin.dashboard.proxy.caches.php');\"";
    $curs6 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"GoToCachesCenter();\"";
    $curs7 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"Loadjs('squidclient.mgr-storedir.php');\"";
    $curs8 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\tOnMouseOut=\"this.style.cursor='auto'\"\n\tOnClick=\"Loadjs('squid.caches.center.php?change-cache-types-js=yes');\"";
    $main_icon = "add-180.png";
    $color = "black";
    if (!$users->CORP_LICENSE) {
        $main_icon = "add-180-grey.png";
        $curs = null;
        $color = "#898989";
        $curs6 = null;
        $error = "<p class=text-error style='font-size:18px'>{welcome_new_cache_wizard_license}</p>";
    }
    if ($COUNT_DE_CACHES > 0) {
        if ($COUNT_DE_MEMBERS > 15) {
            if ($COUNT_DE_CACHES < 20000) {
                $undersized_proxy_caches_explain = $tpl->_ENGINE_parse_body("{undersized_proxy_caches_explain}");
                $COUNT_DE_CACHES_KB = $COUNT_DE_CACHES * 1024;
                $COUNT_DE_CACHES_TEXT = FormatBytes($COUNT_DE_CACHES_KB);
                $undersized_proxy_caches_explain = str_replace("%S", $COUNT_DE_CACHES_TEXT, $undersized_proxy_caches_explain);
                $undersized_proxy_caches_explain = str_replace("%U", $COUNT_DE_MEMBERS, $undersized_proxy_caches_explain);
                $error = $error . "<p class=text-error><strong>{undersized_proxy_caches}</strong><br>{$undersized_proxy_caches_explain}</p>";
            }
        }
    }
    $tr[] = "\n\t\t\t\n\t<table style='width:100%;border:1px solid #CCCCCC;margin:8px'>\n\t<tr>\n\t\t\t<td valign='top' style='width:410px'>\n\t\t\t<center style='width:410px;height:230px;padding-top:20px' {$curs}>\n\t\t\t\t<img src='img/{$main_icon}'>\n\t\t\t</center>\n\t\t\t\n\t\t\t</td>\n\t\t\t<td valign='top' style='width:99%;vertical-align:middle' nowrap>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/plus-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs}><span style='font-size:22px;text-decoration:underline;color:{$color}'>{new_cache}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/24-refresh.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs8}><span style='font-size:22px;text-decoration:underline'>{change_caches_type}</span></td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t<tr style='height:50px'><td colspan=2>&nbsp;</td></tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/arrow-right-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs7}><span style='font-size:22px;text-decoration:underline'>{display_details}</span></td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/arrow-right-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs6}><span style='font-size:22px;text-decoration:underline;color:{$color}'>{caches_center}</span></td>\n\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/arrow-right-24.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs4}><span style='font-size:22px;text-decoration:underline'>{reconstruct_caches}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='middle' width='24px'><img src='img/24-refresh.png'></td>\n\t\t\t\t\t<td valign='middle' {$curs3}><span style='font-size:22px;text-decoration:underline'>{refresh}</span></td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t</table>\n\t\t\t\t\n\t\t\t</td>\n\t\t\t{$error}\n\t\t</tr>\n\t\t</table>\t\n\t";
    $q = new mysql();
    $sql = "SELECT * FROM squid_caches_center WHERE remove=0";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $SquidBoosterEnable = intval($sock->GET_INFO("SquidBoosterEnable"));
    if ($SquidBoosterEnable == 1) {
        $MAIN = $MAIN_CACHES["/var/squid/cache_booster"];
        $MAX = $MAIN["MAX"];
        $CURRENT = $MAIN["CURRENT"];
        $FULL_SIZE = $MAIN["FULL_SIZE"];
        $FULL_SIZE = FormatBytes($FULL_SIZE / 1024);
        $cache_size = FormatBytes($cache_size * 1024);
        $CURRENT_TEXT = FormatBytes($CURRENT);
        $SquidBoosterMem = intval($sock->GET_INFO("SquidBoosterMem"));
        $js[] = "Loadjs('{$page}?gengraph=yes&container=cache-booster&current={$CURRENT}&max={$MAX}&name=CacheBooster');";
        $tr[] = "<table style='width:100%;border:1px solid #CCCCCC;margin:8px'>\n\t\t<tr>\n\t\t<td valign='top' style='width:430px'>\n\t\t<div id='cache-booster' style='width:410px;height:250px'></div>\n\t\t</td>\n\t\t<td valign='top' style='width:99%'>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td valign='top' style='font-size:18px' class=legend>{size_on_disk}:</td>\n\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$FULL_SIZE}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td valign='top' style='font-size:18px' class=legend>{used}:</td>\n\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$CURRENT_TEXT}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top' style='font-size:18px' class=legend>{$defined_size}:</td>\n\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$SquidBoosterMem}MB</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top' style='font-size:18px' class=legend>{parameters}:</td>\n\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>" . texttooltip("{squid_booster}", "{squid_booster_text}", "GotoProxyBooster()") . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td colspan=2 align='right'>\n\t\t<table style='width:180px'>\n\t\t\n\t\t</table>\n\t\t</td>\n\t\t</table>\n\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t";
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $cache_type = $ligne["cache_type"];
        $cache_size = $ligne["cache_size"];
        $cachename = $ligne["cachename"];
        $ID = $ligne["ID"];
        if ($cache_type == "Cachenull") {
            continue;
        }
        if ($cache_type == "tmpfs") {
            $ligne["cache_dir"] = "/home/squid/cache/MemBooster{$ID}";
        }
        $cachedir = $ligne["cache_dir"];
        $MAIN = $MAIN_CACHES[$cachedir];
        $MAX = $MAIN["MAX"];
        $CURRENT = $MAIN["CURRENT"];
        $FULL_SIZE = $MAIN["FULL_SIZE"];
        $FULL_SIZE = FormatBytes($FULL_SIZE / 1024);
        $cache_size = FormatBytes($cache_size * 1024);
        $CURRENT_TEXT = FormatBytes($CURRENT);
        $cachenameen = urlencode($cachename);
        if (!is_numeric($CURRENT)) {
            $CURRENT = 0;
        }
        if (!is_numeric($MAX)) {
            $MAX = 0;
        }
        $enabled_text = null;
        $remove = $ligne["remove"];
        $delete_text = null;
        if ($remove == 0) {
            $js[] = "Loadjs('{$page}?gengraph=yes&container=cache-{$ID}&current={$CURRENT}&max={$MAX}&name={$cachenameen}');";
            $curs3 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\t\t\tOnMouseOut=\"this.style.cursor='auto'\"\n\t\t\tOnClick=\"javascript:Loadjs('squid.caches.center.php?delete-item-js=yes&ID={$ligne["ID"]}')\"";
            $curs4 = "OnMouseOver=\"this.style.cursor='pointer';\"\n\t\t\tOnMouseOut=\"this.style.cursor='auto'\"\n\t\t\tOnClick=\"javascript:Loadjs('squid.caches.center.php?delete-empty-js=yes&ID={$ligne["ID"]}')\"";
            $delete_text = "\n\t\t\t<tr>\n\t\t\t\n\t\t\t\t<tr {$curs3}>\n\t\t\t\t\t<td width=32px'><img src='img/delete-32.png'></td>\n\t\t\t\t\t<td style='font-size:18px;text-decoration:underline'>{delete}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr {$curs4}>\n\t\t\t\t\t<td width=32px'><img src='img/dustbin-32.png'></td>\n\t\t\t\t\t<td style='font-size:18px;text-decoration:underline'>" . texttooltip("{purge}", "{purge_cache_explain}") . "</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t";
        }
        if ($ligne["enabled"] == 0) {
            $enabled_text = "<tr>\n\t\t\t<td valign='top' style='font-size:18px' class=legend>&nbsp;</td>\n\t\t\t<td valign='top' style='font-size:18px' >{disabled}</td>\n\t\t\t</tr>";
        }
        $tr[] = "<table style='width:100%;border:1px solid #CCCCCC;margin:8px'>\n\t\t<tr>\n\t\t\t<td valign='top' style='width:430px'>\n\t\t\t<div id='cache-{$ID}' style='width:410px;height:250px'></div>\n\t\t\t</td>\n\t\t\t<td valign='top' style='width:99%'>\n\t\t\t\t<table style='width:100%'>{$enabled_text}\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{size_on_disk}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$FULL_SIZE}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{used}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$CURRENT_TEXT}</td>\n\t\t\t\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px' class=legend>{$defined_size}:</td>\n\t\t\t\t\t\t<td valign='top' style='font-size:18px;font-weight:bold'>{$cache_size}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=2 align='right'>\n\t\t\t\t\t\t\t<table style='width:180px'>\t\t\t\t\t\n\t\t\t\t\t\t\t{$delete_text}\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>\t\n\t\t\t\t\n\t\t";
    }
    echo "\n\t<div style='font-size:45px;margin-bottom:20px;margin-top:10px'>" . $tpl->_ENGINE_parse_body('{your_proxy_caches}') . "</div>\t\t\n\t<div style='width:98%'>\n\t\t" . $tpl->_ENGINE_parse_body(CompileTr2($tr, true)) . "</div>\n\t<script>" . @implode("\n", $js) . "</script>";
}
function rule(){
	$ID=$_GET["ruleid"];
	$q=new mysql_squid_builder();
	$page=CurrentPageName();
	$tpl=new templates();
	if(!is_numeric($ID)){$ID=0;}
	
	
	$t=time();

	if($ID==0){
		$title="{new_rule}";
		$btname="{add}";
		$ligne["enabled"]=1;

	}else{
		$sql="SELECT * FROM UsersAgentsDB WHERE ID='$ID'";
		$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
		if(!$q->ok){
			$error="<p class='text-error'>$q->mysql_error.</p>";
		}
		$title="{rule}::$ID";
		$btname="{apply}";
	}
	
	if($_GET["pattern"]<>null){
		$ligne["pattern"]=$_GET["pattern"];
		if($ID==0){
			if(preg_match("#^(.+?)\/#", $ligne["pattern"],$re)){
				$ligne["editor"]=$re[1];
				$ligne["explain"]="Match {$re[1]} UserAgent";
				$ligne["category"]="Personal";
			}
			if(preg_match("#(MacBook|Apple|iPad|iPhone)#", $ligne["pattern"])){$ligne["editor"]="Apple"; }
			if(preg_match("#(Android)#i", $ligne["pattern"])){$ligne["editor"]="Android"; }
			if(preg_match("#(CFNetwork)#i", $ligne["pattern"])){ $ligne["category"]="Smartphones"; }
			if(preg_match("#(Microsoft)#i", $ligne["pattern"])){$ligne["editor"]="Microsoft"; }
		}
		
		
		$ligne["pattern"]="regex:".PatternToRegex($ligne["pattern"]);

	}

	
	$tr[]=Paragraphe_switch_img("{allow}", "{browser_allow_explain}","bypass-$t",$ligne["bypass"],null);
	$tr[]=Paragraphe_switch_img("{no_webfilter}", "{no_webfilter_explain}","bypassWebF-$t",$ligne["bypassWebF"],null);
	$tr[]=Paragraphe_switch_img("{no_cache}", "{no_cache_explain}","bypassWebC-$t",$ligne["bypassWebC"],null);
	$tr[]=Paragraphe_switch_img("{deny}", "{deny_browser_explain}","deny-$t",$ligne["deny"],null);

	$html="
	<div style='font-size:22px;margin-bottom:20px'>$title</div>
	<div style='width:98%' class=form>
		<table style='width:100%'>
		<tr>
			<td class=legend style='font-size:18px'>{enabled}:</td>
			<td>".Field_checkbox("enabled-$t",1,$ligne["enabled"],"EnabledCheck$t()")."</td>
		</tr>		
		<tr>
			<td class=legend style='font-size:18px'>{pattern}:</td>
			<td>
			<div class=text-info style='font-size:16px'>{browser_pattern_explain}</div>
			<textarea style='margin-top:5px;font-family:Courier New; font-weight:bold;
			width:99%;height:90px;border:5px solid #8E8E8E; overflow:auto;font-size:16px !important' id='pattern-$t'>{$ligne["pattern"]}</textarea></td>
		</tr>
		<tr>
			<td class=legend style='font-size:18px'>{vendor}:</td>
			<td>".Field_text("editor-$t",$ligne["editor"],"font-size:18px;width:500px")."</td>
		</tr>		
		<tr>
			<td class=legend style='font-size:18px'>{explain}:</td>
			<td>".Field_text("explain-$t",$ligne["explain"],"font-size:18px;width:500px")."</td>
		</tr>	
		<tr>
			<td class=legend style='font-size:18px'>{category}:</td>
			<td>".Field_text("category-$t",$ligne["category"],"font-size:18px;width:500px")."</td>
		</tr>	
		<tr><td colspan=2 style='padding-top:20px;padding-left:20px'>". CompileTr2($tr)."</td></tr>
		
		
		
		<tr><td colspan=2 style='text-align:right'><hr>". button("$btname","Save$t();","26px")."</td></tr>
	</table>
	</div>
	<script>
	var xSave$t= function (obj) {
		var tempvalue=obj.responseText;
		if(tempvalue.length>3){alert(tempvalue);return;};
		var ID=$ID;
		if(ID==0){YahooWinHide();}
		$('#table-{$_GET["t"]}').flexReload();
	}	

	function EnabledCheck$t(){
		var enabled=0;
		if(document.getElementById('enabled-$t').checked){ enabled=1;}
		document.getElementById('pattern-$t').disabled=true;
		document.getElementById('editor-$t').disabled=true;
		document.getElementById('explain-$t').disabled=true;
		document.getElementById('category-$t').disabled=true;
		if(enabled==1){
		document.getElementById('pattern-$t').disabled=false;
		document.getElementById('editor-$t').disabled=false;
		document.getElementById('explain-$t').disabled=false;
		document.getElementById('category-$t').disabled=false;		
		}
	
	}
	
	
	function Save$t(){
		var XHR = new XHRConnection();
		var enabled=0;
		if(document.getElementById('enabled-$t').checked){ enabled=1;}
		
		XHR.appendData('pattern',encodeURIComponent(document.getElementById('pattern-$t').value));
		XHR.appendData('editor',encodeURIComponent(document.getElementById('editor-$t').value));
		XHR.appendData('explain',encodeURIComponent(document.getElementById('explain-$t').value));
		XHR.appendData('category',encodeURIComponent(document.getElementById('category-$t').value));
		XHR.appendData('bypass',document.getElementById('bypass-$t').value);
		XHR.appendData('bypassWebF',document.getElementById('bypassWebF-$t').value);
		XHR.appendData('bypassWebC',document.getElementById('bypassWebC-$t').value);
		XHR.appendData('deny',document.getElementById('deny-$t').value);
		XHR.appendData('enabled',enabled);
		XHR.appendData('ID','{$_GET["ruleid"]}');
		XHR.sendAndLoad('$page', 'POST',xSave$t);
		}
				
EnabledCheck$t();				
	</script>
	";
	
	echo $tpl->_ENGINE_parse_body($html);
}
Exemple #15
0
function filters_for_node()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $hostid = $_GET["hostid"];
    $sock = new sockets();
    $uuid = $hostid;
    $blackbox = new blackboxes($hostid);
    $t = time();
    $DnsFilterCentral = $blackbox->GET_SQUID_INFO('DnsFilterCentral');
    $UfdbEnabledCentral = $blackbox->GET_SQUID_INFO('UfdbEnabledCentral');
    $AntivirusEnabledCentral = $blackbox->GET_SQUID_INFO('AntivirusEnabledCentral');
    $EnableMacAddressFilterCentral = $blackbox->GET_SQUID_INFO('EnableMacAddressFilterCentral');
    $EnableKerbAuth = $blackbox->GET_SQUID_INFO('EnableKerbAuth');
    $EnableKerbAuthCentral = $sock->GET_INFO($EnableKerbAuth);
    if (!is_numeric($UfdbEnabledCentral)) {
        $UfdbEnabledCentral = 1;
    }
    if (!is_numeric($AntivirusEnabledCentral)) {
        $AntivirusEnabledCentral = 1;
    }
    if (!is_numeric($DnsFilterCentral)) {
        $DnsFilterCentral = 0;
    }
    if ($UfdbEnabledCentral == 0) {
        $DnsFilterCentral = 0;
    }
    if (!is_numeric($EnableKerbAuth)) {
        $EnableKerbAuth = $EnableKerbAuthCentral;
    }
    if (!is_numeric($EnableMacAddressFilterCentral)) {
        $EnableMacAddressFilterCentral = 1;
    }
    $tr[] = Paragraphe_switch_img("{enable_webfilter_engine}", "{enable_webfilter_engine_stats}", "UfdbEnabledCentral", $UfdbEnabledCentral, null, 400);
    $tr[] = Paragraphe_switch_img("{activate_pdnsinufdb}", "{activate_pdnsinufdb_explain}", "DnsFilterCentral", $DnsFilterCentral, null, 400);
    $tr[] = Paragraphe_switch_img("{enable_antivirus_checking}", "{enable_antivirus_checking_stats}", "AntivirusEnabledCentral", $AntivirusEnabledCentral, null, 400);
    $tr[] = Paragraphe_switch_img("{enable_activedirectory}", "{enable_activedirectory_stats}", "EnableKerbAuth", $EnableKerbAuth, null, 400);
    $tr[] = Paragraphe_switch_img("{enable_mac_squid_filters}", "{enable_mac_squid_filters_explain}", "EnableMacAddressFilterCentral", $EnableMacAddressFilterCentral, null, 400);
    $table = CompileTr2($tr);
    $html = "{$table}\n\t<div style='margin:5px;text-align:right'><hr>" . button("{apply}", "Save{$t}()", "18") . "</div>\n\t\n\t<script>\n\tvar X_Save{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\tRefreshTab('main_squid_quicklinks_tabs{$_GET["nodeid"]}');\n\t}\t\n\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\n\t\tif(document.getElementById('UfdbEnabledCentral')){\n\t\t\tXHR.appendData('UfdbEnabledCentral',document.getElementById('UfdbEnabledCentral').value);\n\t\t\tdocument.getElementById('img_UfdbEnabledCentral').src='img/wait_verybig.gif';\n\t\t\t\n\t\t}\n\t\t\n\t\tif(document.getElementById('DnsFilterCentral')){\n\t\t\tXHR.appendData('DnsFilterCentral',document.getElementById('DnsFilterCentral').value);\n\t\t\tdocument.getElementById('img_DnsFilterCentral').src='img/wait_verybig.gif';\n\t\t}\t\n\t\t\n\t\tif(document.getElementById('AntivirusEnabledCentral')){\n\t\t\tXHR.appendData('AntivirusEnabledCentral',document.getElementById('AntivirusEnabledCentral').value);\n\t\t\tdocument.getElementById('img_AntivirusEnabledCentral').src='img/wait_verybig.gif';\n\t\t}\n\t\t\n\t\tif(document.getElementById('EnableKerbAuth')){\n\t\t\tXHR.appendData('EnableKerbAuth',document.getElementById('EnableKerbAuth').value);\n\t\t\tdocument.getElementById('img_EnableKerbAuth').src='img/wait_verybig.gif';\n\t\t}\n\n\t\tif(document.getElementById('EnableMacAddressFilterCentral')){\n\t\t\tXHR.appendData('EnableMacAddressFilterCentral',document.getElementById('EnableMacAddressFilterCentral').value);\n\t\t\tdocument.getElementById('img_EnableMacAddressFilterCentral').src='img/wait_verybig.gif';\n\t\t}\t\t\t\n\t\t\n\t\tXHR.appendData('filters','{$uuid}');\t\n\t\tXHR.appendData('uuid','{$uuid}');\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',X_Save{$t});\t\n\t\t\n\t\n\t}\t\t\n\t\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemple #16
0
function main_switch_status()
{
    $switch = $_GET["eth"];
    $tpl = new templates();
    $sock = new sockets();
    $datas = $sock->getFrameWork("vde.php?switch-main-status={$switch}");
    $ini = new Bs_IniHandler();
    $ini->loadString($datas);
    $f[] = DAEMON_STATUS_ROUND("VDE_{$switch}", $ini, null, 0);
    $f[] = DAEMON_STATUS_ROUND("VDHOOK_{$switch}", $ini, null, 0);
    $install = button("{install_virtual_switch}", "Loadjs('virtualswitch.install.php?switch={$switch}')", 30);
    $html = "\n\t<div style='font-size:22px' class=explain>{vde_switch_explain}</div>\t\t\n\t<center style='margin:50px'>{$install}</center>\n\t" . CompileTr2($f);
    echo $tpl->_ENGINE_parse_body($html);
}
function cpustats()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $filecache = "/usr/share/artica-postfix/ressources/logs/AllSquidKids.db";
    $MAIN = unserialize(@file_get_contents($filecache));
    while (list($CPU, $ARRAY) = each($MAIN)) {
        $requestsS = "{$ARRAY["5mn"]["client_http_requests"]} {requests}/s";
        $requestsT = FormatNumber($ARRAY["TOTAL"]["client_http_requests"]);
        $client_http_kbytes_in = "{$ARRAY["5mn"]["client_http_kbytes_in"]} Kbytes/s";
        $client_http_kbytes_out = "{$ARRAY["5mn"]["client_http_kbytes_out"]} Kbytes/s";
        $client_http_kbytes_inT = FormatBytes($ARRAY["TOTAL"]["client_http_kbytes_in"]);
        $client_http_kbytes_outT = FormatBytes($ARRAY["TOTAL"]["client_http_kbytes_out"]);
        $TOTAL = $TOTAL + $requestsT;
        $tr[] = $tpl->_ENGINE_parse_body("\n\t\t<div style='width:450px;border-radius:5px 5px 5px 5px;border:1px solid #CCCCCC;margin:15px;padding:5px'>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td style='width:68px;vertical-align:top'>\n\t\t\t\t<center>\n\t\t\t\t<img src='img/processor-64.png' style='margin-bottom:10px'>\n\t\t\t\t<span style='font-size:18px;font-weigth:bold'>C.P.U #{$CPU}</span>\n\t\t\t\t</center>\n\t\t\t</td>\n\t\t\t<td valign='top'>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=legend style='font-size:14px'>{requests}:</td>\n\t\t\t\t\t\t<td style='font-size:14px;font-weight:bold'>{$requestsT} <span style='font-size:11px'>{$requestsS}</span></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=legend style='font-size:14px'>{inbound}:</td>\n\t\t\t\t\t\t<td style='font-size:14px;font-weight:bold'>{$client_http_kbytes_inT} <span style='font-size:11px'>{$client_http_kbytes_in}</span></td>\n\t\t\t\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=legend style='font-size:14px'>{outbound}:</td>\n\t\t\t\t\t\t<td style='font-size:14px;font-weight:bold'>{$client_http_kbytes_outT} <span style='font-size:11px'>{$client_http_kbytes_out}</span></td>\n\t\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=legend style='font-size:14px'>{cpu}:</td>\n\t\t\t\t\t\t<td style='font-size:14px;font-weight:bold'>" . pourcentage($ARRAY["5mn"]["CPU"]) . "</td>\n\t\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table></div>");
    }
    echo CompileTr2($tr) . "\n\t<center>\n\t<div id='CPUS-GP-1' style='width:600px;height:450px'></div>\n\t</center>\n\t\n\t<script>\n\t\tLoadjs('{$page}?CPUS-GP-1=yes&container=CPUS-GP-1&t={$t}',true);\n\t</script>";
}
Exemple #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);
}
Exemple #19
0
function popup_activedirectory()
{
    $users = new usersMenus();
    $sock = new sockets();
    $tpl = new templates();
    $tr[] = Paragraphe("group-64.png", "{active_directory_users}", "{active_directory_users_browse_text}", "javascript:Loadjs('browse-ad-groups.php')", null, 300);
    if ($users->SQUID_INSTALLED) {
        $tr[] = Paragraphe("database-connect-settings-64.png", "{active_directory_connection}", "{active_directory_connection_parameters}", "javascript:Loadjs('squid.adker.php')", null, 300);
    }
    $sock->getFrameWork("squid.php?ping-kdc=yes");
    $datas = unserialize(@file_get_contents("ressources/logs/kinit.array"));
    if (count($datas) > 0) {
        $img = "error-64.png";
        $textcolor = "#8A0D0D";
        $text = $datas["INFO"];
        if (preg_match("#Authenticated to#is", $text)) {
            $img = "ok64.png";
            $textcolor = "black";
        }
        if (trim($text) != null) {
            $text = ": {$text}";
        }
        $tr[] = Paragraphe("{$img}", "{active_directory}", $text, "javascript:Loadjs('squid.adker.php')", null, 300);
    }
    echo $tpl->_ENGINE_parse_body(CompileTr2($tr));
}
Exemple #20
0
function popup()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $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));
    if (!is_numeric($MimeDefangEnabled)) {
        $MimeDefangEnabled = 0;
    }
    if ($MimeDefangEnabled == 0) {
        $EnableDaemonP = Paragraphe32("disabled", "mimedefang_is_currently_disabled_text", "EnablePopupMimeDefang()", "warning32.png");
    } else {
        $EnableDaemonP = Paragraphe32("enabled", "mimedefang_is_currently_enabled_text", "DisablePopupMimeDefang()", "ok32.png");
    }
    $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);
        $EnableDaemonP = null;
    }
    $tr[] = $EnableDaemonP;
    $tr[] = Paragraphe32("service_options", "service_options_text", "Loadjs('mimedefang.service.php')", "32-parameters.png");
    $tr[] = Paragraphe32("reload_service", "reload_service_text", "MimeDefangCompileRules()", "service-restart-32.png");
    $tr[] = Paragraphe32("online_help", "online_help", "s_PopUpFull('http://www.mail-appliance.org/index.php?cID=305','1024','900');", "help_bg32.png");
    http:
    //www.mail-appliance.org/index.php?cID=305&
    $table = CompileTr2($tr, "form");
    $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'>\n\t\t\t<div style='font-size:18px;margin:bottom:10px;text-align:right'>{APP_MIMEDEFANG}</div>\n\t\t\t<div style='font-size:13px' class=explain>{MIMEDEFANG_DEF}</div>\n\t\t\t{$p}\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\tvar x_Enablemimedefang= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\t\n\t\tRefreshTab('main_config_mimedefang');\n\t}\t\n\t\n\t\tfunction EnablePopupMimeDefang(){\n\t\t\tif(confirm('{$enable_amavisdeamon_ask}')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('enable-mimedefang','yes');\n\t\t\t\tAnimateDiv('explain-{$t}');\n\t\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_Enablemimedefang);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction DisablePopupMimeDefang(){\n\t\t\tif(confirm('{$disable_amavisdeamon_ask}')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('disable-mimedefang','yes');\n\t\t\t\tAnimateDiv('explain-{$t}');\n\t\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_Enablemimedefang);\n\t\t\t}\n\t\t}\n\t\n\t\n\t\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);
}
Exemple #21
0
function serverlist()
{
    $tpl = new templates();
    $users = new usersMenus();
    $page = CurrentPageName();
    $q = new mysql_blackbox();
    $add_artica_agent_explain = $tpl->javascript_parse_text("{add_artica_agent_explain}");
    $t = time();
    $sql = "SELECT * FROM nodes";
    $results = $q->QUERY_SQL($sql);
    $classtr = null;
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $nodeid = $ligne["nodeid"];
        $server = $ligne["ipaddress"];
        $port = $ligne["port"];
        $hostname = $ligne["hostname"];
        $laststatus = distanceOfTimeInWords(time(), strtotime($ligne["laststatus"]));
        $perfs = unserialize(base64_decode($ligne["perfs"]));
        $perftext = "&nbsp;";
        $settings = unserialize(base64_decode($ligne["settingsinc"]));
        $fqdn_hostname = $settings["fqdn_hostname"];
        if ($fqdn_hostname == null) {
            $fqdn_hostname = $server;
        }
        if (is_array($perfs["MEMORY"])) {
            $hash_mem = $perfs["MEMORY"];
            $Hash_real_mem = $perfs["REALMEM"];
            if (is_array($Hash_real_mem)) {
                $hash_mem["ram"]["percent"] = $Hash_real_mem["ram"]["percent"];
                $hash_mem["ram"]["used"] = $Hash_real_mem["ram"]["used"];
                $hash_mem["ram"]["total"] = $Hash_real_mem["ram"]["total"];
            }
            $mem_used_p = $hash_mem["ram"]["percent"];
            $mem_used_kb = FormatBytes($hash_mem["ram"]["used"]);
            $total = FormatBytes($hash_mem["ram"]["total"]);
            $color = "#5DD13D";
            $swapar_perc = $hash_mem['swap']['percent'];
            $swap_color = "rgb(93, 209, 61)";
            $swap_text = "<br><span style='font-size:9px'>swap: {$swapar_perc}% {used}</span>";
            if ($swapar_perc > 30) {
                $swap_color = "#F59C44";
            }
            if ($swapar_perc > 50) {
                $swap_color = "#D32D2D";
            }
            $swap = "<div style=\"border: 1px solid {$swap_color}; width: 100px; background-color: white; padding-left: 0px; margin-top: 3px;\" " . CellRollOver($swap_js) . ">\n\t\t\t\t\t\t<div style=\"width: {$swapar_perc}px; text-align: center; color: white; padding-top: 3px; padding-bottom: 3px; background-color:{$swap_color};\"> </div>\n\t\t\t\t</div>";
            if ($mem_used_p > 70) {
                $color = "#F59C44";
            }
            if ($mem_used_p > 79) {
                $color = "#D32D2D";
            }
            $memtext = "<div style='width:100px;background-color:white;padding-left:0px;border:1px solid {$color}'>\n\t\t\t\t<div style='width:{$mem_used_p}px;text-align:center;color:white;padding-top:3px;padding-bottom:3px;background-color:{$color}'><strong>{$mem_used_p}%</strong></div>\n\t\t\t\t</div>{$swap}";
            //print_r($perfs["MEMORY"]);
        }
        if (is_numeric($perfs["LOAD_POURC"])) {
            $perfsColor = "white";
            if ($perfs["LOAD_POURC"] == 0) {
                $perfsColor = "black";
            }
            $perftext = "\n\t\t<table style='width:100%' margin=0 padding=0>\n\t\t<tr style='background-color:transparent'>\n\t\t<td padding=0px style='border:0px'><span style='font-size:11px'>{load}:</span></td>\n\t\t<td padding=0px style='border:0px'>\n\t\t<div style='width:100px;background-color:white;padding-left:0px;border:1px solid {$perfs["LOAD_COLOR"]};margin-top:3px'>\n\t\t\t<div style='width:{$perfs["LOAD_POURC"]}px;text-align:center;color:white;padding-top:3px;padding-bottom:3px;background-color:{$perfs["LOAD_COLOR"]}'>\n\t\t\t\t<span style='color:{$perfsColor};font-size:11px;font-weight:bold'>{$perfs["LOAD_POURC"]}%</span>\n\t\t\t</div>\n\t\t</div>\n\t\t</td >\n\t\t</tr'>\n\t\t<tr padding=0px style='background-color:transparent'>\n\t\t\t<td style='border:0px'><span style='font-size:11px'>{memory}:</span></td>\n\t\t\t<td style='border:0px'>{$memtext}</td>\n\t\t</tr>\n\t\t</table>";
        }
        $fqdn_hostnameAR = explode(".", $fqdn_hostname);
        if (strpos($hostname, ".") > 0) {
            $hostnameTR = explode(".", $hostname);
            $hostname = $hostnameTR[0];
        }
        $ipZ = array();
        $ipsT = null;
        $results2 = $q->QUERY_SQL("SELECT ipaddr  FROM `nics` WHERE nodeid={$nodeid}");
        while ($ligne2 = mysql_fetch_array($results2, MYSQL_ASSOC)) {
            if ($ligne2["ipaddr"] == "127.0.0.1") {
                continue;
            }
            $ipZ[] = $ligne2["ipaddr"];
        }
        if (count($ipZ) > 0) {
            $ipsT = "<div style='font-size:11px'><i>" . @implode(", ", $ipZ) . "</i></div>";
        }
        $hostTXT = $hostname;
        $NODES[] = "<table style='width:90%' class=form>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td width=1%>" . imgtootltip("64-idisk-server.png", "{$fqdn_hostname}", "Loadjs('nodes.php?nodeid={$nodeid}')") . "</td>\n\t\t\t<td width=99%>\n\t\t\t\t<strong style='font-size:12px'>\n\t\t\t\t\t<a href=\"javascript:blur();\"\n\t\t\t\t\tstyle='font-size:14px;text-decoration:underline'\n\t\t\t\t\tOnClick=\"javascript:Loadjs('nodes.php?nodeid={$nodeid}')\"\n\t\t\t\t\t>{$hostTXT}</a></strong>{$ipsT}\n\t\t\t\t{$perftext}\n\t\t\t</td>\n\t\t</tr>\n\t\t</tbody>\n\t\t</table>";
    }
    $html = CompileTr2($NODES);
    echo $tpl->_ENGINE_parse_body($html);
}
function central_information(){
	$t=$_GET["t"];
	$page=CurrentPageName();
	$tpl=new templates();	
	$users=new usersMenus();
	$TRPTEXT=null;
	$sock=new sockets();
	$processes=unserialize(base64_decode($sock->getFrameWork("squidstats.php?processes-queue=yes")));
	$DisableArticaProxyStatistics=$sock->GET_INFO("DisableArticaProxyStatistics");
	if(!is_numeric($DisableArticaProxyStatistics)){$DisableArticaProxyStatistics=0;}
	$APP_SQUIDDB_INSTALLED=trim($sock->getFrameWork("squid.php?IS_APP_SQUIDDB_INSTALLED=yes"));
	
	if(is_array($processes)){
		$TRP[]="<table style='width:99%' class=form>";
		while (list ($index, $ligne) = each ($processes) ){
			$TTL=$ligne["TTL"];
			$PID=$ligne["PID"];
			$day=$ligne["day"];
			
		
			$TRP[]="<tr>
				<td width=1%><img src='img/preloader.gif'></td>
				<td style='font-weight:bold'>{processing} $day PID:$PID {since} $TTL</td>
				</tr>";
			
		}
		$TRP[]="</table>";
		$TRPTEXT=@implode("\n", $TRP);
	}
	//database-connect-settings-32.png

		$squiddb=Paragraphe32('mysql_statistics_engine','mysql_statistics_engine_params'
				,"blur()","database-connect-settings-32-grey.png");	
	
	if($users->PROXYTINY_APPLIANCE){$squiddb=null;}
		
	
	
	if(!$users->PROXYTINY_APPLIANCE){
	//$tr[]=Paragraphe32("old_statistics_interface", "old_statistics_interface_text", "SquidQuickLinksStatistics();", "status_statistics-22.png");

	
	
	
	if(!$users->PROXYTINY_APPLIANCE){
		
		$tr[]=Paragraphe32('remote_statistics_server','remote_statistics_server_text',"javascript:Loadjs('squid.stats-appliance.php',true)",'syslog-32-client.png');
		

		if($DisableArticaProxyStatistics==0){
			$tr[]=Paragraphe32('import_squid_logs','import_squid_logs_explain',"Loadjs('squid.logs.import.php',true)",'32-import.png');
		}

		
		$tr[]=Paragraphe32('APP_ARTICADB','APP_ARTICADB_TEXT',"Loadjs('squid.categories.php?onlyDB=yes',true)",'32-categories.png');

	
	if($DisableArticaProxyStatistics==0){
			
		$tr[]=table_heures_enretard();
		$tr[]=Paragraphe32('remote_mysql_server','remote_mysqlsquidserver_text',"Loadjs('squid.remote-mysql.php',true)","artica-meta-32.png");
		$tr[]=Paragraphe32('restore_purged_statistics','restore_purged_statistics_explain',"Loadjs('squid.artica.statistics.restore.php',true)","32-import.png");		
		
		}
		
		
		$tr[]=Paragraphe32('source_logs','source_logs_squid_text'
				,"Loadjs('squid.logrotate.php',true)","32-logs.png");		
		
		$tr[]=Paragraphe32('enable_disable_statistics','ARTICA_STATISTICS_TEXT'
				,"Loadjs('squid.artica.statistics.php',true)","statistics-32.png");
		
		
		
	}
	
	if(!$users->CORP_LICENSE){$more_features="<div class=text-info style='font-size:16px;'>{squid_stats_nolicence_explain}</div>";}
	
	
	if($DisableArticaProxyStatistics==1){
		$more_features="<div class=text-info style='font-size:16px;'>{squid_stats_disabled_explain}</div>";
		
	}
	
	
	
	}
		
	
		//
	$tr[]=Paragraphe32('APP_SARG','APP_SARG_TXT',"Loadjs('sarg.php',true)","sarg-logo-32.png");
	$tr[]=Paragraphe32('APP_SARG_HOWTO','APP_SARG_HOWTO_TXT',
		"s_PopUpFull('http://proxy-appliance.org/index.php?cID=203',1024,768,'Statistics');","help-32.png");
	
	
	if($users->URLSNARF_INSTALLED){
		//$tr[]=Paragraphe32('APP_URLSNARF','APP_URLSNARF_TEXT',"Loadjs('urlsnarf.php')","website-32.png");
	}
	
	
	$table=CompileTr2($tr,true);	
	
	$garphs="<div id='graph1-$t' style='height:250px'><center style='margin:50px'><img src='img/wait-clock.gif'></center></div>
	<div style='text-align:right'>". imgtootltip("refresh-24.png","{refresh}","Loadjs('$page?graphique_heure=yes&container=graph1-$t');")."</div>";
	
	$garphsjs="Loadjs('$page?graphique_heure=yes&container=graph1-$t');";
	
	if($sock->SQUID_LOCAL_STATS_DISABLED()){
		$garphs=$tpl->_ENGINE_parse_body(FATAL_WARNING_SHOW_128("{artica_statistics_disabled}"));
		$garphsjs=null;
		
	}
	
	$EnableSquidRemoteMySQL=$sock->GET_INFO("EnableSquidRemoteMySQL");
	if(!is_numeric($EnableSquidRemoteMySQL)){$EnableSquidRemoteMySQL=0;}
	if($EnableSquidRemoteMySQL==1){
		$garphs="<div id='graph1-$t' style='height:250px'><center style='margin:50px'><img src='img/wait-clock.gif'></center></div>
		<div style='text-align:right'>". imgtootltip("refresh-24.png","{refresh}","Loadjs('$page?graphique_heure=yes&container=graph1-$t');")."</div>";
		
		$garphsjs="Loadjs('$page?graphique_heure=yes&container=graph1-$t');";
		$more_features=null;}
	
	$html="
	<div style='font-size:22px;margin-bottom:15px'>{SQUID_STATS}</div>
	$garphs
	$TRPTEXT
	$more_features
	
	<center>
	<div style='margin-top:15px;width:80%'>$table</div>
	</center>
	<script>
		LoadAjax('info-gene-$t','squid.traffic.statistics.php?squid-status-stats=yes',true);
		$garphsjs
	</script>
	";
	

	echo $tpl->_ENGINE_parse_body($html);
	
}
Exemple #23
0
function messaging_right()
{
    $sock = new sockets();
    $users = new usersMenus();
    if (count($t) == 0) {
        return;
    }
    $tpl = new templates();
    $html = "<div class=BodyContent>" . CompileTr2($t, "none") . "</div>";
    echo $tpl->_ENGINE_parse_body($html);
}
function ipconfig_tools(){
	$nic=$_GET["netconfig"];
	if(strlen($_GET["nic"])>3){$nic=$_GET["nic"];}
	$tpl=new templates();
	$sock=new sockets();
	$page=CurrentPageName();
	$tr[]=Paragraphe32("flush_arp_cache", "flush_arp_cache_all_explain","Loadjs('$page?flush-arp-cache-js=yes&nic=$nic')","cache-refresh-32.png");
	// 
	$users=new usersMenus();
	if($users->dnsmasq_installed){
		$tr[]=Paragraphe32("APP_DHCP", "DNSMASQ_DHCP_INSTALL_TEXT",
				"Loadjs('dnsmasq.dhcp.service.php?install-js=yes&nic=$nic')","32-dhcp.png");
	}
	
	
	$table=CompileTr2($tr,true);
	echo $tpl->_ENGINE_parse_body($table);
	
}
Exemple #25
0
function section_computers_infos_OS_2()
{
    $page = CurrentPageName();
    if (CACHE_SESSION_GET(__FUNCTION__, __FILE__, 120)) {
        return;
    }
    $users = new usersMenus();
    $syslog = Paragraphe("syslog-64.png", "{system_log}", "{system_log_text}", "javascript:Loadjs('syslog.engine.php?windows=yes');");
    $dmesg = Paragraphe("syslog-64.png", "{kernel_infos}", "{kernel_infos_text}", "javascript:Loadjs('syslog.dmesg.php?windows=yes');");
    $clock = Paragraphe("clock-gold-64.png", "{server_time2}", "{server_time2_text}", "javascript:Loadjs('index.time.php?settings=yes');");
    if ($users->autofs_installed) {
        $automount = Paragraphe("magneto-64.png", "{automount_center}", "{automount_center_text}", "javascript:Loadjs('autofs.php?windows=yes');");
    }
    $movefilestsem = Paragraphe("folder-move-64.png", "{move_filesystem}", "{move_filesystem_text}", "javascript:Loadjs('system.move.php');");
    $tr[] = sysinfos();
    $tr[] = icon_system();
    $tr[] = icon_memory();
    $tr[] = icon_harddrive();
    $tr[] = $automount;
    $tr[] = $movefilestsem;
    $tr[] = $clock;
    $tr[] = icon_terminal();
    $tr[] = $snmp;
    $tr[] = $syslog;
    $tr[] = $dmesg;
    $tr[] = scancomputers();
    $links = CompileTr2($tr);
    $t = time();
    $html = "\n<table style='width:100%'>\n<tr>\n\t<td valign='top'><span id='{$t}'></span></td>\n\t<td valign='top'>{$links}</td>\n</tr>\n</table>\n<script>\n\tQuickLinkShow('quicklinks-system_information');\n\tLoadAjax('{$t}','{$page}?function=section_computer_header',true);\n</script>\n";
    $tpl = new templates();
    CACHE_SESSION_SET(__FUNCTION__, __FILE__, $tpl->_ENGINE_parse_body($html));
}
function serverlist(){
	$tpl=new templates();
	$users=new usersMenus();
	$page=CurrentPageName();	
	$q=new mysql_blackbox();
	$add_artica_agent_explain=$tpl->javascript_parse_text("{add_artica_agent_explain}");
	
	$t=time();
	$apply=imgtootltip("arrow-down-32.png","{apply} {all}","BuildRemoteConfig()");

	
	$sql="SELECT * FROM nodes";
	$results=$q->QUERY_SQL($sql);
	$classtr=null;
	while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){
		
		$nodeid=$ligne["nodeid"];
		$server=$ligne["ipaddress"];
		$hostid=$ligne["hostid"];
		$port=$ligne["port"];
		$hostname=$ligne["hostname"];
		$laststatus=distanceOfTimeInWords(time(),strtotime($ligne["laststatus"]));
		$perfs=unserialize(base64_decode($ligne["perfs"]));
		$perftext="&nbsp;";
		$settings=unserialize(base64_decode($ligne["settingsinc"]));
		
		$fqdn_hostname=$settings["fqdn_hostname"];
		if($fqdn_hostname==null){$fqdn_hostname=$server;}
		
		if(is_array($perfs["REALMEM"])){
				$hash_mem=$perfs["REALMEM"];
				$mem_used_p=$hash_mem["ram"]["percent"];
				$mem_used_kb=FormatBytes($hash_mem["ram"]["used"]);
				$total=FormatBytes($hash_mem["ram"]["total"]);
				$color="#5DD13D";
				
				$swapar_perc=$hash_mem['swap']['percent'];
				$swap_color="rgb(93, 209, 61)";
				$swap_text="<br><span style='font-size:9px'>swap: {$swapar_perc}% {used}</span>";
				if($swapar_perc>30){$swap_color="#F59C44";}
				if($swapar_perc>50){$swap_color="#D32D2D";}	
				$swap="<div style=\"border: 1px solid $swap_color; width: 100px; background-color: white; padding-left: 0px; margin-top: 3px;\" ". CellRollOver($swap_js).">
						<div style=\"width: {$swapar_perc}px; text-align: center; color: white; padding-top: 3px; padding-bottom: 3px; background-color:$swap_color;\"> </div>
				</div>";
				
				
				if($mem_used_p>70){$color="#F59C44";}
				if($mem_used_p>79){$color="#D32D2D";}		
				$memtext="<div style='width:100px;background-color:white;padding-left:0px;border:1px solid $color'>
				<div style='width:{$mem_used_p}px;text-align:center;color:white;padding-top:3px;padding-bottom:3px;background-color:$color'><strong>{$mem_used_p}%</strong></div>
				</div>$swap"	;
			
			//print_r($perfs["MEMORY"]);
		}
		
		if(is_numeric($perfs["LOAD_POURC"])){
			$perfsColor="white";
			if($perfs["LOAD_POURC"]==0){$perfsColor="black";}
		$perftext="
		<table style='width:100%' margin=0 padding=0>
		<tr style='background-color:transparent'>
		<td padding=0px style='border:0px'><span style='font-size:11px'>{load}:</span></td>
		<td padding=0px style='border:0px'>
		<div style='width:100px;background-color:white;padding-left:0px;border:1px solid {$perfs["LOAD_COLOR"]};margin-top:3px'>
			<div style='width:{$perfs["LOAD_POURC"]}px;text-align:center;color:white;padding-top:3px;padding-bottom:3px;background-color:{$perfs["LOAD_COLOR"]}'>
				<span style='color:$perfsColor;font-size:11px;font-weight:bold'>{$perfs["LOAD_POURC"]}%</span>
			</div>
		</div>
		</td >
		</tr'>
		<tr padding=0px style='background-color:transparent'>
			<td style='border:0px'><span style='font-size:11px'>{memory}:</span></td>
			<td style='border:0px'>$memtext</td>
		</tr>
		</table>";

		
		}
		
		$tooltip="<li>Load:{$perfs["LOAD_POURC"]}%</li><li>Swap:{$swapar_perc}%</li><li>Mem:{$mem_used_p}%</li>";		
		
		$href="<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('nodes.php?nodeid=$nodeid&hostid=$hostid')\" style='font-size:16px;text-decoration:underline'>";
		
			
		$tr[]=Paragraphe("64-network-server.png", "$fqdn_hostname", 
		"<div style='font-size:11px'><i>{since}:$laststatus</i></div>$perftext",
		"javascript:Loadjs('nodes.php?nodeid=$nodeid&hostid=$hostid')",$tooltip,340,null,1);

			
		
	}
	
	$html=CompileTr2($tr,"form");

	echo $tpl->_ENGINE_parse_body($html);
	
}
function setup_disk3()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $t = $_GET["t"];
    $DISKS = array();
    $datas = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/usb.scan.serialize"));
    if (count($datas) == 0) {
        echo FATAL_ERROR_SHOW_128("{no_free_disk_found");
        return;
    }
    while (list($DEV, $MAIN_HD) = each($datas)) {
        if ($DEV == "UUID") {
            continue;
        }
        $SIZEZ = intval($datas[$DEV]["SIZE"]);
        if ($SIZEZ == 0) {
            continue;
        }
        $OCT = $datas["{$DEV}"]["OCT"];
        $ID_VENDOR = $datas[$DEV]["ID_VENDOR"];
        $PARTITIONS = $MAIN_HD["PARTITIONS"];
        $_COUNTPARTITIONS = count($PARTITIONS);
        $TOADD = true;
        if (count($PARTITIONS) > 0) {
            while (list($part, $PART_DATA) = each($PARTITIONS)) {
                $MOUNTED = $PART_DATA["MOUNTED"];
                $ID_VENDOR = $PART_DATA["ID_VENDOR"];
                if ($MOUNTED == "/boot") {
                    $TOADD = false;
                    break;
                }
                if ($MOUNTED == "/tmp") {
                    $TOADD = false;
                    break;
                }
                if ($MOUNTED == "/") {
                    $TOADD = false;
                    break;
                }
                if ($MOUNTED == "/var/log") {
                    $TOADD = false;
                    break;
                }
                if ($MOUNTED == "/usr/share/artica-postfix") {
                    $TOADD = false;
                    break;
                }
            }
        }
        if (!$TOADD) {
            continue;
        }
        $DEV_enc = urlencode($DEV);
        $size_enc = urlencode($datas[$DEV]["SIZE"]);
        $curs = "OnMouseOver=\"this.style.cursor='pointer';\"\n\t\tOnMouseOut=\"this.style.cursor='auto'\"\n\t\tOnClick=\"javascript:LoadAjax('{$t}','{$page}?setup-disk4=yes&t={$t}&dev={$DEV_enc}&size={$size_enc}&oct={$OCT}');\"";
        $tr[] = "\n\t\t<div style='margin:15px'>\n\t\t<div style='width:98%;min-height:116px' class=form {$curs}>\n\t\t<table style='width:100%'>\t\t\n\t\t<tr>\n\t\t\t<td valign='top'><img src='img/disk-128.png'></td>\n\t\t\t<td style='font-size:22px;vertical-align:middle'>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='font-size:18px' class=legend>{disk}:</td>\n\t\t\t\t\t<td style='font-size:18px'>{$DEV}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='font-size:18px' class=legend>{type}:</td>\n\t\t\t\t\t<td style='font-size:18px'>{$ID_VENDOR}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='font-size:18px' class=legend>{size}:</td>\n\t\t\t\t\t<td style='font-size:18px'>{$datas[$DEV]["SIZE"]}</td>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='font-size:18px' class=legend>{partitions}:</td>\n\t\t\t\t\t<td style='font-size:18px'>{$_COUNTPARTITIONS}</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t</table>\n\t\t\t\t\n\t\t\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t</div>\n\t\t</div>\n\t\t";
    }
    $html = CompileTr2($tr, true);
    echo $tpl->_ENGINE_parse_body("<div style='font-size:26px;margin-bottom:20px'>{select_your_free_disk}</div>\n\t\t\t{$html}");
}
Exemple #28
0
function dansguardian_service_status()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $ini = new Bs_IniHandler();
    $users = new usersMenus();
    $ini->loadString(base64_decode($sock->getFrameWork('cmd.php?squid-ini-status=yes')));
    $squid_status = DAEMON_STATUS_ROUND("SQUID", $ini, null, 1);
    $dansguardian_status = DAEMON_STATUS_ROUND("DANSGUARDIAN", $ini, null, 1);
    $APP_SQUIDGUARD_HTTP = DAEMON_STATUS_ROUND("APP_SQUIDGUARD_HTTP", $ini, null, 1);
    $APP_UFDBGUARD = DAEMON_STATUS_ROUND("APP_UFDBGUARD", $ini, null, 1);
    $KAV4PROXY = DAEMON_STATUS_ROUND("KAV4PROXY", $ini, null, 1);
    $tr[] = $squid_status;
    $tr[] = $dansguardian_status;
    $tr[] = $APP_SQUIDGUARD_HTTP;
    $tr[] = $APP_UFDBGUARD;
    $tr[] = $KAV4PROXY;
    $html = "\n\t\t<center><div style='width:550px'>" . CompileTr2($tr) . "</div></center>\n\t\t<div style='text-align:right;width:100%'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshDansguardianMainService()") . "</div>\n\t<script>\n\tLoadAjax('dansguardian-statistics-status','squid.traffic.statistics.php?squid-status-stats=yes');\n\t</script>\n\t\n\t";
    $tpl = new templates();
    $html = $tpl->_ENGINE_parse_body($html, 'squid.index.php');
    echo $html;
}
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    if (!isset($_GET["uuid"])) {
        $_GET["uuid"] = $sock->getframework("cmd.php?system-unique-id=yes");
    }
    if (!is_file("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER")) {
        $sock = new sockets();
        $cpunum = intval($sock->getFrameWork("services.php?CPU-NUMBER=yes"));
    } else {
        $cpunum = intval(@file_get_contents("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER"));
    }
    $CPU_NUMBER = $cpunum;
    $DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    $SquidCacheLevel = $sock->GET_INFO("SquidCacheLevel");
    if (!is_numeric($SquidCacheLevel)) {
        $SquidCacheLevel = 4;
    }
    if ($SquidCacheLevel == 0) {
        $DisableAnyCache = 1;
    }
    if ($DisableAnyCache == 1) {
        $html = FATAL_ERROR_SHOW_128("{all_cache_method_are_globally_disabled}");
        $html = $html . "<div style='width:100%'>\n\t\t\t\t<div style='margin-top:10px;width:99%' class=form>\n\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"Loadjs('squid.caches.disable.php')\"\n\t\t\t\t\tstyle='font-size:16px;text-decoration:underline;font-weight:bold'\n\t\t\t\t\t>{access_to_parameters}</a>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t";
        echo $tpl->_ENGINE_parse_body($html);
        return;
    }
    $maintoolbar = "\n\t<center id='main-smp-toolbar'>\n\t<table style='width:85%' class=form>\n\t\t<tr>\n\t\t\t<td align='center'>" . imgtootltip("apply-config-44.png", "{apply}", "Loadjs('{$page}?apply-js=yes')", null, time()) . "</td>\n\t\t\t<td align='center'>" . imgtootltip("events-64.png", "{events}", "Loadjs('{$page}?events-js=yes&uuid={$_GET["uuid"]}')", null, time() + 3) . "</td>\t\t\t\t\t\t\t\n\t\t\t<td align='center'>" . imgtootltip("48-refresh.png", "{refresh}", "RefreshTab('squid_main_caches_new')", null, time() + 2) . "</td>\n\t\t\t<td align='center'>" . imgtootltip("48-cancel.png", "{back_to_single_proc}", "Loadjs('{$page}?back-js=yes&uuid={$_GET["uuid"]}')", null, time() + 2) . "</td>\n\t\t</tr>\n\t</table>\n\t</center>";
    $t = time();
    $tpl = new templates();
    $sql = "SELECT * FROM cachestatus WHERE uuid='{$_GET["uuid"]}'";
    $q = new mysql_squid_builder();
    $results = $q->QUERY_SQL($sql);
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $array[trim($ligne["cachedir"])]["CURSIZE"] = FormatBytes($ligne["currentsize"]);
        $array[trim($ligne["cachedir"])]["MAXSIZE"] = trim($ligne["maxsize"]);
        $array[trim($ligne["cachedir"])]["POURC"] = trim($ligne["pourc"]);
    }
    $arraySerialize = urlencode(base64_decode(serialize($array)));
    for ($i = 1; $i < $CPU_NUMBER + 1; $i++) {
        $tr[] = "<div id='section-smp-{$i}'></div>";
        $js[] = "\n\t\t\tfunction SectionSMP{$t}{$i}(){\t\n\t\t\t\tLoadAjax('section-smp-{$i}','{$page}?section-smp&procnum={$i}&uuid={$_GET["uuid"]}&arraySerialize={$arraySerialize}');\n\t\t\n\t\t}";
        $jswait[] = "setTimeout(\"SectionSMP{$t}{$i}()\",1{$i}00);";
    }
    $html = "<center>{$maintoolbar}<div style='width:700px'>" . CompileTr2($tr) . "</div></center>\n\t<script>\n" . @implode("\n", $js) . "\n" . @implode("\n", $jswait) . "</script>\n\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
    $sock = new sockets();
    $sock->getFrameWork("squid.php?refresh-caches-infos=yes");
}
Exemple #30
0
function services_toolbox()
{
    $sock = new sockets();
    $tpl = new templates();
    $ini = new Bs_IniHandler();
    $page = CurrentPageName();
    $EnableFreeRadius = $sock->GET_INFO("EnableFreeRadius");
    if (!is_numeric($EnableFreeRadius)) {
        $EnableFreeRadius = 0;
    }
    $t = time();
    $p = Paragraphe_switch_img("{activate_freeradius}", "{activate_freeradius_explain}", "EnableFreeRadius", $EnableFreeRadius, null, 550);
    //$tr[]=Paragraphe32("watchdog", "watchdog_klms8_text", "Loadjs('klms8.watchdog.php')", "watchdog-32.png");
    $tr[] = Paragraphe32("connections_settings", "connections_settings_text", "Loadjs('freeradius.network.php')", "folder-network-32.png");
    //$tr[]=Paragraphe32("license_info", "license_info_text", "Loadjs('klms.license.php')", "kl-license-32.png");
    //$tr[]=Paragraphe32("mta_link", "mta_link_text", "Loadjs('klms.mta.php')", "comut-32.png");
    //$tr[]=Paragraphe32("apply_config", "apply_klms_config_text", "ApplyConfigKLMS()", "32-settings-refresh.png");
    $tr[] = Paragraphe32("test_auth", "test_auth_text", "Loadjs('{$page}?testauth-js=yes')", "32-key.png");
    $table = CompileTr2($tr);
    $html = "\n\t<div style='width:98%' class=form id='{$t}'>{$p}\n\t\t<div style='text-align:right'>" . button("{apply}", "EnableFreeRadius()", 16) . "</div>\n\t</div>\n\t<hr>\n\t{$table}\n\t<script>\n\t\tvar X_applycf{$t}= function (obj) {\n \t\t\tvar tempvalue=obj.responseText;\n\t      \tif(tempvalue.length>3){alert(tempvalue);}\n\t      \tRefreshTab('main_freeradius_tabs');\n\t\t}\n\t\t\t\n\t\tfunction ApplyConfigKLMS(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('apply-config','yes');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',X_applycf);\t\n\t\t}\t\n\n\t\tfunction EnableFreeRadius(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('EnableFreeRadius',document.getElementById('EnableFreeRadius').value);\n\t\t\tAnimateDiv('{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',X_applycf{$t});\t\t\t\n\t\t}\n\t\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}