Пример #1
0
function PageFetchmail_status()
{
    include_once 'ressources/class.fetchmail.inc';
    $tpl = new templates();
    $yum = new usersMenus();
    if ($yum->AsMailBoxAdministrator == false) {
        $html = $tpl->_ENGINE_parse_body("<h3>{not allowed}</H3>");
        return $html;
    }
    $status = new status(1);
    $stat = $status->fetchmail_satus();
    $html = $stat;
    if ($usersmenus->AutomaticConfig == false) {
        $html = $html . "<br><fieldset><legend>{apply config}</legend>\n\t\t\t\t\t<center><input type='button' value='{apply config}' OnClick=\"javascript:TreeFetchMailApplyConfig()\"></center>\n\t\t\t\t</fieldset>";
    }
    $fetch = new fetchmail();
    if (is_array($fetch->array_servers)) {
        $html = $html . "<fieldset>\n\t\t\t\t<legend>{servers_list}</legend>\n\t\t\t\t<center>\n\t\t\t\t<table style='width:90%;border:1px solid #CCCCCC'>\n\t\t\t\t<tr style='border-bottom:1px solid #CCCCCC'>\n\t\t\t\t\t<td colspan=2><strong>{servers_list}</td>\n\t\t\t\t\t<td align='center'><strong>{number_users}</strong></td>\n\t\t\t\t</tr>";
        while (list($num, $val) = each($fetch->array_servers)) {
            $html = $html . "<tr>\n\t\t\t\t\t<td width=1%><img src='img/webmin_on-22.gif'></td>\n\t\t\t\t\t<td><a href=\"javascript:TreeFetchmailShowServer('{$num}');\">{$num}</a></td>\n\t\t\t\t\t<td align='center'>" . count($val) . "</td>\n\t\t\t\t\t</tr>";
        }
        $html = $html . "</table></center></fieldset>";
    }
    return $tpl->_ENGINE_parse_body("<div id=status>{$html}</div>");
}