Example #1
0
function status()
{
    $sock = new sockets();
    $datas = explode("\n", $sock->getfile('?psprocesses'));
    while (list($num, $ligne) = each($datas)) {
        if (preg_match('#([0-9]+)\\s+([0-9]+)\\s+([a-zA-Z\\-\\.0-9]+)#', $ligne, $regs)) {
            $proc = $regs[3];
            $mem1 = $regs[1] + $regs[2];
            $follow_arr[$proc]["MEM"] = $follow_arr[$proc]["MEM"] + $mem1;
            $follow_arr[$proc]["PROC"] = $follow_arr[$proc]["PROC"] + 1;
        }
    }
    if (!is_array($follow_arr)) {
        $tpl = new templates('{global_services_status}', '{error_no_socks}');
        echo $tpl->web_page;
        exit;
    }
    $html = "<h2>{services_status}</h2>\n\t<table >\n\t<tr class=rowA>\n\t<td><strong>{service_name}</td>\n\t<td><strong>{global_memory}</td>\n\t<td><strong>{process_number}</td>\n\t</tr>";
    while (list($num, $ligne) = each($follow_arr)) {
        if (array_stats($num)) {
            if ($class == 'rowA') {
                $class = 'rowB';
            } else {
                $class = "rowA";
            }
            $mem = round($ligne["MEM"] / 1024);
            $html = $html . "\n\t<tr class={$class}>\n\t<td>{$num}</td>\n\t<td>{$mem} mb</td>\n\t<td>{$ligne["PROC"]}</td>\n\t</tr>";
        }
    }
    $html = $html . "</table>";
    $tpl = new templates('{global_services_status}', $html);
    echo $tpl->web_page;
}
function KavUpdates()
{
    $sock = new sockets();
    $sock->getfile('aveserver_perform_udpates');
    $tpl = new templates();
    $tpl->_ENGINE_parse_body('{success}');
}
function page()
{
    $usersmenus = new usersMenus();
    if (isset($_GET["generate"])) {
        $sock = new sockets();
        $error = $sock->getfile('awstats_generate');
        if ($error != null) {
            $error = "<center style='font-size:13px;border:1px dotted #CCCCCC;padding:10px;margin:10px'><strong><code>{generate}:<br>artica-install report:{$error}</code></strong></center>";
        }
    }
    if (!isset($_GET["page"])) {
        $index_page = 'index';
    } else {
        $index_page = $_GET["page"];
    }
    $page = dirname(__FILE__) . "/ressources/logs/awstats.{$index_page}.tmp";
    if (!file_exists($page)) {
        $html = "{$error}<p style='font-weight:bold;color:red;font-size:14px;border:1px dotted #CCCCCC;padding:10px;marging:10px'>\n\t{error_unable_to_find_path}:<br>{$page}<br>\n\t{infos_awstats_must_generate}\n\t<br><br><br>\n\t<center>\n\t\t<input type='button' OnClick=\"javascript:MyHref('" . CurrentPageName() . "?generate=yes&page={$index_page}');\" value='{generate}&nbsp;&raquo;'>\n\t</center>\n\t<br></p>\n\t";
        $tpl = new templates();
        $tpl->_ENGINE_parse_body($html);
        $tpl = new template_users('{awstats_statistics_' . $index_page . '}', $html, 0, 0, 0, 60);
        echo $tpl->web_page;
        exit;
    }
    $index = dirname(__FILE__) . "/ressources/logs/awstats.{$index_page}.tmp";
    $datas = file_get_contents($index);
    $css = file_get_contents(dirname(__FILE__) . "/ressources/databases/awstats.css.db");
    if (preg_match('#<page_start>(.+)<page_end>#is', $datas, $regs)) {
        $page_datas = ReplaceHtmlCode($regs[1]);
    }
    $html = "{$css}\n<div style='width:640px'>\n{$page_datas}\n</div>";
    $tpl = new template_users('{awstats_statistics_' . $index_page . '}', $html, 0, 0, 0, 60);
    echo $tpl->web_page;
}
Example #4
0
function external_storage_usb_list()
{
    $sock = new sockets();
    $datas = $sock->getfile('smb_scan');
    $finalHash = computer_list();
    $list = "\n\t\n\t<table style='width:100%'><tr>";
    $tb = explode("\n", $datas);
    if (is_array($tb)) {
        $count = 0;
        while (list($uid, $line) = each($tb)) {
            if (preg_match("#^([0-9\\.]+)\\s+(.+?)\\s+.+?\\[(.+?)\\]#", $line, $re)) {
                $finalHash[strtolower($re[2])] = $re[1];
            }
        }
    }
    if (is_array($finalHash)) {
        while (list($uid, $line) = each($finalHash)) {
            if ($count == 3) {
                $list = $list . "</tr><tr>";
                $count = 0;
            }
            $list = $list . "<td>" . Paragraphe32("noacco:{$uid}", $line, "Loadjs('ComputerBrowse.php?&computer={$uid}&field={$_GET["set-field"]}&format-artica=yes');", "32-network-server.png", 150) . "</td>";
            $count = $count + 1;
        }
    }
    $list = $list . "</tr>\t</table>";
    $html = $list;
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html, "dar.index.php");
}
Example #5
0
function dmidecode()
{
    $sock = new sockets();
    $datas = $sock->getfile("dmidecode");
    $tbl = explode("\n", $datas);
    if (is_array($tbl)) {
        $a[] = "<table>";
        while (list($num, $line) = each($tbl)) {
            if (trim($line) == null) {
                continue;
            }
            if (preg_match('#^([a-zA-Z]+)#', $line)) {
                $a[] = "<tr><td style='font-size:14px;font-weight:bold;border-bottom:1px solid #CCCCCC;padding-top:10px' colspan=2>{$line}</td></tr>";
                continue;
            }
            if (preg_match('#\\s+(.+?):(.+)#', $line, $re)) {
                $a[] = "<tr>\n\t\t\t\t\t<td class=legend>{$re[1]}</td><td><strong>{$re[2]}</strong></td></tr>";
                continue;
            }
            if (preg_match("#^\t\t([a-zA-Z]+)#", $line)) {
                $a[] = "<tr>\n\t\t\t\t\t<td class=legend></td><td><li>{$line}</li></td></tr>";
                continue;
            }
        }
    }
    $a[] = "</table>";
    $html = "<H1>{dmidecode}</H1>\n\t<p class=caption>{dmidecode_text}</p>\n\t" . RoundedLightWhite("<div style='width:100%;height:300px;overflow:auto'>" . implode("\n", $a));
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function PageAveserverLicence()
{
    $yum = new usersMenus();
    $tpl = new templates();
    $tpl = new templates();
    if ($yum->AsPostfixAdministrator == false) {
        return $tpl->_ENGINE_parse_body("<h3>{not allowed}</H3>");
    }
    $sock = new sockets();
    $file = $sock->getfile("aveserver_licence");
    $file = htmlentities($file);
    $table = explode("\n", $file);
    $html = "<table style='width:100%'>";
    while (list($num, $val) = each($table)) {
        if (preg_match('#(.+)\\:(.+)#', $val, $regs)) {
            if ($val != null) {
                $html = $html . "<tr><td nowrap align='right'><strong>{$regs[1]}:&nbsp;</strong><td style='border-bottom:1px solid #CCCCCC'>{$regs[2]}</td></tr>";
            }
        }
        if (preg_match('#Key file\\s+(.+?)\\.key#', $val, $regs)) {
            $html = $html . "<tr><td nowrap align='right' colspan=2><input type='button' value='{delete} {$regs[1]}' OnClick=\"javascript:TreeAveServerLicenceDeleteKey('{$regs[1]}.key');\"></td></tr>";
        }
        if (preg_match("#Serial#i", $val)) {
            $html = $html . "<tr><td colspan=2 style='border-bottom:2px solid #CCCCCC'>&nbsp;</td></tr>";
        }
    }
    $html = "<h4>{licence status}</h4>{$html}</table>";
    return $tpl->_ENGINE_parse_body("{$html}");
}
Example #7
0
function top_ressources_mem_generate()
{
    $sock = new sockets();
    $datas = $sock->getfile('dstattopressourcesmem');
    $tbl = explode("\n", $datas);
    if (is_array($tbl)) {
        while (list($num, $file) = each($tbl)) {
            if ($file == null) {
                continue;
            }
            if (preg_match('#dstat\\.topmem\\.([0-9]+)\\.(.+?)\\.png#', $file, $re)) {
                $arr[$re[1]] = "ressources/logs/{$file}";
            } else {
                echo "<br>{$file} !!";
            }
        }
    }
    if (!is_array($arr)) {
        return null;
    }
    rsort($arr);
    while (list($num, $file) = each($arr)) {
        $images = $images . "<div style='width:525px;padding:3px;margin:3px border:1px solid #CCCCCC;'>" . RoundedLightWhite("<img src='{$file}'>") . "</div><br>";
    }
    return $images;
}
function PostFixVerifyDatabaseSave()
{
    $main = new main_cf();
    $tpl = new templates();
    $OldValue = $main->main_array["address_verify_map"];
    $OldValue = str_replace('btree:', '', $OldValue);
    $newvalue = $_GET["address_verify_map"];
    if ($newvalue != null) {
        if ($OldValue == $newvalue) {
            PostFixVerifyDatabaseSaveParseOthers();
            echo $tpl->_ENGINE_parse_body('{success}');
            return null;
        }
        if ($OldValue != $newvalue) {
            if ($OldValue != null) {
                $socks = new sockets();
                $socks->getfile('DeleteTheMainFilePostfixSettings:' . $OldValue);
            }
            $main->main_array["address_verify_map"] = "btree:{$newvalue}";
            $main->save_conf();
        }
    } else {
        if ($OldValue != null) {
            $main->main_array["address_verify_map"] = "";
            $main->save_conf();
            $socks = new sockets();
            $socks->getfile('DeleteTheMainFilePostfixSettings:' . $OldValue);
        }
    }
    PostFixVerifyDatabaseSaveParseOthers();
    echo $tpl->_ENGINE_parse_body('{success}');
}
function LicenceUploaded()
{
    $tmp_file = $_FILES['fichier']['tmp_name'];
    $content_dir = dirname(__FILE__) . "/ressources/conf/upload";
    if (!is_dir($content_dir)) {
        mkdir($content_dir);
    }
    if (!is_uploaded_file($tmp_file)) {
        MainPage('{error_unable_to_upload_file}');
        exit;
    }
    $type_file = $_FILES['fichier']['type'];
    if (!strstr($type_file, 'key')) {
        MainPage('{error_file_extension_not_match} :key');
        exit;
    }
    $name_file = $_FILES['fichier']['name'];
    if (file_exists($content_dir . "/" . $name_file)) {
        @unlink($content_dir . "/" . $name_file);
    }
    if (!move_uploaded_file($tmp_file, $content_dir . "/" . $name_file)) {
        MainPage("{error_unable_to_move_file} : " . $content_dir . "/" . $name_file);
        exit;
    }
    $_GET["moved_file"] = $content_dir . "/" . $name_file;
    include_once "ressources/class.sockets.inc";
    $socket = new sockets();
    $res = $socket->getfile("aveserver_licencemanager:{$content_dir}/{$name_file}");
    $res = str_replace("\r", "", $res);
    $res = wordwrap($res, 50, "\n", true);
    $res = nl2br($res);
    MainPage($res);
}
Example #10
0
function popup()
{
    $html = "<H1>{REPLICATE_YOUR_MAILBOXES}</H1>\n\t\n\t\n\t" . RoundedLightWhite("<div style='width:100%;height:300px;overflow:auto' id='CyrsSynchroDiv'></div>");
    $tpl = new templates();
    $sock = new sockets();
    $sock->getfile('CyrusMasterSyncClient');
    echo $tpl->_ENGINE_parse_body($html, "cyrus.clusters.php");
}
Example #11
0
function img()
{
    $sock = new sockets();
    $date = date('YmdHis');
    $sock->getfile("dstatpostfix:/usr/share/artica-postfix/ressources/logs/web/dstat-postfix-{$date}.png");
    $img = RoundedLightWhite("\n<input type='hidden' id='postfix-memid' value='{$date}'>\n<center>\n<img src='ressources/logs/web/dstat-postfix-{$date}.png' style='margin:3px;border:1px solid #CCCCCC'></center>");
    return $img;
}
Example #12
0
function pommosave()
{
    $sock = new sockets();
    $sock->SET_INFO("PommoFieldlang", $_GET["PommoFieldlang"]);
    $sock->SET_INFO("PommoFieldhostname", $_GET["PommoFieldhostname"]);
    $datas = $sock->getfile("EmergencyStart:pommo");
    echo $datas;
}
Example #13
0
function pflogsumm_recipient_send()
{
    $tpl = new templates();
    $send_report_now_text = $tpl->_ENGINE_parse_body('{send_report_now_text}');
    $sock = new sockets();
    $sock->getfile("pflogsummSend");
    echo $send_report_now_text;
}
Example #14
0
function fetchmail_status()
{
    $tpl = new templates();
    $ini = new Bs_IniHandler();
    $sock = new sockets();
    $ini->loadString($sock->getfile('fetchmailstatus'));
    $status = DAEMON_STATUS_ROUND("FETCHMAIL", $ini, null);
    return $tpl->_ENGINE_parse_body($status);
}
Example #15
0
function roudncube_save()
{
    $ou = $_GET["ou"];
    $roundcube = new roundcube($ou);
    $roundcube->roundcubeWebsites[$ou]["servername"] = $_GET["roundcubeservername"];
    $roundcube->Save();
    $sock = new sockets();
    $sock->getfile('ApacheGroupWareRestart');
}
Example #16
0
function popup()
{
    $sock = new sockets();
    $sock->getfile('ServiceAutofsRestart');
    $logs = showlogs();
    $html = "<H1>{restart_autofs}</H1>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=1%><img src='img/service-restart-64.png'></td>\n\t\t<td valign='top'><p class=caption>{restart_autofs_text}</p>\n\t\t" . RoundedLightWhite("<div style='width:100%;height:150px;overflow:auto' id='AutofsDiv159'>{$logs}</div>") . "<td>\n\t</tr>\n\t</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Example #17
0
function sa_blacklist()
{
    $sock = new sockets();
    $EnableSaBlackListUpdate = $sock->GET_INFO('EnableSaBlackListUpdate');
    $SpamassassinSablackListCount = $sock->getfile('SpamassassinSablackListCount');
    $form = Paragraphe_switch_img('{ENABLE_SA_BLACKLIST_UPDATE}', '{ENABLE_SA_BLACKLIST_UPDATE_TEXT}', "EnableSaBlackListUpdate", $EnableSaBlackListUpdate, '{enable_disable}', 300);
    $html = "<H1>{APP_SA_BLACKLIST}</H1>\n\t<div id='EnableSaBlackListUpdateDiv'>\n\t<p class=caption>{APP_SA_BLACKLIST_AUTOUPDATE}</p>\n\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t<img src='img/bg_spam-assassin-120.png'>\n\t\t\t<p class=caption style='color:#B73C3C;width:200px;background-color:white;padding:3px;margin:3px;border:1px solid #B73C3C'>{APP_SA_BLACKLIST_AUTOUPDATE_WARNING}</p>\n\t\t\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<H3 style='text-align:right'>{$SpamassassinSablackListCount}</H3><hr>\n\t\t{$form}\n\t\t<hr>\n\t\t\t<div style='width:100%;text-align:right'><input type='button' OnClick=\"javascript:EnableSaBlackListUpdateSave();\" value='{edit}&nbsp;&raquo;&raquo;'></div>\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Example #18
0
function maillog()
{
    include_once dirname(__FILE__) . "/ressources/class.status.logs.inc";
    $user = new usersMenus();
    $tpl = new Templates();
    if ($user->AsPostfixAdministrator == false) {
        echo DIV_SHADOW($tpl->_ENGINE_parse_body('{no privileges}'));
        exit;
    }
    $sock = new sockets();
    if ($_GET["maillog_filter"] != null) {
        switch ($_GET["maillog_filter"]) {
            case 'articaweb':
                $datas = file_get_contents(dirname(__FILE__) . '/ressources/logs/artica-web.log');
                break;
            case 'procmail':
                $datas = $sock->getfile('procmail_logs');
                break;
            default:
                $datas = $sock->getfile('maillog:' . $_GET["maillog_filter"]);
                break;
        }
    } else {
        $tbl = unserialize(base64_decode($sock->getFrameWork('cmd.php?postfix-tail=yes')));
    }
    $datas = htmlentities($datas);
    $tbl = explode("\n", $datas);
    $tbl = array_reverse($tbl, TRUE);
    $html = "<table style='width:100%'>";
    while (list($num, $val) = each($tbl)) {
        if (trim($val) != null) {
            if ($class == "rowA") {
                $class = "rowB";
            } else {
                $class = "rowA";
            }
            $html = $html . "<tr>\n\t\t<td width=1% style='border-bottom:1px dotted #CCCCCC' align='center'><img src='" . statusLogs($val) . "'></td>\n\t\t<td width=99%' style='border-bottom:1px dotted #CCCCCC;font-size:10px;'>{$val}</td>\n\t\t</tr>\n\t\t";
        }
    }
    $html = $html . "</table>";
    return $html;
}
Example #19
0
function CrawlNow()
{
    ///etc/artica-postfix/InstantSearch.time
    $sock = new sockets();
    $datas = $sock->getfile('InstantSearchEnableCrawl');
    $crawl = "<div style='width:100%;text-align:right;margin-top:9px;border-top:1px solid #CCCCCC'>\n\t\t<input type='button' OnClick=\"javascript:InstantCrawlResfresh();\" value='{refresh}&nbsp;&raquo'>\n\t</div>";
    $html = "<H1>{InstantSearch}</h1>{$crawl}\n\t\n\t" . RoundedLightWhite("<div style='width:100%;height:300px;overflow:auto' id='instantcrawl'></div>");
    $tpl = new templates();
    $tpl->_ENGINE_parse_body($html);
    echo $tpl->_ENGINE_parse_body($html);
}
Example #20
0
function rmdirp()
{
    $user = new usersMenus();
    if (!$user->AsSambaAdministrator) {
        return null;
    }
    if (Folder_to_not_remove($_GET["rmdirp"])) {
        return null;
    }
    $sock = new sockets();
    $sock->getfile("rmdirp:{$_GET["rmdirp"]}");
}
Example #21
0
function PostfixLogs()
{
    $sock = new sockets();
    $datas = $sock->getfile('cyrus_events');
    writelogs(strlen($datas) . ' bytes', __FUNCTION__, __FILE__);
    $tbl = explode("\n", $datas);
    $tbl = array_reverse($tbl, TRUE);
    while (list($num, $val) = each($tbl)) {
        $html = $html . "<div style='color:white;margin-bottom:3px;font-size:10px'><code>{$val}</code></div>";
    }
    echo RoundedBlack($html);
}
Example #22
0
 function SaveParams()
 {
     $ini = new Bs_IniHandler();
     $ini->_params = $this->params;
     $ou = $this->ou;
     $name = str_replace('.', '_', $ou);
     $name = str_replace('-', '_', $name);
     $sock = new sockets();
     $sock->SaveConfigFile($ini->toString(), "JoomlaConfOrg_{$name}");
     $this->SaveLDAPParams();
     $this->SaveAdminPassword();
     $sock->getfile('JoomlaReload');
 }
Example #23
0
function SaveConf()
{
    $sock = new sockets();
    $sock->SET_INFO("CyrusEnableAV", $_GET["CyrusEnableAV"]);
    $ini = new Bs_IniHandler();
    while (list($num, $val) = each($_GET)) {
        $ini->_params["SCAN"][$num] = trim($val);
    }
    $sock->SaveConfigFile($ini->toString(), "CyrusAVConfig");
    $tpl = new templates();
    $sock->getfile('RestartDaemon');
    echo html_entity_decode($tpl->_ENGINE_parse_body('{success}'));
}
Example #24
0
function main_status()
{
    $ini = new Bs_IniHandler();
    $sock = new sockets();
    $ini->loadString($sock->getfile('dotclear_status'));
    $status = DAEMON_STATUS_ROUND("DOTCLEAR", $ini, null);
    $tpl = new templates();
    $dotclear = new dotclear();
    if (!$dotclear->TestsDatabase()) {
        $badtables = "<br><div style='width:97%' class='paragraphe' id='{$id}' {$h3style}>\n\t<table style='width:100%'>\n\t<tr>\n\t<td width=1% valign='top'><img src='img/42-red.png'></td>\n\t<td valign='top' >\n\t\t<H3 style='color:red'>{tables_error}</H3>\n\t\t<p class=caption>{tables_error_text}</p>\n\t\t<center>\n\t\t<input type='button' OnClick=\"javascript:RebuildTablesDotClear();\" value='{rebuild_tables}&nbsp;&raquo;'>\n\t\t</center>\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t</div>";
    }
    //DotClearRebuildTables
    echo $tpl->_ENGINE_parse_body("{$status}{$badtables}");
}
Example #25
0
function events()
{
    $sock = new sockets();
    $datas = $sock->getfile('logs_squid');
    writelogs(strlen($datas) . ' bytes', __FUNCTION__, __FILE__);
    $tbl = explode("\n", $datas);
    $tbl = array_reverse($tbl, TRUE);
    while (list($num, $val) = each($tbl)) {
        $val = htmlentities($val);
        if (!preg_match('#GET cache_object.+127\\.0\\..+#', $val)) {
            $html = $html . "<div style='color:white;margin-bottom:3px'><code>{$val}</code></div>";
        }
    }
    echo RoundedBlack($html);
}
Example #26
0
function section_Fetchmail_Daemon()
{
    $yum = new usersMenus();
    $tpl = new templates();
    $ini = new Bs_IniHandler();
    $sock = new sockets();
    $title = "{fetchmail_rules}";
    $add_fetchmail = Paragraphe('add-fetchmail-64.png', '{add_new_fetchmail_rule}', '{fetchmail_explain}', "javascript:add_fetchmail_rules()", null, 340);
    $ini->loadString($sock->getfile('fetchmailstatus'));
    $status = DAEMON_STATUS_ROUND("FETCHMAIL", $ini, null);
    $status = $tpl->_ENGINE_parse_body($status);
    $html = "<table style='width:600px'>\n\t\t<tr>\n\t\t<td valign='top' width=1%><img src='img/bg_fetchmail2.jpg'>\n\t\t<td valign='top' align='right'><div style='width:350px'>{$status} <br> {$add_fetchmail}</div></td>\n\t\t</tr>\n\t\t<td colspan=2>\n\t\t<div id='fetchmail_daemon_rules'></div>\n\t\t\t</td>\n\t\t\t</tr>\t\t\t\n\t\t\t\t\t</table>\n\t\t\t\t\t\n\t<script>LoadAjax('fetchmail_daemon_rules','fetchmail.daemon.rules.php?Showlist=yes');</script>";
    $tpl = new template_users($title, $html, 0, 0, 0, 0);
    echo $tpl->web_page;
}
Example #27
0
function events($return = 0)
{
    $sock = new sockets();
    $datas = $sock->getfile('pureftpd_logs');
    writelogs(strlen($datas) . ' bytes', __FUNCTION__, __FILE__);
    $tbl = explode("\n", $datas);
    $tbl = array_reverse($tbl, TRUE);
    while (list($num, $val) = each($tbl)) {
        $val = htmlentities($val);
        $html = $html . "<div style='color:white;margin-bottom:3px'><code>{$val}</code></div>";
    }
    if ($return == 1) {
        return RoundedBlack($html);
    }
    echo RoundedBlack($html);
}
function MountHomes($array)
{
    $sock = new sockets();
    if (!is_array($array)) {
        return null;
    }
    while (list($num, $val) = each($array)) {
        if ($num == null) {
            continue;
        }
        $homedirectory = $val["homedirectory"];
        while (list($index, $dir) = each($val["homeDirectoryBinded"])) {
            $datas = $sock->getfile("homeDirectoryBinded:{$homedirectory};{$dir}");
        }
    }
}
function ParseLogs()
{
    $sock = new sockets();
    $datas = $sock->getfile('dnsmasqlogs');
    $tbl = explode("\n", $datas);
    if (!is_array($tbl)) {
        return null;
    }
    $tbl = array_reverse($tbl);
    $html = "<table style='width:100%'>";
    while (list($index, $line) = each($tbl)) {
        if ($line != null) {
            $html = $html . "\n\t\t\t<tr>\n\t\t\t<td width='1%' valign='middle' class=bottom><img src='img/fw_bold.gif'><td>\n\t\t\t<td class=bottom>{$line}</td>\n\t\t\t</tr>";
        }
    }
    return $html . "</table>";
}
Example #30
0
function PostfixLogs()
{
    $sock = new sockets();
    $styletd = "style='color:white;font-weight:bold;font-size:11px'";
    $datas = $sock->getfile('iptables_events');
    writelogs(strlen($datas) . ' bytes', __FUNCTION__, __FILE__);
    $tbl = explode("\n", $datas);
    $html = $html . "<table style='width:100%'>\n\t\t<tr style='background-color:#005447'>\n\t\t\t\t<td width=1% nowrap {$styletd}>date</td>\n\t\t\t\t<td width=1% nowrap {$styletd}>NIC</td>\n\t\t\t\t<td nowrap {$styletd}>MAC</td>\n\t\t\t\t<td nowrap {$styletd}>ip</td>\n\t\t\t\t<td nowrap {$styletd}>proto</td>\n\t\t\t\t<td nowrap {$styletd}>port</td>\n\t\t\t\t</tr>";
    $tbl = array_reverse($tbl, TRUE);
    while (list($num, $val) = each($tbl)) {
        if (preg_match('#(.+?)([\\s0-9\\:]+).+?kernel:.+?:IN=(.+?)\\s+OUT=.*?MAC=([0-9\\:a-z]+)\\s+SRC=([0-9\\.]+).+?PROTO=(.+?)\\s+.+DPT=([0-9]+)#', $val, $re)) {
            $html = $html . "<tr " . CellRollOver() . ">\n\t\t\t\t<td width=1% nowrap>{$re[1]} {$re[2]}</td>\n\t\t\t\t<td width=1% nowrap>{$re[3]}</td>\n\t\t\t\t<td nowrap>{$re[4]}</td>\n\t\t\t\t<td nowrap>{$re[5]}</td>\n\t\t\t\t<td nowrap width=1% >{$re[6]}</td>\n\t\t\t\t<td nowrap width=1% >{$re[7]}</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t";
        }
    }
    $html = $html . "</table>";
    echo RoundedLightGrey($html);
}