Example #1
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $bulkExport = Paragraphe("sync-64-grey.png", '{bulk_imap_export}', "{missing_imap_sync_text}");
    $salearn = Paragraphe('64-learning-grey.png', '{salearnschedule}', '{feature_not_installed}', "");
    if ($users->imapsync_installed) {
        $bulkExport = Paragraphe("sync-64.png", '{bulk_imap_export}', "{bulk_imap_export_text}", "javascript:Loadjs('imap.bulk.export.php');");
    }
    if ($users->spamassassin_installed) {
        $salearn = Paragraphe('64-learning.png', '{salearnschedule}', '{salearnschedule_text}', "javascript:Loadjs('zarafa.salearn.php')");
    }
    $softDelete = Paragraphe("bad-email-64.png", '{softdelete_option}', "{softdelete_option_explain}", "javascript:Loadjs('zarafa.softdelete.php');");
    $multiple = Paragraphe("postfix-multi-64.png", '{multiple_zarafa_instances}', "{multiple_zarafa_instances_text}", "javascript:Loadjs('zarafa.multiple-enable.php');");
    $ical = Paragraphe("busycal-64.png", '{APP_ZARAFA_ICAL}', "{ZARAFA_CALDAV_EXPLAIN}", "javascript:Loadjs('zarafa.caldav.php');");
    $zarafabackup = Paragraphe("64-backup.png", '{mailboxes_backups}', "{mailboxes_backups_text_admin}", "javascript:Loadjs('imap.mbx.backup.php');");
    $multipledomaines = Paragraphe("folder-org-64.png", '{multidomains}', "{multidomains_text}", "javascript:Loadjs('postfix.index.php?script=multidomains');");
    $junkmove = Paragraphe("mail-flag-64.png", '{junk_mail_folder}', "{junk_mail_folder_zexplain}", "javascript:Loadjs('zarafa.junkheader.php');");
    $autowitelist = Paragraphe("contact-64.png", '{addressbooks_whitelisting}', "{addressbooks_whitelisting_explain}", "javascript:Loadjs('zarafa.nabwhitelist.php');");
    $dagent = Paragraphe("64-restore-mailbox.png", "{delivery_agent}", "{delivery_agent_parameters_text}", "javascript:Loadjs('zarafa.dagent.php');");
    $ZarafaAlwaysSendDelegates = Paragraphe("64-resend.png", "{ZarafaAlwaysSendDelegates}", "{ZarafaAlwaysSendDelegates_text}", "javascript:Loadjs('zarafa.ZarafaAlwaysSendDelegates.php');");
    if ($users->ZARAFA_SEARCH_INSTALLED) {
        $zarafaSearch = Paragraphe("loupe-64.png", "Zarafa Search", "{zarafa_search_text}", "javascript:Loadjs('zarafa.search.php');");
    }
    $recover = Paragraphe("database-error-64.png", "{zarafa_database_recovery}", "{zarafa_database_recovery_text}", "javascript:Loadjs('zarafa.recover.php');");
    $DisableAccountLessThan4Caracters = Paragraphe("contact-64.png", "{uid_length_protection}", "{uid_length_protection_text}", "javascript:Loadjs('zarafa.DisableAccountLessThan4Caracters.php');");
    $tr[] = $ical;
    $tr[] = $dagent;
    $tr[] = $ZarafaAlwaysSendDelegates;
    $tr[] = $zarafaSearch;
    $tr[] = $DisableAccountLessThan4Caracters;
    $tr[] = $junkmove;
    $tr[] = $innodb_file_per_table;
    $tr[] = $multipledomaines;
    $tr[] = $bulkExport;
    $tr[] = $autowitelist;
    $tr[] = $salearn;
    $tr[] = $softDelete;
    $tr[] = $multiple;
    $tr[] = $trash;
    $tr[] = $zarafabackup;
    $compile = CompileTr4($tr);
    $time = time();
    $html = "\n<div id='{$time}'></div>\n<center>\n<div style='width:1000px'>{$compile}</div>\t\n</center>\n\t\n\t\n\n\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #2
0
function build_index_page()
{
    $sock = new sockets();
    $unix = new unix();
    $SargOutputDir = $sock->GET_INFO("SargOutputDir");
    if ($SargOutputDir == null) {
        $SargOutputDir = "/var/www/html/squid-reports";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$SargOutputDir}\n";
    }
    @copy("/usr/share/artica-postfix/bin/install/sarg.css", "{$SargOutputDir}/sarg.css");
    @copy("/usr/share/artica-postfix/img/logo-artica-160.gif", "{$SargOutputDir}/logo.gif");
    @copy("/usr/share/artica-postfix/css/images/pattern.png", "{$SargOutputDir}/pattern.png");
    @copy("/usr/share/artica-postfix/ressources/templates/default/images/ui-bg_highlight.png", "{$SargOutputDir}/ui-bg_highlight.png");
    @copy("/usr/share/artica-postfix/img/arrow-right-16.png", "{$SargOutputDir}/arrow-right-16.png");
    @chmod("{$SargOutputDir}/arrow-right-16.png", 0755);
    @chmod("{$SargOutputDir}/ui-bg_highlight.png", 0755);
    @chmod("{$SargOutputDir}/sarg.css", 0755);
    @chmod("{$SargOutputDir}/logo.gif", 0755);
    @chmod("{$SargOutputDir}/pattern.png", 0755);
    $f[] = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">";
    $f[] = "<html>";
    $f[] = "<head>";
    $f[] = "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">";
    $f[] = "<title>SARG reports</title>";
    $f[] = "<link rel=\"stylesheet\" href=\"/sarg.css\" type=\"text/css\">";
    $f[] = "</head>";
    $f[] = "<body>";
    $f[] = "<div class=\"logo\"><img src=\"/logo.gif\">&nbsp;</div>";
    $f[] = "<div class=\"title\"><table cellpadding=\"0\" cellspacing=\"0\">";
    $f[] = "<tr><th class=\"title_c\">Squid User Access Reports</th></tr>";
    $f[] = "</table>";
    $f[] = "</div>";
    $f[] = "<table cellpadding=\"0\" cellspacing=\"0\">\n\n";
    if (is_file("{$SargOutputDir}/hourly/index.html")) {
        $f[] = "<tr><td align='center'><a href=\"hourly/index.html\" style='font-size:22px;font-weight:bold'>&laquo;&nbsp;Hourly reports&nbsp;&raquo;</td></tr>";
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$SargOutputDir}/hourly/index.html no such file\n";
        }
    }
    if (is_file("{$SargOutputDir}/daily/index.html")) {
        $f[] = "<tr><td align='center'><a href=\"daily/index.html\" style='font-size:22px;font-weight:bold'>&laquo;&nbsp;Daily reports&nbsp;&raquo;</td></tr>";
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$SargOutputDir}/daily/index.html no such file\n";
        }
    }
    if (is_file("{$SargOutputDir}/weekly/index.html")) {
        $f[] = "<tr><td align='center'><a href=\"weekly/index.html\" style='font-size:22px;font-weight:bold'>&laquo;&nbsp;Weekly reports&nbsp;&raquo;</td></tr>";
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$SargOutputDir}/weekly/index.html no such file\n";
        }
    }
    if (is_file("{$SargOutputDir}/monthly/index.html")) {
        $f[] = "<tr><td align='center'><a href=\"monthly/index.html\" style='font-size:22px;font-weight:bold'>&laquo;&nbsp;Monthly reports&nbsp;&raquo;</td></tr>";
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$SargOutputDir}/monthly/index.html no such file\n";
        }
    }
    $dirs = $unix->dirdir($SargOutputDir);
    $monthsz = array('jan' => 1, 'ene' => 1, 'feb' => 2, 'mar' => 3, 'apr' => 4, 'abr' => 4, 'may' => 5, 'jun' => 6, 'jul' => 7, 'aug' => 8, 'ago' => 8, 'sep' => 9, 'oct' => 10, 'nov' => 11, 'dec' => 12, 'dic' => 12);
    while (list($index, $line) = each($dirs)) {
        $dir = basename($line);
        if (!preg_match("#\\/([0-9]+)([A-Za-z]+)([0-9]+)-([0-9]+)([A-Za-z]+)([0-9]+)\$#", $line, $re)) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} {$dir}, no match\n";
            continue;
        }
        $day = $re[1];
        $month = $re[2];
        $year = $re[3];
        $day1 = $re[4];
        $month1 = $re[5];
        $year1 = $re[6];
        if (strlen($year) < 4) {
            if (strlen($day) == 4) {
                $year = $re[1];
                $month = $re[2];
                $day = $re[3];
                $day1 = $re[6];
                $month1 = $re[5];
                $year1 = $re[4];
            }
        }
        if (strlen($year) < 4) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} {$dir}, no match\n";
            continue;
        }
        $monthNum = $monthsz[strtolower($month)];
        if (strlen($monthNum) == 1) {
            $monthNum = "0{$monthNum}";
        }
        $time = strtotime("{$year}-{$monthNum}-{$day} 00:00:00");
        $ARRAY[$year][$month][$day]["DIR"] = $dir;
        $too = array();
        if ($day1 != $day) {
            $too[] = $day1;
        }
        if ($month1 != $month) {
            $too[] = $month1;
        }
        if ($year1 != $year) {
            $too[] = $year1;
        }
        if ($month1 == $month) {
            $to = "{$day1}";
        }
        if (count($to) > 0) {
            $to = @implode("/", $to);
        } else {
            $to = null;
        }
        $ARRAY[$year][$month][$day]["TO"] = "{$to}";
        $ARRAY[$year][$month][$day]["TITLE"] = date("l {$day}", $time);
    }
    while (list($year, $array1) = each($ARRAY)) {
        $f[] = "<tr><td>&nbsp;</td></td>";
        $f[] = "<tr><td align='center'><span style='font-size:22px;font-weight:bold'>&laquo;&nbsp;{$year} reports&nbsp;&raquo;</td></tr>";
        $f[] = "<tr><td align='center'>";
        $TR = array();
        while (list($month, $array2) = each($array1)) {
            $ttr = array();
            $ttr[] = "<table style='width:100%;marign:5px'>";
            $c = 1;
            while (list($day, $array3) = each($array2)) {
                $c++;
                $ttr[] = "<tr>\n\t\t\t\t<td width=1% nowrap><img src='arrow-right-16.png'></td>\n\t\t\t\t<td style='font-size:14px'><a href=\"{$array3["DIR"]}/index.html\">{$array3["TITLE"]} {$array3["TO"]}</a></td>\n\t\t\t\t</tr>";
                if (strpos(" " . $array3["TITLE"], "Sunday") > 0) {
                    $ttr[] = "<tr><td colspan=2><hr></td></tr>";
                }
            }
            $ttr[] = "</table>";
            $TR[] = "<div style='font-size:22px;font-weight:bold'>&laquo;&nbsp;{$month} reports&nbsp;&raquo;</div>" . @implode("\n", $ttr);
        }
        $f[] = CompileTr4($TR);
        $f[] = "</td></tr>";
    }
    $f[] = "</table>\n</body>\n</html>";
    events("{$SargOutputDir}/index.html done");
    events("{$SargOutputDir}/index.php done");
    @file_put_contents("{$SargOutputDir}/index.html", @implode("\n", $f));
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$SargOutputDir}/index.html done\n";
    }
    @file_put_contents("{$SargOutputDir}/index.php", "<?php\nheader('location:index.html')\n?>");
}
function squid_frontend_status()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $TITLE_REQUESTS = null;
    $SquidCacheLevel = $sock->GET_INFO("SquidCacheLevel");
    if (!is_numeric($SquidCacheLevel)) {
        $SquidCacheLevel = 4;
    }
    $LogsWarninStop = $sock->GET_INFO("LogsWarninStop");
    if ($LogsWarninStop == 1) {
        echo FATAL_ERROR_SHOW_128("<div style='font-size:20px'>{squid_logs_urgency}</div>\n\t\t\t\t<div style='text-align:right;font-size:22px;text-align:right;text-decoration:underline;margin-top:20px'>\n\t\t\t\t\t<a href=\"javascript:Loadjs('system.log.emergency.php')\">{squid_logs_urgency_section}</a>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t");
    }
    $squid5mn = unserialize(base64_decode($sock->getFrameWork("squid.php?5mncounter=yes")));
    //$realMemory=unserialize(base64_decode($sock->getFrameWork("services.php?realMemory=yes")));
    $CounterInfos = unserialize(base64_decode($sock->getFrameWork("squid.php?CounterInfos=yes")));
    $StorageCapacity = unserialize(base64_decode($sock->getFrameWork("squid.php?StorageCapacity=yes")));
    $SquidMonitorParms = unserialize(base64_decode($sock->GET_INFO("SquidMonitorParms")));
    $t = time();
    $server_all_kbytes_in = $SquidMonitorParms["server_all_kbytes_in"];
    $server_all_kbytes_out = $SquidMonitorParms["server_all_kbytes_out"];
    $HttpRequests = $SquidMonitorParms["HttpRequests"];
    $ActiveRequests = $SquidMonitorParms["ActiveRequests"];
    $TITLE_USERS = null;
    $TITLE_COMPUTERS = null;
    $EnableKerbAuth = intval($sock->GET_INFO("EnableKerbAuth"));
    if ($EnableKerbAuth == 1) {
        include_once dirname(__FILE__) . "/ressources/class.external.ad.inc";
        $ldap = new external_ad_search();
        $NET_RPC_INFOS = $ldap->NET_RPC_INFOS();
        $NumBerOfUsers = intval($NET_RPC_INFOS["Num users"]);
        if ($NumBerOfUsers > 0) {
            $TITLE_USERS = "&nbsp;|&nbsp;<a href=\"javascript:blur();\" \n\t\t\tOnClick=\"javascript:AnimateDiv('BodyContent');LoadAjax('BodyContent','squid.adker.php?tabs=yes');\" \n\t\t\tstyle='text-decoration:underline'>{$NumBerOfUsers} {members}</a>";
        }
    }
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(MAC) as tcount FROM (SELECT MAC FROM UserAutDB GROUP BY MAC) as t"));
    $Nodes = $ligne["tcount"];
    if ($Nodes > 0) {
        $TITLE_COMPUTERS = "&nbsp;|&nbsp;<a href=\"javascript:blur();\"\n\t\tOnClick=\"Loadjs('squid.computer-browse.php')\"\n\t\tstyle='text-decoration:underline'>{$Nodes} {computers}</a>";
    }
    $CACHES_RATES = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/web/TOTAL_CACHED"));
    $TOTALS_NOT_CACHED = intval($CACHES_RATES["TOTALS_NOT_CACHED"]);
    $TOTALS_CACHED = intval($CACHES_RATES["TOTALS_CACHED"]);
    $TOTALS_DOWNLOAD = $TOTALS_NOT_CACHED + $TOTALS_CACHED;
    $TOTALS_NOT_CACHED = intval(@file_get_contents("/usr/share/artica-postfix/ressources/logs/stats/NOT_CACHED"));
    if ($TOTALS_NOT_CACHED > 0) {
        $TOTALS_NOT_CACHED_TEXT = "&nbsp;|&nbsp;<a href=\"javascript:blur();\" \n\t\tOnClick=\"javascript:Loadjs('admin.index.loadvg.squid.notcached-week.php');\"\n\t\tstyle='text-decoration:underline;font-weight:bold'>{not_cached_this_week}: " . FormatBytes($TOTALS_NOT_CACHED / 1024) . "</a>";
    }
    $Status_cache = "&nbsp;|&nbsp;{downloaded} " . FormatBytes($TOTALS_DOWNLOAD / 1024) . "&nbsp;|&nbsp;{cached}:" . FormatBytes($TOTALS_CACHED / 1024) . $TOTALS_NOT_CACHED_TEXT;
    $RATE = $TOTALS_CACHED / $TOTALS_DOWNLOAD * 100;
    $RATE = round($RATE, 1);
    $TITLE_RATE = "&nbsp;|&nbsp;{cache_rate} <strong>{$RATE}%</strong>";
    if (!is_numeric($server_all_kbytes_in)) {
        $server_all_kbytes_in = 1000;
    }
    if (!is_numeric($server_all_kbytes_out)) {
        $server_all_kbytes_out = 250;
    }
    if (!is_numeric($HttpRequests)) {
        $HttpRequests = 150;
    }
    if (!is_numeric($ActiveRequests)) {
        $ActiveRequests = 150;
    }
    if (!isset($squid5mn["cpu_usage"])) {
        $squid5mn["cpu_usage"] = 0;
    }
    $squid5mn["cpu_usage"] = round($squid5mn["cpu_usage"], 2);
    $squid5mn["client_http.requests"] = round($squid5mn["client_http.requests"], 2);
    $squid5mn["server.all.kbytes_in"] = round($squid5mn["server.all.kbytes_in"], 2);
    $squid5mn["server.all.kbytes_out"] = round($squid5mn["server.all.kbytes_out"], 2);
    $ActiveRequestsR = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/active_requests.inc"));
    $ActiveRequestsNumber = count($ActiveRequestsR["CON"]);
    $ActiveRequestsIpaddr = count($ActiveRequestsR["IPS"]);
    $ActiveRequestsMembers = count($ActiveRequestsR["USERS"]);
    if ($ActiveRequestsNumber > 0) {
        $TITLE_REQUESTS = "&nbsp;|&nbsp;<a href=\"javascript:blur();\"\n\t\tOnClick=\"Loadjs('squid.active.requests.php')\"\n\t\tstyle='text-decoration:underline'>{$ActiveRequestsNumber} {active_requests}</a>";
    }
    if (!is_numeric($ActiveRequestsNumber)) {
        $ActiveRequestsNumber = 0;
    }
    if (!is_numeric($ActiveRequestsIpaddr)) {
        $ActiveRequestsIpaddr = 0;
    }
    if (!is_numeric($ActiveRequestsMembers)) {
        $ActiveRequestsMembers = 0;
    }
    $server_all_kbytes_in_text = $tpl->javascript_parse_text("{server_all_kbytes_in}");
    $server_all_kbytes_out_text = $tpl->javascript_parse_text("{server_all_kbytes_out}");
    $active_requests = $tpl->javascript_parse_text("{active_requests}");
    $proxy_status = $tpl->javascript_parse_text("{proxy_status}");
    $second = $tpl->javascript_parse_text("{second}");
    $requests = $tpl->javascript_parse_text("{requests}");
    $countStorages = count($StorageCapacity);
    for ($i = 0; $i < $countStorages; $i++) {
        $tS[] = "<div id='squid-s{$i}-{$t}' style='width:160px; height:100px'>";
        $js[] = " var s{$i} = new JustGage({\n\t\tid: 'squid-s{$i}-{$t}',\n\t\tvalue: {$StorageCapacity[$i]},\n\t\tmin: 0,\n\t\tmax: 100,\n\t\ttitle: 'Storage Capacity Kid " . ($i + 1) . "',\n\t\tlabel: '%',\n\t\tlevelColorsGradient: true\n\t});      ";
    }
    $storages = CompileTr4($tS, true, null, true);
    $ini = new Bs_IniHandler();
    $color = "black";
    $ini->loadFile("/usr/share/artica-postfix/ressources/databases/ALL_SQUID_STATUS");
    if ($ini->_params["SQUID"]["running"] == 0) {
        $color = "#d32d2d";
        $status = "{stopped}";
    } else {
        if ($ini->_params["SQUID"]["master_time"]) {
            $status2 = " {running} {since} " . distanceOfTimeInWords($ini->_params["SQUID"]["master_time"], time());
        }
    }
    $version = @file_get_contents("/usr/share/artica-postfix/ressources/databases/SQUID.version");
    if ($version != null) {
        $version = " v.{$version}";
    }
    if ($SquidCacheLevel == 0) {
        $nocache = " <span style='color:#d32d2d'>{no_cached_sites_warn}</span>";
    }
    $squi1_text = $tpl->javascript_parse_text("{monitor}");
    $squi1_onmouse = "OnMouseOver=\"javascript:AffBulle('{$squi1_text}');this.style.cursor='pointer'\" OnMouseOut=\"javascript:HideBulle();this.style.cursor='default'\"";
    $squi1_onClick = "OnClick=\"javascript:Loadjs('squid.task.monitor.php')\"";
    echo $tpl->_ENGINE_parse_body("\n<table  style='width:99%' >\n\t<tr>\n\t\t<td colspan=4 style='font-size:22px'>\n\t\t\t<a href=\"javascript:blur();\" \n\t\t\tOnClick=\"javascript:LoadAjax('BodyContent','squid.caches.status.php?tabs=yes')\" \n\t\t\tstyle='text-decoration:underline;color:{$color}'>{$proxy_status} {$status} {$version}</a>\n\t\t\t{$TITLE_RATE}{$TITLE_USERS}{$TITLE_REQUESTS}{$TITLE_COMPUTERS}\n\t\t\t<br>\n\t\t\t<div style='font-size:11px'><i>{$status2}{$nocache}{$Status_cache}</i></div>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t\t<td valign='top' width=25%>\n\t\t\t\t<div id='squid-1-{$t}' style='width:160px; height:100px' {$squi1_onmouse} {$squi1_onClick}></div>\n\t\t\t\n\t\t\t</td>\n\t\t\t<td valign='top' width=25%><div id='squid-2-{$t}' style='width:170px; height:100px'></div></td>\n\t\t\t<td valign='top' width=25%><div id='squid-3-{$t}' style='width:170px; height:100px'></div></td>\n\t\t\t<td valign='top' width=25%><div id='squid-4-{$t}' style='width:170px; height:100px'></div></td>\n\t</tr>\n\t\n</table>{$storages}\n\t\t\t\n" . "<div style='text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjaxTiny('squid-front-end-status','{$page}?squid-front-end-status=yes');") . "</div>\n<script>\nvar g = new JustGage({\n\tid: 'squid-1-{$t}',\n\tvalue: {$squid5mn["cpu_usage"]},\n\tmin: 0.1,\n\tmax: 100,\n\ttitle: 'Proxy CPU Usage',\n\tlabel: '%',\n\tlevelColorsGradient: true\n});\n\t\nvar g2 = new JustGage({\n\tid: 'squid-2-{$t}',\n\tvalue: {$squid5mn["client_http.requests"]},\n\tmin: 0.1,\n\tmax: {$HttpRequests},\n\ttitle: 'HTTP {$requests}/{$second}',\n\tlabel: 'RQ/s',\n\tlevelColorsGradient: true\n});\n\nvar g3 = new JustGage({\n\tid: 'squid-3-{$t}',\n\tvalue: {$squid5mn["server.all.kbytes_in"]},\n\tmin: 0,\n\tmax: {$server_all_kbytes_in},\n\ttitle: '{$server_all_kbytes_in_text}',\n\tlabel: 'KB',\n\tlevelColorsGradient: true\n\t});\nvar g4 = new JustGage({\n\tid: 'squid-4-{$t}',\n\tvalue: {$squid5mn["server.all.kbytes_out"]},\n\tmin: 0,\n\tmax: {$server_all_kbytes_out},\n\ttitle: '{$server_all_kbytes_out_text}',\n\tlabel: 'KB',\n\tlevelColorsGradient: true\n});\n" . @implode("\n", $js) . "\nif(document.getElementById('squid-rttrqs-status')){\n\tLoadAjaxSilent('squid-rttrqs-status','admin.index.loadavg.squidrtt.php');\n}\n\n\t</script>\n\t");
}
Example #4
0
function USER_ACCOUNT_POPUP($userid)
{
    $tpl = new templates();
    if ($userid == null) {
        writelogs("USER_ACCOUNT::Userid is null !! fatal error!!", __FUNCTION__, __FILE__, __LINE__);
        return false;
    }
    if (strlen($_GET["dn"]) > 0) {
        $userdn = base64_decode($_GET["dn"]);
    }
    $us = new user($userid, $userdn);
    if ($us->DoesNotExists) {
        return USER_NOTEXISTS($userid, $us->error . "<br>Func:USER_ACCOUNT_POPUP()");
    }
    $as_connected_user = false;
    if ($_GET["userid"] == $_SESSION["uid"]) {
        $as_connected_user = true;
    }
    include_once dirname(__FILE__) . '/ressources/class.obm.inc';
    writelogs("USER_ACCOUNT::{$_GET["userid"]}/{$userid}", __FUNCTION__, __FILE__, __LINE__);
    $ldap = new clladp();
    $usermenus = new usersMenus();
    $sock = new sockets();
    $SambaEnabled = $sock->GET_INFO("SambaEnabled");
    if (!is_numeric($SambaEnabled)) {
        $SambaEnabled = 1;
    }
    if ($SambaEnabled == 0) {
        $usermenus->SAMBA_INSTALLED = false;
    }
    $page = CurrentPageName();
    $styleTDRight = "style='padding:5px;font-size:11px'";
    $styleTDLeft = "style='padding:5px;font-size:11px'";
    $cellRol = CellRollOver();
    writelogs("USER_ACCOUNT::{$us->uid} checking OBM", __FUNCTION__, __FILE__, __LINE__);
    $obm = new obm_export_single($us->uid);
    if ($obm->CheckOBM()) {
        if ($obm->IsUserExists($us->uidNumber)) {
            $obm_info = "<p style='background-color:#FFFFFF;padding:3px;border:1px solid #CCCCCC;font-size:11px'>{user_is_an_obm_user}</p>";
        }
    }
    if ($usermenus->cyrus_imapd_installed == true) {
        $button_mailboxes = "<input type='button' value='{mailbox settings}&nbsp;&raquo;' OnClick=\"javascript:TreeUserMailBoxForm('{$userid}');\" style='margin-right:20px'>";
    }
    $priv = new usersMenus();
    $uidenc = urlencode($us->uid);
    $button = "<input type='button' value='{submit}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('userLdapform','{$page}',true,false,false,'userform',\n\t'domains.edit.user.php?userid={$uidenc}&ajaxmode=yes&section=account');\">";
    if ($usermenus->SIMPLE_GROUPEWARE_INSTALLED) {
        include_once "ressources/class.mysql.inc";
        $sql = new mysql();
        if ($sql->SIMPLE_GROUPWARE_ENABLED($userid)) {
            $SIMPLE_GROUPWARE_ENABLED = 1;
            $SIMPLE_GROUPWARE_TXT = "yes";
        } else {
            $SIMPLE_GROUPWARE_ENABLED = 0;
            $SIMPLE_GROUPWARE_TXT = "No";
        }
        $simple_groupware_activation_admin = "\n\t\t\t\t<tr {$cellRol}>\n\t\t\t\t\t<td align='right' nowrap class=legend {$styleTDRight}>{SimpleGroupWareActive}:</strong>\n\t\t\t\t\t<td {$styleTDLeft}>" . Field_numeric_checkbox_img('SimpleGroupWareActive', $SIMPLE_GROUPWARE_ENABLED) . "</td>\n\t\t\t\t</tr>\t";
        $simple_groupware_activation_user = "******";
    }
    if ($us->DisplayName == null) {
        $us->DisplayName = "unknown";
    }
    if ($usermenus->PUREFTP_INSTALLED or $usermenus->SAMBA_INSTALLED) {
        $HomeBinding = Paragraphe("64-hand-user.png", '{HomeBinding}', '{HomeBinding_text}', "javascript:Loadjs('home.binding.php?userid={$userid}')");
    }
    $HomeBinding_grey = Paragraphe("64-hand-user-grey.png", '{HomeBinding}', '{HomeBinding_text}');
    $EndOfLife = "\n\t<td width=1%><img src='img/folder-tasks-32.png'></td>\n\t<td style='padding:5px' {$cellRol}>" . texttooltip('{FinalDateToLive}', '{FinalDateToLive_text}', "UserEndOfLIfe('{$userid}')", null, 0, 'font-size:12px;font-weight:bold') . "</td>";
    $EndOfLife = Paragraphe("time-64.png", '{FinalDateToLive}', '{FinalDateToLive_text}', "javascript:UserEndOfLIfe('{$userid}')");
    $SystemInfoUser = "******" . texttooltip('{UserSystemInfos}', '{UserSystemInfos_text}', "UserSystemInfos('{$userid}')", null, 0, 'font-size:12px;font-weight:bold') . "</td>";
    $SystemInfoUser = Paragraphe("processor-64.png", '{UserSystemInfos}', '{UserSystemInfos_text}', "javascript:Loadjs('domains.edit.user.system.php?uid={$userid}')");
    $SystemInfoUser_disabled = Paragraphe("system-64.org-grey.png", '{UserSystemInfos}', '{UserSystemInfos_text}');
    $PRIVILEGES = Paragraphe('members-priv-64.png', '{privileges}', '{privileges_text}', "javascript:YahooWin(755,'domains.edit.group.php?GroupPriv=-2&userid={$userid}&start=yes','{privileges}')");
    $PRIVILEGES_DISABLED = Paragraphe('members-priv-64-grey.png', '{privileges}', '{privileges_text}', "");
    $ChangeGuid = "\n\t<td width=1%><img src='img/change-identifiant-32.png'></td>\n\t<td style='padding:5px' {$cellRol}>" . texttooltip('{change_uid}', '{change_uid_text}', "YahooWin3(650,'domains.edit.user.php?changeuid=yes&userid={$userid}','{$userid}:{change_uid}');", null, 0, 'font-size:12px;font-weight:bold') . "</td>";
    $ChangeGuid = Paragraphe("logon-profiles-64.png", '{change_uid}', '{change_uid_text}', "javascript:YahooWin3(650,'domains.edit.user.php?changeuid=yes&userid={$userid}','{$userid}:{change_uid}');");
    $ChangeGuid_disabled = Paragraphe("logon-profiles-64-grey.png", '{change_uid}', '{change_uid_text}');
    $joomla = "\n\t<td width=1%><img src='img/32-joomla.png'></td>\n\t<td style='padding:5px' {$cellRol}>" . texttooltip('{joomla_privileges}', '{joomla_privileges_text}', "Loadjs('users.joomla.php?userid={$userid}');", null, 210, 'font-size:12px;font-weight:bold') . "</td>";
    $joomla = Paragraphe("64.joomla.png", '{joomla_privileges}', '{joomla_privileges_text}', "javascript:Loadjs('users.joomla.php?userid={$userid}');", null, 210, 'font-size:12px;font-weight:bold');
    $usersinterface = Paragraphe("folder-interface-64.jpg", '{user_interface}', '{user_interface_text}', "Loadjs('users.tabs.php?uid={$userid}');", null, 210, 'font-size:12px;font-weight:bold');
    $button_backup = "\n\t<td width=1%><img src='img/32-backup.png'></td>\n\t<td style='padding:5px' {$cellRol}>" . texttooltip('{backup_parameters}', '{backup_parameters_text}', "Loadjs('domains.edit.user.backup.php?uid={$userid}');", null, 210, 'font-size:12px;font-weight:bold') . "</td>";
    $button_backup = Paragraphe("64-backup.png", '{backup_parameters}', '{backup_parameters_text}', "javascript:Loadjs('domains.edit.user.backup.php?uid={$userid}');", null, 210, 'font-size:12px;font-weight:bold');
    $button_webdav = Paragraphe("webdav-64.png", '{USER_WEBDAV}', '{USER_WEBDAV_TEXT}', "javascript:Loadjs('domains.edit.user.webdav.php?uid={$userid}');", null, 210, 'font-size:12px;font-weight:bold');
    $button_webdav_disabled = Paragraphe("webdav-64-grey.png", '{USER_WEBDAV}', '{USER_WEBDAV_TEXT}');
    $emule = Paragraphe("64-emule.png", '{MLDONKEY_USER}', '{MLDONKEY_USER_TEXT}', "javascript:Loadjs('domains.edit.user.mldonkey.php?uid={$userid}');", null, 210, 'font-size:12px;font-weight:bold');
    $delete = BuildParagraphe("delete_this_user", "delete_this_user_text", "Loadjs('domains.delete.user.php?uid={$userid}');", "32-cancel.png", true);
    $password = BuildParagraphe("change_password", "change_password_text", "ChangeUserPassword('{$userid}');", "32-key.png", true);
    $delete = Paragraphe("delete-64.png", '{delete}', '{delete_this_user}', "javascript:Loadjs('domains.delete.user.php?uid={$userid}');", null, 210, 'font-size:12px;font-weight:bold');
    $delete_disabled = Paragraphe("delete-64-grey.png", '{delete}', '{delete_this_user}');
    if (strlen($_GET["dn"]) > 0) {
        $deletedn = Paragraphe("delete-64.png", '{delete_this_user_dn}', '{delete_this_user_dn_text}', "javascript:Loadjs('domains.delete.userdn.php?uid={$userid}&dn={$_GET["dn"]}');", null, 210, 'font-size:12px;font-weight:bold');
    }
    $deletedn_disabled = Paragraphe("delete-64-grey.png", '{delete_this_user_dn}', '{delete_this_user_dn_text}');
    $password = Paragraphe("64-ssl-key.png", '{change_password}', '{change_password_text}', "javascript:YahooWin5('556','domains.edit.user.php?ChangeUserPassword=yes&uid={$userid}','{$userid}::{change_password}');", null, 210, 'font-size:12px;font-weight:bold');
    $password_disabled = Paragraphe("64-ssl-key-grey.png", '{change_password}', '{change_password_text}');
    $address = Paragraphe("64-addressbook.png", '{address}', '{address_user_text}', "javascript:Loadjs('contact.php?uidUser={$userid}')", null, 210, 'font-size:12px;font-weight:bold');
    $address_disabled = Paragraphe("64-addressbook-grey.png", '{address}', '{address_user_text}');
    if ($us->jpegPhotoError != null) {
        $imcontact = "unknown-user-64.png";
        $text = "{error_image_missing}<br>{$us->jpegPhotoError}";
    } else {
        $imcontact = $us->img_identity;
        $imcontact = str_replace("img/", "", $imcontact);
    }
    $picture = $picture;
    $mots = strlen($us->mail);
    $size_text = 14;
    if ($mots > 42) {
        $size_text = 12;
    }
    $email_address_hidden = "<strong style='font-size:{$size_text}px;font-family:Arial, Helvetica, sans-serif. '>{$us->mail}</strong>";
    $email_address = "<span style='font-size:12px;font-family:Arial, Helvetica, sans-serif'>{$us->mail}</span>";
    $quotaDisk = Paragraphe("rename-disk-64.png", '{disk_user_quota}', '{disk_user_quota_text}', "javascript:Loadjs('domains.edit.user.quota.php?uid={$userid}&ou={$us->ou}&userid={$userid}')", null, 210, 'font-size:12px;font-weight:bold');
    $quotaDisk_disabled = Paragraphe("rename-disk-64-grey.png", '{disk_user_quota}', '{disk_user_quota_text}');
    $changeuid = Paragraphe("64-folder-user.png", '{change_uid}', '{change_uid_text}', "javascript:YahooWin3(650,'domains.edit.user.php?changeuid=yes&userid={$userid}','{$userid}:{change_uid}');", null, 210, 'font-size:12px;font-weight:bold');
    $changeuid_disabled = Paragraphe("mysql-user-settings-grey.png", '{change_uid}', '{change_uid_text}');
    if (!$usermenus->POSTFIX_INSTALLED) {
        $recipients_translations = null;
        $domainName = null;
        $ChangeGuid = null;
        $email_address = Field_hidden('mail', "{$userid}@localhost") . Field_hidden('SenderCanonical', "{$us->SenderCanonical}");
        $AmavisSettings = null;
        $changeemail = null;
        $button_recipient_features = null;
        $sender_settings = $EndOfLife;
        $EndOfLife = null;
        $button_recipient_features = $button_backup;
        $button_backup = null;
    }
    if (!$usermenus->JOOMLA_INSTALLED) {
        $joomla = null;
    }
    if ($as_connected_user) {
        $emule = null;
        $delete = null;
        $button_webdav = null;
        $deletedn = null;
        $PRIVILEGES = $PRIVILEGES_DISABLED;
        if (!$priv->AllowSenderCanonical) {
            $sender_settings = null;
            $recipients_translations = null;
        }
        if (!$priv->AllowChangeUserPassword && !$priv->AllowAddUsers) {
            $password = null;
            $button = null;
        }
        if (!$priv->AllowAddUsers) {
            $SystemInfoUser = $SystemInfoUser_disabled;
            $delete = $delete_disabled;
            $ChangeGuid = $changeuid_disabled;
            $joomla = null;
            $button_backup = null;
            $changeemail = null;
            $changeuid = $changeuid_disabled;
            $emule = null;
            $button_webdav = $button_webdav_disabled;
            $deletedn = $deletedn_disabled;
            $quotaDisk = $quotaDisk_disabled;
        }
        $loginShell = $loginShell_hidden;
        $domainName = $domainName_hidden;
        $EndOfLife = $EndOfLife_hidden;
        $simple_groupware_activation_admin = $simple_groupware_activation_user;
        $HomeBinding = null;
    }
    if (!$usermenus->MLDONKEY_INSTALLED) {
        $emule = null;
    } else {
        $sock = new sockets();
        $EnableMLDonKey = trim($sock->GET_INFO("EnableMLDonKey"));
        if ($EnableMLDonKey == null) {
            $EnableMLDonKey = 1;
        }
        if ($EnableMLDonKey == 0) {
            $emule = null;
        }
    }
    if (!$priv->APACHE_MODE_WEBDAV) {
        $button_webdav = $button_webdav_disabled;
    }
    if (!$priv->QUOTA_INSTALLED) {
        $quotaDisk = $quotaDisk_disabled;
    }
    $moveorguser_grey = Paragraphe("user-move-64-grey.png", '{change_organization}', '{change_user_organization_text}', "");
    if ($priv->AsSystemAdministrator) {
        $moveorguser = Paragraphe("user-move-64.png", '{change_organization}', '{change_user_organization_text}', "javascript:Loadjs('domains.edit.user.moveorg.php?userid={$userid}')");
    }
    if ($us->AsActiveDirectoryMember) {
        $usermenus->EnableManageUsersTroughActiveDirectory = true;
    }
    if ($usermenus->EnableManageUsersTroughActiveDirectory) {
        $SystemInfoUser = $SystemInfoUser_disabled;
        $address = $address_disabled;
        $password = $password_disabled;
        $deletedn = $deletedn_disabled;
        $delete = $delete_disabled;
        $changeuid = $changeuid_disabled;
        $HomeBinding = $HomeBinding_grey;
        $moveorguser = $moveorguser_grey;
        $PRIVILEGES = $PRIVILEGES_DISABLED;
        $quotaDisk = $quotaDisk_disabled;
    }
    $tr[] = $PRIVILEGES;
    $tr[] = $SystemInfoUser;
    $tr[] = $loginShell;
    $tr[] = $domainName;
    $tr[] = $address;
    $tr[] = $HomeBinding;
    $tr[] = $delete;
    $tr[] = $deletedn;
    $tr[] = $password;
    $tr[] = $changeuid;
    $tr[] = $moveorguser;
    $tr[] = $EndOfLife;
    $tr[] = $button_webdav;
    $tr[] = $quotaDisk;
    $tr[] = $joomla;
    $tr[] = $simple_groupware_activation_admin;
    $tr[] = $button_backup;
    $tr[] = $emule;
    $tables_formatted = $tpl->_ENGINE_parse_body(CompileTr4($tr, true));
    $DisplayName = $us->DisplayName;
    if (strlen($DisplayName) > 27) {
        $DisplayName = texttooltip(substr($DisplayName, 0, 24), $DisplayName, null, 1) . "...";
    }
    if (strlen($us->jpegPhoto) > 0) {
        $array["img"] = $us->img_identity;
    } else {
        $array["img"] = "img/contact-unknown-user.png";
    }
    $array["mail"] = $us->mail;
    $array["phone"] = $us->telephoneNumber;
    $array["sn"] = $us->sn;
    $array["displayname"] = $us->DisplayName;
    $array["givenname"] = $us->givenName;
    $array["JS"] = "javascript:s_PopUp('edit.thumbnail.php?uid={$us->uid}',600,300)";
    $array["title"] = $us->title;
    $array["mobile"] = $us->mobile;
    $array["ou"] = $us->ou;
    $array["uid"] = $_GET["userid"];
    $array["uidNumber"] = $us->uidNumber;
    $useridentity = finduser_format($array, true);
    $userid = urlencode($userid);
    $html = "\n\t\t<input type='hidden' id='delete_this_user' value='{delete_this_user}'>\n\t\t<form name='userLdapform'>\n\t\t<input type='hidden' name='ou' value='{$us->ou}'>\n\t\t<input type='hidden' name='SaveLdapUser' value='yes'>\n\t\t<input type='hidden' name='dn' value='{$us->dn}'>\n\t\t<input type='hidden' name='uid' id='uid' value='{$us->uid}'>\n\t\t<table style='width:100%'>\n\t\t\t<tr>\n\t\t\t<td valign='top' style='vertical-align:top' style='vertical-align:top'>{$useridentity}</td>\n\t\t\t<td valign='top' style='vertical-align:top' style='vertical-align:top'><div id='userid-warning'></div></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<center>\n\t\t\n\t\t\t{$tables_formatted}\n\t\t</center>";
    $html = "\n\t<div style='width:100%'>\n\t{$obm_info}\n\t{$html}\n\t</div>\n\t<script>\n\t\t\n\t\tLoadAjax('userid-warning','{$page}?userid-warning=yes&userid={$userid}&dn={$_GET["dn"]}');\n\t</script>\n\t";
    writelogs("done", __FUNCTION__, __FILE__, __LINE__);
    return $tpl->_ENGINE_parse_body($html);
}
Example #5
0
function admin_system()
{
    $users = new usersMenus();
    $browse = Buildicon64("DEF_ICO_BROWSE_COMP");
    $disks = Paragraphe("64-hd.png", '{internal_hard_drives}', '{internal_hard_drives_text}', "javascript:Loadjs('system.internal.disks.php');", "{internal_hard_drives_text}");
    //$frontend_settings=Paragraphe("64-settings.png",'{design_and_tweaks}','{designs_and_tweaks_text}',"javascript:Loadjs('artica.performances.php?cron-js=yes');","{internal_hard_drives_text}");
    $memdump = Paragraphe("stats-64.png", '{processes_memory}', '{processes_memory_text}', "javascript:LoadMemDump();", "{processes_memory_text}");
    $artica_events = Paragraphe('events-64.png', '{artica_events}', '{artica_events_text}', "javascript:Loadjs('artica.events.php');", "{artica_events_text}");
    $phpldapadmin = Paragraphe('phpldap-admin-64.png', '{APP_PHPLDAPADMIN}', '{APP_PHPLDAPADMIN_TEXT}', "javascript:s_PopUpFull('ldap/index.php',1024,800);", "{APP_PHPLDAPADMIN_TEXT}");
    $phpmyadmin = Paragraphe('phpmyadmin-64.png', '{APP_PHPMYADMIN}', '{APP_PHPMYADMIN_TEXT}', "javascript:s_PopUpFull('mysql/index.php',1024,800);", "{APP_PHPMYADMIN_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}");
    $ActiveDirectoryConnection = Paragraphe('wink3_bg.png', '{APP_AD_CONNECT}', '{APP_AD_CONNECT_TEXT}', "javascript:Loadjs('ad.connect.php');", "{APP_AD_CONNECT_TEXT}");
    //phpmyadmin-64.png
    //
    $backup = Paragraphe('64-backup.png', '{manage_backups}', '{manage_backups_text}', "javascript:Loadjs('backup.tasks.php');", "{manage_backups_text}");
    $users = new usersMenus();
    if (!$users->phpldapadmin_installed) {
        $phpldapadmin = Paragraphe('phpldap-admin-64-grey.png', '{APP_PHPLDAPADMIN}', '{error_app_not_installed_disabled}', "", "{APP_PHPLDAPADMIN_TEXT}");
    }
    if (!$users->phpmyadmin_installed) {
        $phpmyadmin = Paragraphe('phpmyadmin-grey-64.png', '{APP_PHPMYADMIN}', '{error_app_not_installed_disabled}', "", "{APP_PHPMYADMIN_TEXT}");
    }
    if ($users->SQUID_INSTALLED) {
        $sock = new sockets();
        $SQUIDEnable = trim($sock->GET_INFO("SQUIDEnable"));
        if (!is_numeric($SQUIDEnable)) {
            $SQUIDEnable = 1;
        }
        if ($SQUIDEnable == 0) {
            $reactivate_squid = Paragraphe('warning64.png', '{SQUID_DISABLED}', '{SQUID_DISABLED_TEXT}', "javascript:Loadjs('squid.newbee.php?reactivate-squid=yes')", "{SQUID_DISABLED_TEXT}");
        }
    }
    if ($users->FROM_ISO) {
        $FROMISO = Paragraphe('64-CD.png', '{MENU_CONSOLE}', '{MENU_CONSOLE_TEXT}', "javascript:Loadjs('artica.iso.php')", "{MENU_CONSOLE_TEXT}");
    }
    $tpl = new templates();
    $massmailing = Paragraphe('mass-mailing-64.png', '{email_campaigns}', '{APP_MASSMAILING_ENABLE_TEXT}', "javascript:Loadjs('system.enable.massmailing.php');", "{APP_MASSMAILING_ENABLE_TEXT}");
    $mysql_settings = $tpl->_ENGINE_parse_body("{mysql_settings}");
    $web_interface_settings = Paragraphe("folder-performances-64.png", "{web_interface_settings}", "{web_interface_settings_text}", "javascript:Loadjs('artica.settings.php?js=yes&func-webinterface=yes');");
    $SMTP_NOTIFICATIONS_PAGE = Paragraphe("notifications-64.png", "{smtp_notifications}", "{smtp_notifications_text}", "javascript:Loadjs('artica.settings.php?js=yes&func-NotificationsInterface=yes');");
    $proxy = Paragraphe("proxy-64.png", "{http_proxy}", "{http_proxy_text}", "javascript:Loadjs('artica.settings.php?js=yes&func-ProxyInterface=yes');");
    $logs = Paragraphe("scan-64.png", "{logs_cleaning}", "{logs_cleaning_text}", "javascript:Loadjs('artica.settings.php?js=yes&func-LogsInterface=yes');");
    //$mysql=Paragraphe("folder-64-backup.png","{mysql_settings}","{mysql_settings_text}","javascript:MysqlInterface();","$mysql_settings");
    $perfs = Paragraphe("perfs-64.png", "{artica_performances}", "{artica_performances_text}", "javascript:Loadjs('artica.performances.php');");
    $tr[] = $web_interface_settings;
    $tr[] = $SMTP_NOTIFICATIONS_PAGE;
    $tr[] = $FROMISO;
    $tr[] = $memdump;
    $tr[] = $perfs;
    $tr[] = $artica_events;
    $tr[] = $logs;
    $tr[] = $disks;
    $tr[] = $browse;
    $tr[] = $backup;
    $tr[] = $reactivate_squid;
    $tr[] = $phpldapadmin;
    $tr[] = $phpmyadmin;
    $tr[] = $proxy;
    //$tr[]=$massmailing;
    $html = CompileTr4($tr);
    $results = $tpl->_ENGINE_parse_body($html);
    writelogs("SET CACHED " . strlen($results) . " bytes", __FILE__, __FUNCTION__, __LINE__);
    SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $results);
    echo $results;
}
Example #6
0
function services_status(){
	$page=CurrentPageName();
	$tpl=new templates();		
	$sock=new sockets();
	$users=new usersMenus();
	$timefile="/usr/share/artica-postfix/ressources/databases/ZARAFA_DB_STATUS.db";
	$ARRAY=unserialize(@file_get_contents($timefile));
	$ttr=array();
	if(isset($ARRAY["ZARAFA_INDEX"])){
		if($ARRAY["ZARAFA_INDEX"]>0){
			$ttr[]="<tr><td style='font-size:14px;height:42px'>{indexes_size}:</td><td style='font-size:14px;font-weight:bold'>". FormatBytes($ARRAY["ZARAFA_INDEX"]/1024)."</td></tr>";
		}
		
	}
	if(isset($ARRAY["ZARAFA_DB"])){
		if($ARRAY["ZARAFA_DB"]>0){
			$ttr[]="<tr><td style='font-size:14px;height:42px'>{database_size}:</td><td style='font-size:14px;font-weight:bold'>". FormatBytes($ARRAY["ZARAFA_DB"]/1024)."</td></tr>";
		}
	
	}	
	if(isset($ARRAY["ATTACHS"])){
		if($ARRAY["ATTACHS"]>0){
			$ttr[]="<tr><td style='font-size:14px;height:48px'>{attachments_path}:</td><td style='font-size:14px;font-weight:bold'>". FormatBytes($ARRAY["ATTACHS"]/1024)."</td></tr>";
		}
	
	}	
	
	if(count($ttr)>0){
		$tr[]=RoundedLightGreen("<table style='width:100%;background-color:#D5EED9;font-size:11px;line-height:auto' 
				class='TableRemove TableMarged'>".@implode("", $ttr)."</table>");
		
	}
	
	$array[]="APP_ZARAFA";
	$array[]="APP_ZARAFA_SERVER2";
	$array[]="APP_ZARAFA_DB";
	$array[]="APP_ZARAFA_GATEWAY";
	$array[]="APP_ZARAFA_SPOOLER";
	$array[]="APP_ZARAFA_WEB";
	$array[]="APP_ZARAFA_MONITOR";
	$array[]="APP_ZARAFA_DAGENT";
	$array[]="APP_ZARAFA_ICAL";
	if($users->ZARAFA_INDEXER_INSTALLED){
		$APP_ZARAFA_INDEXER=$sock->GET_INFO("EnableZarafaIndexer");
		if(!is_numeric($APP_ZARAFA_INDEXER)){$APP_ZARAFA_INDEXER=0;}		
		if($APP_ZARAFA_INDEXER==1){$array[]="APP_ZARAFA_INDEXER";}
		
	}
	$array[]="APP_ZARAFA_LICENSED";
	if($users->ZARAFA_SEARCH_INSTALLED){
		$APP_ZARAFA_SEARCH=$sock->GET_INFO("EnableZarafaSearch");
		if(!is_numeric($APP_ZARAFA_SEARCH)){$APP_ZARAFA_SEARCH=0;}
		if($APP_ZARAFA_SEARCH==1){$array[]="APP_ZARAFA_SEARCH";}
		
	}
	$array[]="APP_YAFFAS";

	
	$ini=new Bs_IniHandler();
	$datas=base64_decode($sock->getFrameWork('cmd.php?zarafa-status=yes'));
	$ini->loadString($datas);
	
	while (list ($num, $ligne) = each ($array) ){
		$tr[]=DAEMON_STATUS_ROUND($ligne,$ini,null,1);
		
	}
	
	
	
	
$tables[]="<div style='width:98%' class=form>";	
if(isset($_GET["miniadm"])){
	$tables[]=CompileTr4($tr,true);
	$et="&miniadm=yes";
	
}else{
	$tables[]=CompileTr3($tr,true);
}
$tables[]="
<div style='width:100%;text-align:right'>". 
imgtootltip("32-refresh.png","{refresh}","LoadAjax('zarafa-services-status','$page?services-status=yes$et');")."</div>";


$html=implode("\n",$tables);	
echo $tpl->_ENGINE_parse_body($html);		

	
	
}
function services_status()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $ini = new Bs_IniHandler();
    $ini2 = new Bs_IniHandler();
    $tpl = new templates();
    $users = new usersMenus();
    $html = null;
    $ini->loadString(base64_decode($sock->getFrameWork('cmd.php?squid-ini-status=yes')));
    $ini2->loadString(base64_decode($sock->getFrameWork('cmd.php?cicap-ini-status=yes')));
    $DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
    $SquidActHasReverse = $sock->GET_INFO("SquidActHasReverse");
    $AsSquidLoadBalancer = $sock->GET_INFO("AsSquidLoadBalancer");
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    $EnableKerbAuth = $sock->GET_INFO("EnableKerbAuth");
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    $SquidBoosterMem = $sock->GET_INFO("SquidBoosterMem");
    if (!is_numeric($EnableKerbAuth)) {
        $EnableKerbAuth = 0;
    }
    if (!is_numeric($SquidBoosterMem)) {
        $SquidBoosterMem = 0;
    }
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    if (!is_numeric($SquidActHasReverse)) {
        $SquidActHasReverse = 0;
    }
    if (!is_numeric($AsSquidLoadBalancer)) {
        $AsSquidLoadBalancer = 0;
    }
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    $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", $ini2, 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);
    $APP_FRESHCLAM = DAEMON_STATUS_ROUND("APP_FRESHCLAM", $ini, null, 1);
    $APP_ARTICADB = DAEMON_STATUS_ROUND("APP_ARTICADB", $ini, null, 1);
    if ($users->PROXYTINY_APPLIANCE) {
        $APP_ARTICADB = null;
    }
    if ($EnableRemoteStatisticsAppliance == 1) {
        $APP_ARTICADB = null;
    }
    $squid = new squidbee();
    if ($EnableKerbAuth == 1) {
        $APP_SAMBA_WINBIND = DAEMON_STATUS_ROUND("SAMBA_WINBIND", $ini, null, 1);
    }
    $md = md5(date('Ymhis'));
    if ($_SESSION["uid"] != null) {
        if (!$users->WEBSTATS_APPLIANCE) {
            $swappiness = intval($sock->getFrameWork("cmd.php?sysctl-value=yes&key=" . base64_encode("vm.swappiness")));
            $sock = new sockets();
            $swappiness_saved = unserialize(base64_decode($sock->GET_INFO("kernel_values")));
            if (!is_numeric($swappiness_saved["swappiness"])) {
                if ($swappiness > 30) {
                    $tr[] = DAEMON_STATUS_ROUND_TEXT("warning-panneau-42.png", "{high_swap_value}", "{high_swap_value_text}", "Loadjs('squid.perfs.php')");
                }
            }
            if ($AsSquidLoadBalancer == 1) {
                $SquidAsSeenDNS = 1;
            }
            if ($SquidActHasReverse == 1) {
                $SquidAsSeenDNS = 1;
            }
            $SquidAsSeenDNS = $sock->GET_INFO("SquidAsSeenDNS");
            if (!is_numeric($SquidAsSeenDNS)) {
                $SquidAsSeenDNS = 0;
            }
            if (count($squid->dns_array) == 0) {
                if ($SquidAsSeenDNS == 0) {
                    $tr[] = DAEMON_STATUS_ROUND_TEXT("warning-panneau-42.png", "{add_dns_in_config}", "{add_dns_in_config_perf_explain}", "Loadjs('squid.popups.php?script=dns')");
                }
            }
        }
    }
    $CicapEnabled = 0;
    if ($users->C_ICAP_INSTALLED) {
        $CicapEnabled = $sock->GET_INFO("CicapEnabled");
        if (!is_numeric($CicapEnabled)) {
            $CicapEnabled = 0;
        }
    }
    $squid_status = null;
    $ini = new Bs_IniHandler();
    $ini->loadString(base64_decode($sock->getFrameWork('squid.php?smp-status=yes')));
    while (list($index, $line) = each($ini->_params)) {
        if ($GLOBALS["VERBOSE"]) {
            echo __FUNCTION__ . "::" . __LINE__ . "::{$index} -> DAEMON_STATUS_ROUND<br>\n";
        }
        $tr[] = DAEMON_STATUS_ROUND($index, $ini, null, 1);
    }
    if ($SquidBoosterMem > 0) {
        if ($DisableAnyCache == 0) {
            $tr[] = squid_booster_smp();
        }
    }
    $tr[] = $squid_status;
    $tr[] = $APP_SAMBA_WINBIND;
    $tr[] = $dansguardian_status;
    $tr[] = $kav;
    $tr[] = $cicap;
    $tr[] = $APP_PROXY_PAC;
    $tr[] = $APP_SQUIDGUARD_HTTP;
    $tr[] = $APP_UFDBGUARD;
    $tr[] = $APP_FRESHCLAM;
    $tr[] = $APP_ARTICADB;
    $html = $tpl->_ENGINE_parse_body(CompileTr4($tr, true, null, true));
    $html = "\n\t\t\t\n\t<div style='float:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('services-status','{$page}?services-status-table=yes');") . "</div>\n\t<center ><div style='width:100%;margin:10px'>{$html}</div></center>";
    echo $html;
}
function section_architecture_content(){
	
	if(GET_CACHED(__FILE__, __FUNCTION__,__FUNCTION__)){return;}
	
$page=CurrentPageName();
$sock=new sockets();
$users=new usersMenus();
$squid=new squidbee();
	$compilefile="ressources/logs/squid.compilation.params";
	if(!is_file($compilefile)){$sock->getFrameWork("squid.php?compil-params=yes");}
	$COMPILATION_PARAMS=unserialize(base64_decode(file_get_contents($compilefile)));
	$SquidActHasReverse=$sock->GET_INFO("SquidActHasReverse");
	if(!is_numeric($SquidActHasReverse)){$SquidActHasReverse=0;}
	if($users->SQUID_REVERSE_APPLIANCE){$SquidActHasReverse=1;}
	if($squid->isNGnx()){$SquidActHasReverse=0;}
	
	$listen_port=Paragraphe('folder-network-64.png','{listen_port}','{listen_port_text}',"javascript:Loadjs('squid.popups.php?script=listen_port')");
	$listen_addr=Paragraphe('folder-network-64.png','{listen_address}','{squid_listen_text}',"javascript:Loadjs('squid.nic.php')");
	$visible_hostname=Paragraphe('64-work-station-linux.png','{visible_hostname}','{visible_hostname_intro}',"javascript:Loadjs('squid.popups.php?script=visible_hostname')");
	//$transparent_mode=Paragraphe('relayhost.png','{transparent_mode}','{transparent_mode_text}',"javascript:Loadjs('squid.newbee.php?squid-transparent-js=yes')");
	$your_network=Paragraphe('folder-realyrules-64.png','{your_network}','{your_network_text}',"javascript:Loadjs('squid.popups.php?script=network')");
    $stat_appliance=Paragraphe("64-dansguardian-stats.png","{STATISTICS_APPLIANCE}","{STATISTICS_APPLIANCE_TEXT}","javascript:Loadjs('squid.stats-appliance.php')");
	//$sslbump=Paragraphe('web-ssl-64.png','{squid_sslbump}','{squid_sslbump_text}',"javascript:Loadjs('squid.sslbump.php')");
	$watchdog=Paragraphe('service-check-64-grey.png','{squid_watchdog}','{squid_watchdog_text}',"");
	
	$syslogRemote=Paragraphe('syslog-64-client.png','{remote_statistics_server}','{remote_statistics_server_text}',"javascript:Loadjs('squid.remotestats.php')");
	
	
	$log_location=Paragraphe('syslog-64-client.png','{log_location}','{log_location_text}',
			"javascript:Loadjs('squid.varlog.php')");
	
	
	
	$ftp_user=Paragraphe('ftp-user-64.png','{squid_ftp_user}','{squid_ftp_user_text}',"javascript:Loadjs('squid.ftp.user.php')");
	$messengers=Paragraphe('messengers-64.png','{instant_messengers}','{squid_instant_messengers_text}',"javascript:Loadjs('squid.messengers.php')");	
		
	$enable_squid_service=Paragraphe('shutdown-green-64.png','{enable_squid_service}','{enable_squid_service_text}',"javascript:Loadjs('squid.newbee.php?js_enable_disable_squid=yes')");
    
    if(!isset($COMPILATION_PARAMS["enable-ssl"])){
    	$sslbump=Paragraphe('web-ssl-64-grey.png','{squid_sslbump}','{squid_sslbump_text}',"");
    }
    
    if($users->MONIT_INSTALLED){
    	$watchdog=Paragraphe('service-check-64.png','{squid_watchdog}','{squid_watchdog_text}',"javascript:Loadjs('squid.watchdog.php')");
 	}
 	
 	$booster=Paragraphe('perfs-64.png','{squid_booster}','{squid_booster_text}',
 			"javascript:Loadjs('squid.booster.php')");
 	
	$googlenossl=Paragraphe('google-64.png','{disable_google_ssl}','{disable_google_ssl_text}',
			"javascript:Loadjs('squid.google.ssl.php')");
 	
	if($SquidActHasReverse==1){
		$googlenossl=null;
		$messengers=null;
		$sslbump=null;
		$transparent_mode=null;
	}
	
	$sock=new sockets();
	$users=new usersMenus();
	$squid=new squidbee();
	$SquidActHasReverse=$sock->GET_INFO("SquidActHasReverse");
	if(!is_numeric($SquidActHasReverse)){$SquidActHasReverse=0;}
	
	$squid_reverse_proxy=Paragraphe('squid-reverse-64.png','{squid_reverse_proxy}','{squid_reverse_proxy_text}',"javascript:Loadjs('squid.reverse.proxy.php')");
	$squid_advanced_parameters=Paragraphe('64-settings.png','{squid_advanced_parameters}','{squid_advanced_parameters_text}',"javascript:Loadjs('squid.advParameters.php')");
	$squid_conf=Paragraphe('script-view-64.png','{configuration_file}','{display_generated_configuration_file}',"javascript:Loadjs('squid.conf.php')");
	$performances_tuning=Paragraphe('performance-tuning-64.png','{tune_squid_performances}','{tune_squid_performances_text}',"javascript:Loadjs('squid.perfs.php')");
	$denywebistes=Paragraphe("folder-64-denywebistes.png","{deny_websites}","{deny_websites_text}","javascript:Loadjs('squid.popups.php?script=url_regex');");
	
	$AsSquidLoadBalancerIcon=Paragraphe("load-blancing-64.png","{load_balancer}","{squid_load_balancer_text}",
			"javascript:Loadjs('squid.loadblancer.php');");
	$AsSquidLoadBalancer=$sock->GET_INFO("AsSquidLoadBalancer");
	if(!is_numeric($AsSquidLoadBalancer)){$AsSquidLoadBalancer=0;}
	
	
	$squid=new squidbee();
	if($squid->isNGnx()){
		$users->SQUID_REVERSE_APPLIANCE=false;
		$squid_reverse_proxy=null;
		$SquidActHasReverse=0;
	
	}
	
	if($users->SQUID_REVERSE_APPLIANCE){$squid_reverse_proxy=null;$SquidActHasReverse=1;}
	
	
	
	if($SquidActHasReverse==1){
		$AsSquidLoadBalancer=0;
		$squid_accl_websites=Paragraphe('website-64.png','{squid_accel_websites}','{squid_accel_websites_text}',"javascript:Loadjs('squid.reverse.websites.php')");
	}
	
	$redirectors_options=Paragraphe('redirector-64.png','{squid_redirectors}','{squid_redirectors_text}',
			"javascript:Loadjs('squid.redirectors.php')");
	
	
	$memory_option=Paragraphe('bg_memory-64.png','{cache_mem}','{cache_mem_text}',
			"javascript:Loadjs('squid.cache_mem.php')");
	
	
	$dns_servers=Paragraphe('dns-64.png','{dns_servers}','{dns_servers_text}',"javascript:Loadjs('squid.popups.php?script=dns')");
	
	$syslog=Paragraphe("syslog-64.png", "Syslog", "{squid_syslog_text}","javascript:Loadjs('squid.syslog.php')");
	$syslogMAC=Paragraphe("syslog-64.png", "{ComputerMacAddress}", "{squid_ComputerMacAddress_text}","javascript:Loadjs('squid.macaddr.php')");
	
	$sarg=Paragraphe('sarg-logo.png','{APP_SARG}','{APP_SARG_TXT}',"javascript:Loadjs('sarg.php')","{APP_SARG_TXT}");
	
	$disable_stats=Paragraphe('statistics-64.png','{ARTICA_STATISTICS}','{ARTICA_STATISTICS_TEXT}',
			"javascript:Loadjs('squid.artica.statistics.php')","{ARTICA_STATISTICS_TEXT}");
	
	$anonym=Paragraphe("hide-64.png", "{anonymous_browsing}", "{anonymous_browsing_explain}","javascript:Loadjs('squid.anonymous.php')");
	
	$csvstats=Paragraphe("csv-64.png", "{squid_csv_logs}", "{squid_csv_logs_explain}","javascript:Loadjs('squid.csv.php')");
	
	$file_descriptors=Paragraphe("64-filetype.png", "{file_descriptors}", "{file_descriptors_squid_explain}",
			"javascript:Loadjs('squid.file_desc.php')");
	 
	$snmp=Paragraphe("64-snmp.png", "SNMP", "{squid_snmp_explain}",
			"javascript:Loadjs('squid.snmp.php')");
	
	
	$forwarded_for=Paragraphe("icon-html-64.png", "x-Forwarded-For", "{x-Forwarded-For_explain}",
			"javascript:Loadjs('squid.forwarded_for.php')");
	

	
	
	$CacheManagement2=Paragraphe("web-site.png", "{CacheManagement2}", "{CacheManagement2_explain}",
			"javascript:Loadjs('squid.caches.ManagementChoose.php')");
	
	
	
	if($users->PROXYTINY_APPLIANCE){$disable_stats=null;}
	$denywebistes=null;
	if($SquidActHasReverse==1){
		 
		$squid_parent_proxy=null;
		$redirectors_options=null;
		$loadbalancing=null;
		$AsSquidLoadBalancer=null;
	}
	
	if($AsSquidLoadBalancer==1){
		$loadbalancing=null;
		$anonym=null;
		$redirectors_options=null;
		$squid_reverse_proxy=null;
		$squid_parent_proxy=null;
	}
	
	if($users->SQUID_REVERSE_APPLIANCE){
		$squid_accl_websites=null;
	}
	
	
	
	
	$tr[]=$your_network;
	$tr[]=$squid_conf;
	$tr[]=$squid_advanced_parameters;
	$tr[]=$visible_hostname;
	$tr[]=$log_location;
	$tr[]=$syslog;
	$tr[]=$syslogMAC;
	
	
	$tr[]=$booster;
	$tr[]=$stat_appliance;
	$tr[]=$ftp_user;
	$tr[]=$messengers;
	$tr[]=$sslbump;
	$tr[]=$googlenossl;
	$tr[]=$enable_squid_service;
	
	$tr[]=$file_descriptors;
	$tr[]=$timeouts;
	$tr[]=$forwarded_for;
	//$tr[]=$dns_servers;
	$tr[]=$performances_tuning;
	$tr[]=$AsSquidLoadBalancerIcon;
	$tr[]=$loadbalancing;
	$tr[]=$redirectors_options;
	$tr[]=$denywebistes;
	$tr[]=$anonym;

	$tr[]=$snmp;
	$tr[]=$disable_stats;
	$tr[]=$csvstats;
	$tr[]=$squid_parent_proxy;
	$tr[]=$squid_reverse_proxy;
	$tr[]=$squid_accl_websites;
	$tr[]=$CacheManagement2;
	


	

	$html=CompileTr4($tr);
	
	
	
$tpl=new templates();
$html="<div id='architecture-status'></div>
$html
<script>
	LoadAjaxTiny('architecture-status','$page?architecture-status=yes');
	QuickLinkShow('quicklinks-proxy_parameters');
</script>";

$html=$tpl->_ENGINE_parse_body($html,'squid.index.php');
SET_CACHED(__FILE__,__FUNCTION__,__FUNCTION__,$html);
echo $html;	
	
}
Example #9
0
function groupwares_index()
{
    $h = new vhosts();
    $hash = $h->listOfAvailableServices(true);
    $sql = "SELECT groupware FROM freeweb WHERE servername='{$_GET["servername"]}'";
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql();
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    if ($ligne["groupware"] != null) {
        echo $tpl->_ENGINE_parse_body("\n\t\t<div style='width:98%' class=form>\n\t\t<table>\n\t\t<tr>\n\t\t\t<td width=1% valign='top'><img src='img/{$h->IMG_ARRAY_64[$ligne["groupware"]]}'></td>\n\t\t\t<td valign='top' width=99%>\n\t\t\t\t<div style='font-size:16px'>{current}:&nbsp;<strong>&laquo;&nbsp;{$hash[$ligne["groupware"]]}&nbsp;&raquo;</strong><hr>\n\t\t\t\t\t<i style='font-size:13px'>{{$h->TEXT_ARRAY[$ligne["groupware"]]["TEXT"]}}</i>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table></div>");
        return;
    }
    $page = CurrentPageName();
    while (list($key, $title) = each($hash)) {
        if ($h->IMG_ARRAY_64[$key] == null) {
            continue;
        }
        $js = "javascript:FreeWebToGroupWare('{$key}');";
        $tr[] = $tpl->_ENGINE_parse_body(Paragraphe($h->IMG_ARRAY_64[$key], $title, "{{$h->TEXT_ARRAY[$key]["TEXT"]}}", $js));
    }
    $final = CompileTr4($tr);
    $groupware_text = $tpl->_ENGINE_parse_body($groupware_text);
    $freeweb_groupware_explain = $tpl->_ENGINE_parse_body("{freeweb_groupware_explain}");
    $html = "\n<div class=explain style='font-size:18px'>{$freeweb_groupware_explain}</div>\n{$groupware_text}\n<center>\n{$final}\n</center>\n<script>\n\t\tvar x_FreeWebToGroupWare=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);return;}\n\t\t\t\$('#freewebs-table-{$_GET["t"]}').flexReload();\t\n\t\t\tRefreshTab('main_config_freewebedit');\n\t\t\tExecuteByClassName('SearchFunction');\n\t\t}\n\t\n\t\n\t\tfunction FreeWebToGroupWare(key){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('FreeWebToGroupWare',key);\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n    \t\tXHR.sendAndLoad('{$page}', 'POST',x_FreeWebToGroupWare);\n\t\t}\n</script>\n\n\n";
    echo $html;
}
Example #10
0
$tr[] = $artica_stats;
$tr[] = $banner;
$tr[] = $mime;
$tr[] = $RemoteSyslog;
$tr[] = $HaProxy;
$tr[] = $mailman;
$tr[] = $mailbox_cmd;
$tr[] = $mastercf;
$tr[] = $maincf;
$tr[] = $maincfedit;
$tr[] = $performances;
$tr[] = $varspool;
$tr[] = $other;
$tr[] = $removePostfix;
$tr = Transport_rules($tr);
$icons = CompileTr4($tr);
$html = "<center><div style='width:80%'>{$icons}</div></center>";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($icons);
function Transport_rules($tr)
{
    //$datas=GET_CACHED(__FILE__,__FUNCTION__,null,TRUE);
    //if($datas<>null){return $datas;}
    $sock = new sockets();
    $page = CurrentPageName();
    $users = new usersMenus();
    $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
    $EnableArticaSMTPFilter = $sock->GET_INFO("EnableArticaSMTPFilter");
    $EnableArticaSMTPFilter = 0;
    $failedtext = "{ERROR_NO_PRIVILEGES_OR_PLUGIN_DISABLED}";
    $network = Buildicon64('DEF_ICO_POSTFIX_NETWORK');
function search_websites()
{
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $query = url_decode_special_tool(trim($_GET["pattern"]));
    $query = str_replace("*", "%", $query);
    $sql = "SELECT SUM(size) as size, SUM(hits) as hits, familysite\n\tFROM visited_sites_days GROUP BY familysite HAVING familysite LIKE '{$query}' ORDER BY size DESC LIMIT 0,20";
    $results = $q->QUERY_SQL($sql);
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $site = $ligne["familysite"];
        $size = FormatBytes($ligne["size"] / 1024);
        if (strlen($site) > 27) {
            $site = substr($site, 0, 27) . "...";
        }
        $text = $tpl->_ENGINE_parse_body("<div style='margin-top:10px;font-size:14px'><strong>{size}:{$size}<br>" . FormatNumber($ligne["hits"]) . " {hits}</div>");
        $len = strlen($site);
        $js = "Loadjs('squid.website-zoom.php?&sitename=" . urlencode($site) . "&js=yes')";
        $f[] = Paragraphe32("noacco:{$site}", $text, $js, "website-32.png");
    }
    if (count($f) > 0) {
        echo $tpl->_ENGINE_parse_body(CompileTr4($f));
    }
}
function filters()
{
    $_GET["ou"] = $_SESSION["ou"];
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $tpl = new templates();
    $sock = new sockets();
    $page = CurrentPageName();
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $ou_encoded = base64_encode($_GET["ou"]);
    $KasxFilterEnabled = $sock->GET_INFO("KasxFilterEnabled");
    $kavmilterEnable = $sock->GET_INFO("kavmilterEnable");
    $EnableArticaSMTPFilter = $sock->GET_INFO("EnableArticaSMTPFilter");
    $EnableArticaSMTPFilter = 0;
    $EnableDKFilter = $sock->GET_INFO("EnableDKFilter");
    $EnableDkimMilter = $sock->GET_INFO("EnableDkimMilter");
    $EnableCluebringer = $sock->GET_INFO("EnableCluebringer");
    $users = new usersMenus();
    $sock = new sockets();
    if ($users->kas_installed) {
        if ($KasxFilterEnabled == 1) {
            $array["APP_KAS3"] = $array_filters["APP_KAS3"];
        }
    }
    if ($users->KAV_MILTER_INSTALLED) {
        if ($kavmilterEnable == 1) {
            $array["APP_KAVMILTER"] = $array_filters["APP_KAVMILTER"];
        }
    }
    if ($users->MILTERGREYLIST_INSTALLED) {
        $array["APP_MILTERGREYLIST"] = $array_filters["APP_MILTERGREYLIST"];
    }
    if ($users->AMAVIS_INSTALLED) {
        $array["APP_AMAVIS"] = $array_filters["APP_AMAVIS"];
    }
    if ($users->OPENDKIM_INSTALLED) {
        if ($EnableDKFilter == 1) {
            $array["APP_OPENDKIM"] = $array_filters["APP_OPENDKIM"];
        }
    }
    if ($users->MILTER_DKIM_INSTALLED) {
        if ($EnableDkimMilter == 1) {
            $array["APP_MILTER_DKIM"] = $array_filters["APP_MILTER_DKIM"];
        }
    }
    if ($users->CLUEBRINGER_INSTALLED) {
        if ($EnableCluebringer == 1) {
            $array["APP_CLUEBRINGER"] = $array_filters["APP_CLUEBRINGER"];
        }
    }
    if ($EnableArticaSMTPFilter == 1) {
        $array["APP_ARTICA_FILTER"] = $array_filters["APP_ARTICA_FILTER"];
    }
    $array["APP_POSTFWD2"] = $array_filters["APP_POSTFWD2"];
    if ($array["APP_KAS3"] == 1) {
        $tr[] = Paragraphe("folder-caterpillar-64.png", "{as_plugin}", "{kaspersky_anti_spam_text}", "javascript:Loadjs('domains.edit.kas.php?ou={$ou_encoded}')");
    }
    if ($array["APP_KAVMILTER"] == 1) {
        $tr[] = Paragraphe("icon-antivirus-64.png", "{antivirus}", "{antivirus_text}", "javascript:Loadjs('domains.edit.kavmilter.ou.php?ou={$ou_encoded}')");
    }
    if ($array["APP_MILTERGREYLIST"] == 1) {
        $tr[] = Paragraphe("64-milter-greylist.png", "{APP_MILTERGREYLIST}", "{APP_MILTERGREYLIST_TEXT}", "javascript:Loadjs('domains.postfix.multi.milter-greylist.php?ou={$ou_encoded}&hostname={$_GET["hostname"]}')");
    }
    if ($array["APP_AMAVIS"] == 1) {
        $tr[] = Paragraphe("64-amavis.png", "{APP_AMAVISD_NEW}", "{APP_AMAVISD_NEW_ICON_TEXT}", "javascript:Loadjs('domains.postfix.multi.amavis.php?ou={$ou_encoded}&hostname={$_GET["hostname"]}')");
    }
    if ($array["APP_POSTFWD2"] == 1) {
        $tr[] = Paragraphe("Firewall-Secure-64.png", "{APP_POSTFWD2}", "{APP_POSTFWD2_TEXT}", "javascript:Loadjs('postfwd2.php?ou={$ou_encoded}&instance={$_GET["hostname"]}&byou=yes')");
    } else {
        $tr[] = Paragraphe("Firewall-Secure-64-grey.png", "{APP_POSTFWD2}", "{APP_POSTFWD2_TEXT}", "javascript:Loadjs('postfwd2.php?ou={$ou_encoded}&instance={$_GET["hostname"]}&byou=yes')");
    }
    $tr[] = Paragraphe("bg_forbiden-attachmt-64.png", "{attachment_blocking}", "{attachment_blocking_text}", "javascript:Loadjs('domains.edit.attachblocking.ou.php?ou={$ou_encoded}&hostname={$_GET["hostname"]}')");
    $html = CompileTr4($tr);
    $html = $tpl->_ENGINE_parse_body($html);
    echo $html;
    SET_CACHED(__FILE__, __FUNCTION__, "{$_GET["hostname"]}&ou={$_GET["ou"]}", $html);
}
Example #13
0
function popup(){
	$page=CurrentPageName();
	$tpl=new templates();
	$sock=new sockets();
	$ldap=new clladp();
	
	$WizardSavedSettings=unserialize(base64_decode($sock->GET_INFO("WizardSavedSettings")));
	$LicenseInfos=unserialize(base64_decode($sock->GET_INFO("LicenseInfos")));
	$WizardSavedSettings=unserialize(base64_decode($sock->GET_INFO("WizardSavedSettings")));
	$smtp_domainname=$WizardSavedSettings["smtp_domainname"];
	$telephone=$WizardSavedSettings["telephone"];
	if($LicenseInfos["COMPANY"]==null){$LicenseInfos["COMPANY"]=$WizardSavedSettings["company_name"];}
	if($LicenseInfos["EMAIL"]==null){$LicenseInfos["EMAIL"]=$WizardSavedSettings["mail"];}
	if(!is_numeric($LicenseInfos["EMPLOYEES"])){$LicenseInfos["EMPLOYEES"]=$WizardSavedSettings["employees"];}

	$ldap=new clladp();
	$password=md5($ldap->ldap_password);
	
	
	$UtDNSArticaUser=json_decode(base64_decode($sock->GET_INFO("UtDNSArticaUser")));
	if($UtDNSArticaUser->success){
		$uri[]="https://myaccount.unveiltech.com/autologin.php";
		$uri[]="?email={$LicenseInfos["EMAIL"]}&pwd=$password";
		$uri[]="&goto=https://utdns.unveiltech.com/dashboard.php?hash=$UtDNSArticaUser->hash";
		$urie=@implode("", $uri);
		$t[]=Paragraphe("panel-64.png", "{cloud_panel}", "{cloud_panel_explain}","javascript:s_PopUpFull('$urie',1024,1024)");
		$t[]=Paragraphe("shutdown-green-64.png", "{enable_disable_cloud_protection}", 
				"{enable_disable_cloud_protection_explain}","javascript:Loadjs('$page?enable-js=yes');");
	}else{
		
		$bas="
		<div class=text-info style='font-size:16px'>
			{WebFilter_SaaS_AS_EVAL}
		</div>
		<center style='margin:30px'>
					". button("{start_30daybt}","Loadjs('$page?30-days=yes')",34)."</center>
				
		";
		
	}
	
	
	
	
	if(count($t)>0){
		$bas=CompileTr4($t);
		
	}

	$html="<div class=text-info style='font-size:16px'>{WebFilter_SaaS_Explain}</div>$bas";
	
	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('UpdateUtilityWizardDiv','{$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 = CompileTr4($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}");
}
Example #15
0
function tools()
{
    //if(isset($_SESSION[__FILE__][__FUNCTION__])){echo $_SESSION[__FILE__][__FUNCTION__];return;}
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $users = new usersMenus();
    $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('enable_disable_statistics', 'ARTICA_STATISTICS_TEXT', "Loadjs('squid.artica.statistics.php',true)", "statistics-32.png");
    $html = "\n\t\t<div class=BodyContent>" . CompileTr4($tr) . "</div>\n\t\t\t\n\t";
    $html = $tpl->_ENGINE_parse_body($html);
    $_SESSION[__FILE__][__FUNCTION__] = $html;
    echo $html;
}
Example #16
0
function tools()
{
    $xtime = $_GET["xtime"];
    $tpl = new templates();
    $tr[] = Paragraphe("table-synonyms-settings-64.png", "{members_table}", "{squidstats_gen_members_table}", "javascript:Loadjs('miniadm.webstats.tools.php?members-table-js={$xtime}')");
    $tr[] = Paragraphe("64-categories-loupe.png", "{categorize_websites}", "{squidstats_gen_categorize_table}", "javascript:Loadjs('miniadm.webstats.tools.php?categorize-day-table-js={$xtime}')");
    $tr[] = Paragraphe("reconstruct-database-64.png", "{update_counters}", "{update_counters_table}", "javascript:Loadjs('miniadm.webstats.tools.php?sumary-counters-table-js={$xtime}')");
    $html = CompileTr4($tr);
    echo $tpl->_ENGINE_parse_body($html);
}