Exemplo n.º 1
0
function squid_status_stats()
{
    if (CACHE_SESSION_GET(__FUNCTION__, __FILE__)) {
        return;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $users = new usersMenus();
    $websitesnums = $q->COUNT_ROWS("visited_sites");
    $websitesnums = numberFormat($websitesnums, 0, "", " ");
    $sql = "DELETE FROM categorize WHERE LENGTH(pattern)=0";
    $q->QUERY_SQL($sql);
    $export = $q->COUNT_ROWS("categorize");
    $export = numberFormat($export, 0, "", " ");
    $categories = $q->COUNT_CATEGORIES();
    $categories = numberFormat($categories, 0, "", " ");
    $tablescat = $q->LIST_TABLES_CATEGORIES();
    $tablescatNUM = numberFormat(count($tablescat), 0, "", " ");
    $q = new mysql_squid_builder();
    $requests = $q->EVENTS_SUM();
    $requests = numberFormat($requests, 0, "", " ");
    $DAYSNumbers = $q->COUNT_ROWS("tables_day");
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(totalsize) as tsize FROM tables_day"));
    $totalsize = FormatBytes($ligne["tsize"] / 1024);
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT AVG(cache_perfs) as pourc FROM tables_day"));
    $pref = round($ligne["pourc"]);
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM visited_sites WHERE LENGTH(category)=0"));
    $websitesnumsNot = numberFormat($ligne["tcount"], 0, "", " ");
    $mouse = "OnMouseOver=\";this.style.cursor='pointer';\" OnMouseOut=\";this.style.cursor='default';\"";
    $submenu = "\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$totalsize}</b> {downloaded_flow}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$pref}%</b> {cache_performance}</td>\n\t</tr>";
    $html = "\n<table style='width:100%'>\n\t<tbody>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;text-decoration:underline' {$mouse} OnClick=\"javascript:SquidQuickLinks()\"><b>{$DAYSNumbers}</b> {daysOfStatistics}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$requests}</b> {requests}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' {$mouse} style='font-size:14px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.visited.php')\"><b>{$websitesnums}</b> {visited_websites}</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td valign='top' {$mouse} style='font-size:14px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.categories.php')\"><b>{$categories}</b> {websites_categorized}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td valign='top' {$mouse} style='font-size:14px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.visited.php?onlyNot=yes')\"><b>{$websitesnumsNot}</b> {not_categorized}</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td valign='top' {$mouse} style='font-size:14px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.categories.php')\"><b>{$tablescatNUM}</b> {categories}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td valign='top' {$mouse} style='font-size:14px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.categories.toexport.php')\"><b>{$export}</b> {websites_to_export}</td>\n\t</tr>\t\n\t\n\t{$submenu}\n\t</tbody>\n\t</table>\n";
    CACHE_SESSION_SET(__FUNCTION__, __FILE__, $tpl->_ENGINE_parse_body($html));
}
Exemplo n.º 2
0
function search()
{
    $search = $_GET["search"];
    $search = "*{$search}*";
    $search = str_replace("**", "*", $search);
    $search = str_replace("**", "*", $search);
    $search = str_replace("*", "%", $search);
    if (CACHE_SESSION_GET(__FUNCTION__ . $search, __FILE__, 15)) {
        return;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $q = new mysql();
    $computers = new computers();
    $sql = "SELECT * FROM dhcpd_logs WHERE description LIKE '{$search}' ORDER BY zDate DESC LIMIT 0,100";
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $color = "black";
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $uid = null;
        $mac = null;
        if (preg_match("#to\\s+([0-9a-z:]+)\\s+via#", $ligne["description"], $re)) {
            $mac = $re[1];
        }
        if (preg_match("#from\\s+([0-9a-z:]+)\\s+via#", $ligne["description"], $re)) {
            $mac = $re[1];
        }
        if ($mac != null) {
            $uid = $computers->ComputerIDFromMAC($mac);
            if ($uid != null) {
                $uri = "<a href=\"javascript:blur();\" OnClick=\"javascript:YahooUser(870,'domains.edit.user.php?userid={$uid}&ajaxmode=yes&dn=','{$uid}');\" style='font-size:14px;font-weight:bold;color:{$color};text-decoration:underline'>{$mac}</a>&nbsp;<span style='font-size:11px'>({$uid})</span>";
                $ligne["description"] = str_replace($mac, $uri, $ligne["description"]);
            }
        }
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}' width=1% nowrap>{$ligne["zDate"]}</div></td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}' width=99% >{$ligne["description"]}</div></td>\n\t\t</tr>\n\t\t";
    }
    $header = "<center>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=99% colspan=2>{events}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    $html = $header . $html . "</table>\n\t</center>\n\t\n\t<script>\n\n\t</script>\n\t";
    CACHE_SESSION_SET(__FUNCTION__ . $search, __FILE__, $tpl->_ENGINE_parse_body($html));
}
Exemplo n.º 3
0
function search()
{
    $search = $_GET["search"];
    $search = "*{$search}*";
    $search = str_replace("**", "*", $search);
    $search = str_replace("**", "*", $search);
    $search = str_replace("*", "%", $search);
    if (CACHE_SESSION_GET(__FILE__ . __FUNCTION__ . $search, __FILE__, 2)) {
        return;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $table = "visited_sites";
    if ($q->COUNT_ROWS($table) == 0) {
        echo "<H2>" . $tpl->_ENGINE_parse_body("TABLE:{$table}<br>{error_no_datas}") . "</H2>";
        return;
    }
    $sql = "SELECT familysite,SUM(HitsNumber) as HitsNumber FROM `{$table}` \n\tGROUP BY familysite HAVING (`familysite` LIKE '{$search}')\n\tORDER BY HitsNumber DESC LIMIT 0,100";
    $html = "<center>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t\n\t\t<th width=50% nowrap colspan=2>{websites}</th>\n\t\t<th width=50% nowrap>{hits}</th>\n\t\t<th width=1% nowrap>&nbsp;</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<H2>{$q->mysql_error}</H2><center style='font-size:11px'><code>{$sql}</code></center>";
    }
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $js = "BrowseWWWSelect('{$ligne["familysite"]}');";
        $siteTool = imgtootltip("website-add-32.png", "{select}:{$ligne["familysite"]}", $js);
        $sitname = texttooltip($ligne["familysite"], "{select}", $js, null, 0, "font-size:14px;text-decoration:underline");
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t<td width=1% style='font-size:14px'>{$siteTool}</td>\n\t\t<td style='font-size:14px' width=99%>{$sitname}</td>\n\t\t<td style='font-size:14px' width=1%>{$ligne["HitsNumber"]}</td>\n\t\t</tr>\t\n\t\t\n\t\t";
    }
    $html = $html . "</tbody></table>\n";
    CACHE_SESSION_SET(__FILE__ . __FUNCTION__ . $search, __FILE__, $tpl->_ENGINE_parse_body($html));
}
Exemplo n.º 4
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));
}
Exemplo n.º 5
0
function categories_search()
{
    $search = $_GET["category-search"];
    $search = "*{$search}*";
    $search = str_replace("**", "*", $search);
    $search = str_replace("**", "*", $search);
    $search = str_replace("*", "%", $search);
    if (CACHE_SESSION_GET(__FUNCTION__ . $search, __FILE__, 15)) {
        return;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $q = new mysql_squid_builder();
    $dans = new dansguardian_rules();
    $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance");
    if (!is_numeric($EnableWebProxyStatsAppliance)) {
        $EnableWebProxyStatsAppliance = 0;
    }
    $sql = "SELECT * FROM personal_categories";
    $results = $q->QUERY_SQL($sql);
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        //$q->CreateCategoryTable($ligne["category"]);
        $PERSONALSCATS[$ligne["category"]] = $ligne["category_description"];
    }
    $sql = "SELECT table_name as c FROM information_schema.tables WHERE table_schema = 'squidlogs' AND table_name LIKE 'category_{$search}'";
    $results = $q->QUERY_SQL($sql);
    $add = imgtootltip("plus-24.png", "{add} {category}", "Loadjs('{$page}?add-perso-cat-js=yes')");
    $compile_all = imgtootltip("compile-distri-32.png", "{saveToDisk} {all}", "Loadjs('{$page}?compile-all-dbs-js=yes')");
    if (!$q->ok) {
        echo " <H2>Fatal Error: {$q->mysql_error}</H2>";
    }
    $sock = new sockets();
    $sock->getFrameWork("ufdbguard.php?db-status=yes");
    $ArraySIZES = unserialize(@file_get_contents("ressources/logs/web/ufdbguard_db_status"));
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $CountDeMembers = 0;
        $table = $ligne["c"];
        $sizedb = $ArraySIZES[$table]["DBSIZE"];
        $sizeTXT = $ArraySIZES[$table]["TXTSIZE"];
        if (!preg_match("#^category_(.+)#", $table, $re)) {
            continue;
        }
        $categoryname = $re[1];
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $select = imgtootltip("32-parameters.png", "{edit}", "DansGuardianEditMember('{$ligne["ID"]}','{$ligne["pattern"]}')");
        $delete = imgtootltip("delete-32.png", "{delete}", "DansGuardianDeleteMember('{$ligne["ID"]}')");
        $compile = imgtootltip("compile-distri-32.png", "{saveToDisk}", "DansGuardianCompileDB('{$categoryname}')");
        $color = "black";
        $items = $q->COUNT_ROWS($ligne["c"]);
        $TOTAL_ITEMS = $TOTAL_ITEMS + $items;
        if (!isset($dans->array_blacksites[$categoryname])) {
            if (isset($dans->array_blacksites[str_replace("_", "-", $categoryname)])) {
                $categoryname = str_replace("_", "-", $categoryname);
            }
            if (isset($dans->array_blacksites[str_replace("_", "/", $categoryname)])) {
                $categoryname = str_replace("_", "/", $categoryname);
            }
        }
        if ($dans->array_pics[$categoryname] != null) {
            $pic = "<img src='img/{$dans->array_pics[$categoryname]}'>";
        } else {
            $pic = "&nbsp;";
        }
        if ($EnableWebProxyStatsAppliance == 0) {
            if ($sizedb == 0) {
                $pic = "<img src='img/warning-panneau-32.png'>";
            }
            $sizedb_org = $sizedb;
            $sizedb = FormatBytes($sizedb / 1024);
        } else {
            $sizedb_org = $q->TABLE_SIZE($table);
            $sizedb = FormatBytes($sizedb_org / 1024);
        }
        $sizedb = texttooltip($sizedb, "{$sizedb_org} bytes", null, null, 1, "font-size:14px;font-weight:bold;color:{$color}");
        $linkcat = null;
        $text_category = $dans->array_blacksites[$categoryname];
        if (isset($PERSONALSCATS[$categoryname])) {
            $text_category = $PERSONALSCATS[$categoryname];
            if ($pic == "&nbsp;") {
                $pic = "<img src='img/20-categories-personnal.png'>";
            }
            $linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$page}?add-perso-cat-js=yes&cat={$categoryname}')\"\n\t\t\tstyle='font-size:14px;font-weight:bold;color:{$color};text-decoration:underline'>";
        }
        if ($EnableWebProxyStatsAppliance == 0) {
            if ($sizedb_org < 35) {
                $pic = "<img src='img/warning-panneau-32.png'>";
            }
        }
        $viewDB = imgtootltip("mysql-browse-database-32.png", "{view}", "javascript:Loadjs('squid.categories.php?category={$categoryname}')");
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1%>{$pic}</td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}' width=99%>\n\t\t\t{$linkcat}{$categoryname}</a><div style='font-size:11px;width:100%;font-weight:normal'>{$text_category}</div></td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}' width=1% nowrap align='right'>{$sizedb}</td>\n\t\t\t<td width=1%>{$viewDB}</td>\n\t\t\t<td style='font-size:14px;font-weight:bold;color:{$color}' width=1% nowrap align='right'>" . numberFormat($items, 0, "", " ") . "</td>\n\t\t\t<td width=1%>{$compile}</td>\n\t\t\t<td width=1%>{$delete}</td>\n\t\t</tr>\n\t\t";
    }
    $TOTAL_ITEMS = numberFormat($TOTAL_ITEMS, 0, "", " ");
    $header = "<center>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>{$add}</th>\n\t\t<th width=99%>{category}</th>\n\t\t<th width=1%>{size}</th>\n\t\t<th width=1% colspan=2>{$TOTAL_ITEMS} {items}</th>\n\t\t<th width=1%>{$compile_all}</th>\n\t\t<th width=1%>&nbsp;</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    $html = $header . $html . "</table>\n\t</center>\n\t\n\t<script>\n\t\tfunction DansGuardianCompileDB(category){\n\t\t\tLoadjs('{$page}?compile-db-js='+category);\n\t\t}\n\t</script>\n\t";
    CACHE_SESSION_SET(__FUNCTION__ . $search, __FILE__, $tpl->_ENGINE_parse_body($html));
}
Exemplo n.º 6
0
function subtitle_categories(){
	if(CACHE_SESSION_GET(__FUNCTION__, __FILE__,15)){return;}
	$tpl=new templates();
	$q=new mysql_squid_builder();
	$categories=$q->COUNT_CATEGORIES();
	$categories=numberFormat($categories,0,""," ");
	$tablescat=$q->LIST_TABLES_CATEGORIES();
	$tablescatNUM=numberFormat(count($tablescat),0,""," ");		
	$html="<div style='font-size:16px'><b>$categories</b> {websites_categorized}&nbsp;|&nbsp;<b>$tablescatNUM</b> {categories}</div>";
	CACHE_SESSION_SET(__FUNCTION__, __FILE__, $tpl->_ENGINE_parse_body($html));
}
function squid_status_stats()
{
    $off = "<script>UnlockPage();</script>";
    if (!$GLOBALS["AS_ROOT"]) {
        $cachefile = "/usr/share/artica-postfix/ressources/logs/web/traffic.statistics.html";
        if (is_file($cachefile)) {
            $tpl = new templates();
            $cacheContent = @file_get_contents($cachefile);
            if (strlen($cacheContent) > 20) {
                echo $tpl->_ENGINE_parse_body(@file_get_contents($cachefile)) . $off;
                return;
            }
        }
    }
    if (CACHE_SESSION_GET(__FUNCTION__, __FILE__)) {
        return;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " Loading classes<br>\n";
    }
    $sock = new sockets();
    $users = new usersMenus();
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    $SquidActHasReverse = $sock->GET_INFO("SquidActHasReverse");
    if (!is_numeric($SquidActHasReverse)) {
        $SquidActHasReverse = 0;
    }
    if ($EnableRemoteStatisticsAppliance == 1) {
        return;
    }
    $DisableArticaProxyStatistics = $sock->GET_INFO("DisableArticaProxyStatistics");
    if (!is_numeric($DisableArticaProxyStatistics)) {
        $DisableArticaProxyStatistics = 0;
    }
    $MalwarePatrolDatabasesCount = $sock->getFrameWork("cmd.php?MalwarePatrolDatabasesCount=yes");
    $mouse = "OnMouseOver=\";this.style.cursor='pointer';\" OnMouseOut=\";this.style.cursor='default';\"";
    $EnableMacAddressFilter = $sock->GET_INFO("EnableMacAddressFilter");
    if (!is_numeric($EnableMacAddressFilter)) {
        $EnableMacAddressFilter = 1;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " Loading mysql_storelogs()<br>\n";
    }
    $syslogs = new mysql_storelogs();
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " Count accesslogs<br>\n";
    }
    $SyslogsFiles = $syslogs->COUNT_ROWS("accesslogs");
    $TR_ACCESSLOG = "\n\t<tr>\n\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' \n\t\tOnClick=\"javascript:Loadjs('squid.accesses.rotate.php')\"><b><span style='font-size:12px'>{$SyslogsFiles}</span></b><span style='font-size:12px'> {access_logs}</td>\n\t</tr>";
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    if ($users->PROXYTINY_APPLIANCE) {
        $DisableArticaProxyStatistics = 1;
    }
    if ($DisableArticaProxyStatistics == 0) {
        $websitesnums = $q->COUNT_ROWS("visited_sites");
        $websitesnums = numberFormat($websitesnums, 0, "", " ");
        $sql = "DELETE FROM categorize WHERE LENGTH(pattern)=0";
        $q->QUERY_SQL($sql);
        $export = $q->COUNT_ROWS("categorize");
        $export = numberFormat($export, 0, "", " ");
    }
    $catz = new mysql_catz();
    $categories = $catz->COUNT_CATEGORIES();
    $categories = numberFormat($categories, 0, "", " ");
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " categories= {$categories}<br>\n";
    }
    $YourItems = $q->COUNT_CATEGORIES();
    $YourItems = numberFormat($YourItems, 0, "", " ");
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " LIST_TABLES_CATEGORIES()<br>\n";
    }
    $tablescat = $q->LIST_TABLES_CATEGORIES();
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " tablescat={$tablescat}<br>\n";
    }
    $tablescatNUM = numberFormat(count($tablescat), 0, "", " ");
    if ($DisableArticaProxyStatistics == 0) {
        if ($GLOBALS["VERBOSE"]) {
            echo __LINE__ . " EVENTS_SUM()<br>\n";
        }
        $requests = $q->EVENTS_SUM();
        $requests = numberFormat($requests, 0, "", " ");
        if ($GLOBALS["VERBOSE"]) {
            echo __LINE__ . " requests = {$requests}<br>\n";
        }
    }
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " no_license -> translate<br>\n";
    }
    $nolicense = $tpl->_ENGINE_parse_body("{no_license}");
    $PhishingURIS = $q->COUNT_ROWS("categoryuris_phishing");
    $PhishingURIS = numberFormat($PhishingURIS, 0, "", " ");
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " >COUNT_ROWS('categoryuris_malware')<br>\n";
    }
    $MalwaresURIS = $q->COUNT_ROWS("categoryuris_malware");
    $MalwaresURIS = numberFormat($MalwaresURIS, 0, "", " ");
    if (!$users->CORP_LICENSE) {
        $PhishingURIS = $nolicense;
        $MalwaresURIS = $nolicense;
    }
    if ($DisableArticaProxyStatistics == 0) {
        if ($EnableMacAddressFilter == 1) {
            $Computers = $q->COUNT_ROWS("webfilters_nodes");
            $Computers = numberFormat($Computers, 0, "", " ");
            $nodes = "\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.nodes.php',true)\"><b><span style='font-size:12px'>{$Computers}</span></b><span style='font-size:12px'> {computers}</td>\n\t\t\t</tr>";
        } else {
            $Computers = $q->COUNT_ROWS("UserAutDB");
            $Computers = numberFormat($Computers, 0, "", " ");
            $nodes = "\n\t\t\t<tr>\n\t\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.UserAutDB.php')\"><b><span style='font-size:12px'>{$Computers}</span></b><span style='font-size:12px'> {clients}</td>\n\t\t\t</tr>";
        }
        if (!$users->CORP_LICENSE) {
            $license_inactive = "<br><strong style='font-size:11px;font-weight:bolder;color:#BA1010'>{license_inactive}</strong>";
        }
        if (!$q->TABLE_EXISTS("tables_day")) {
            $q->CheckTables();
        }
        $DAYSNumbers = $q->COUNT_ROWS("tables_day");
        if ($GLOBALS["VERBOSE"]) {
            echo __LINE__ . " DAYSNumbers = {$DAYSNumbers}<br>\n";
        }
        //$GLOBALS["FULL_DEBUG"]
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(totalsize) as tsize FROM tables_day"));
        $totalsize = FormatBytes($ligne["tsize"] / 1024);
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT AVG(cache_perfs) as pourc FROM tables_day"));
        $pref = round($ligne["pourc"]);
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM visited_sites WHERE LENGTH(category)=0"));
        $websitesnumsNot = numberFormat($ligne["tcount"], 0, "", " ");
        if ($GLOBALS["VERBOSE"]) {
            echo __LINE__ . " SELECT count(youtubeid),youtubeid FROM `youtube_dayz` GROUP BY youtubeid<br>\n";
        }
        $results = $q->QUERY_SQL("SELECT count(youtubeid),youtubeid FROM `youtube_dayz` GROUP BY youtubeid");
        $youtube_objects = mysql_num_rows($results);
        $youtube_objects = numberFormat($youtube_objects, 0, "", " ");
        $CachePermformance = $q->CachePerfHour();
        if ($GLOBALS["VERBOSE"]) {
            echo __LINE__ . " CachePermformance = {$CachePermformance}<br>\n";
        }
        if ($CachePermformance > -1) {
            $color = "#E01313";
            if ($CachePermformance > 20) {
                $color = "#6DBB6A";
            }
            $cachePerfText = "\n\t\t\t<tr>\n\t\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t\t<td valign='top' style='font-size:12px;'><b style='color:{$color}'>{$CachePermformance}%</span></b><span style='font-size:12px'> {cache_performance} ({now})</td>\n\t\t\t</tr>\n\t\t\t";
        }
        if ($SquidActHasReverse == 1) {
            $TR_CAT_NUMBER = null;
        }
        $TR_CAT_NUMBER = "\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.categories.php')\"><b><span style='font-size:12px'>{$categories}</span></b><span style='font-size:12px'> {websites_categorized}{$license_inactive}</td>\n\t</tr>\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.categories.php')\"><span style='font-size:12px'>{youritems}: <b>{$YourItems}</span></b><span style='font-size:12px'></td>\n\t</tr>";
        $TR_CATZ = "\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td width=99% valign='top' style='font-size:12px;text-decoration:underline' \n\t\t{$mouse} OnClick=\"javascript:Loadjs('squid.traffic.statistics.days.php?js=yes&with-purge=yes')\"><b><span style='font-size:12px'>{$DAYSNumbers}</span></b><span style='font-size:12px'> {daysOfStatistics}</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' style='font-size:12px'><b><span style='font-size:12px'>{$requests}</span></b><span style='font-size:12px'> {requests}</td>\n\t</tr>\n\t{$nodes}\n\t\t\n\t{$TR_CAT_NUMBER}\n";
        $TR_YOUTUBE = "\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline'\n\t\t{$mouse} OnClick=\"javascript:Loadjs('squid.youtube.all.php')\"\n\t\t><b><span style='font-size:12px'>{$youtube_objects}</span></b><span style='font-size:12px'> Youtube {objects}</td>\n\t</tr>";
        if ($DisableArticaProxyStatistics == 1) {
            $TR_YOUTUBE = null;
            $TR_CATZ = null;
        }
        if ($SquidActHasReverse == 1) {
            $TR_YOUTUBE = null;
        }
        $submenu = "\t\n\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' style='font-size:12px'><b><span style='font-size:12px'>{$totalsize}</span></b><span style='font-size:12px'> {downloaded_flow}</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' style='font-size:12px'><b><span style='font-size:12px'>{$pref}%</span></b><span style='font-size:12px'> {cache_performance}</td>\n\t</tr>\n\t\n\t{$cachePerfText}";
        $main_table = "\n\t\t\n\t\t{$TR_CATZ}\n\t\t{$TR_YOUTUBE}\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"blur()\"><b><span style='font-size:12px'>{$PhishingURIS}</span></b><span style='font-size:12px'> {phishing_uris}</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"blur()\"><b><span style='font-size:12px'>{$MalwaresURIS}</span></b><span style='font-size:12px'> {viruses_uris}</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"blur()\"><b><span style='font-size:12px'>{$MalwarePatrolDatabasesCount}</span></b><span style='font-size:12px'> Malware Patrol</td>\n\t</tr>\t\n\t\t\t\t\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.visited.php?onlyNot=yes')\"><b><span style='font-size:12px'>{$websitesnumsNot}</span></b><span style='font-size:12px'> {not_categorized}</td>\n\t</tr>\t\n\t\t\t\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.categories.php')\"><b><span style='font-size:12px'>{$tablescatNUM}</span></b><span style='font-size:12px'> {categories}</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"javascript:Loadjs('squid.categories.toexport.php')\"><b><span style='font-size:12px'>{$export}</span></b><span style='font-size:12px'> {websites_to_export}</td>\n\t</tr>";
    }
    if ($DisableArticaProxyStatistics == 1) {
        $main_table = "\t\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"blur()\"><b><span style='font-size:12px'>{$PhishingURIS}</span></b><span style='font-size:12px'> {phishing_uris}</td>\n\t\t\t</tr>\t\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"blur()\"><b><span style='font-size:12px'>{$MalwaresURIS}</span></b><span style='font-size:12px'> {viruses_uris}</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'></td>\n\t\t\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' OnClick=\"blur()\"><b><span style='font-size:12px'>{$MalwarePatrolDatabasesCount}</span></b><span style='font-size:12px'> Malware Patrol</td>\n\t\t\t</tr>";
    }
    $addwebsites = "\n\t\t<tr>\n\t\t\t<td width=1%><img src='img/plus-16.png'></td>\n\t\t\t<td valign='top' {$mouse} style='font-size:12px;text-decoration:underline' \n\t\t\tOnClick=\"javascript:Loadjs('squid.visited.php?add-www=yes')\"><b><span style='font-size:12px'>{categorize_websites}</span></b><span style='font-size:12px'></td>\n\t\t</tr>\t";
    if ($users->PROXYTINY_APPLIANCE) {
        $addwebsites = null;
        $submenu = null;
    }
    $html = "\n<table style='width:100%'>\n\t<tbody>\n\t{$TR_ACCESSLOG}\n\t{$main_table}\t\n\t{$submenu}\n\t{$addwebsites}\n\t</tbody>\n\t</table>\n{$off}";
    if ($GLOBALS["VERBOSE"]) {
        echo __LINE__ . " tpl->_ENGINE_parse_body<br>\n";
    }
    $html = $tpl->_ENGINE_parse_body($html);
    if (!$GLOBALS["AS_ROOT"]) {
        CACHE_SESSION_SET(__FUNCTION__, __FILE__, $html);
    }
}
Exemplo n.º 8
0
function section_myhost_config()
{
    $page = CurrentPageName();
    if (CACHE_SESSION_GET(__FUNCTION__, __FILE__, 120)) {
        return;
    }
    //$frontend_settings=Paragraphe("64-settings.png",'{index_page_settings}','{index_page_settings_text}',"javascript:Loadjs('artica.performances.php?cron-js=yes');","{internal_hard_drives_text}");
    $artica_settings = Paragraphe('folder-interface-64.png', "{advanced_options}", "{advanced_artica_options_text}", "javascript:Loadjs('artica.settings.php?js=yes&ByPopup=yes');", "{advanced_artica_options_text}");
    $proxy = Paragraphe("proxy-64.png", "{http_proxy}", "{http_proxy_text}", "javascript:Loadjs('artica.settings.php?js=yes&func-ProxyInterface=yes');");
    $WATCHDOG = Paragraphe("watchdog-64.png", "{system_watchdog}", "{system_watchdog_text}", "javascript:Loadjs('system.watchdog.php');");
    $perfs = Paragraphe("perfs-64.png", "{artica_performances}", "{artica_performances_text}", "javascript:Loadjs('artica.performances.php');");
    $tr[] = $WATCHDOG;
    $tr[] = "{$perfs}";
    $tr[] = $proxy;
    $tr[] = $SMTP_NOTIFICATIONS_PAGE;
    $tr[] = $artica_settings;
    $links = CompileTr2($tr);
    $t = time();
    $html = "\n<table style='width:100%'>\n<tr>\n\t<td valign='top'><div id='{$t}'></div></td>\n\t<td valign='top'>{$links}</td>\n</tr>\n</table>\n<script>\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));
}
Exemplo n.º 9
0
function all_status()
{
    if (CACHE_SESSION_GET(__FUNCTION__, ___FILE__, 5)) {
        return;
    }
    $page = CurrentPageName();
    $sock = new sockets();
    $ini = new Bs_IniHandler();
    $tpl = new templates();
    $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);
    $kav = DAEMON_STATUS_ROUND("KAV4PROXY", $ini, null, 1);
    $cicap = DAEMON_STATUS_ROUND("C-ICAP", $ini, null, 1);
    $APP_PROXY_PAC = DAEMON_STATUS_ROUND("APP_PROXY_PAC", $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);
    $md = md5(date('Ymhis'));
    $tr[] = $squid_status;
    $tr[] = $dansguardian_status;
    $tr[] = $kav;
    $tr[] = $cicap;
    $tr[] = $APP_PROXY_PAC;
    $tr[] = $APP_SQUIDGUARD_HTTP;
    $tr[] = $APP_UFDBGUARD;
    $tables[] = "<table style='width:100%'><tr>";
    $t = 0;
    while (list($key, $line) = each($tr)) {
        $line = trim($line);
        if ($line == null) {
            continue;
        }
        $t = $t + 1;
        $tables[] = "<td valign='top'>{$line}</td>";
        if ($t == 2) {
            $t = 0;
            $tables[] = "</tr><tr>";
        }
    }
    if ($t < 2) {
        for ($i = 0; $i <= $t; $i++) {
            $tables[] = "<td valign='top'>&nbsp;</td>";
        }
    }
    $refresh = imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('squid-services','{$page}?squid-services=yes');");
    $tables[] = "</table>";
    $html = "\n\t\t<div style='text-align:right;margin-bottom:10px'>" . button("{restart_all_services}", "Loadjs('squid.restart.php')") . "</div>\n\t\t" . @implode("\n", $tables) . "<div style='text-align:right'>{$refresh}</div>";
    CACHE_SESSION_SET(__FUNCTION__, __FILE__, $tpl->_parse_body($html));
}
Exemplo n.º 10
0
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));
	
}