function RULES()
{
    $page = CurrentPageName();
    $uid = $_SESSION["uid"];
    $ldap = new clladp();
    $u = $ldap->UserDatas($uid);
    $fr = new Fetchmail_settings();
    $tpl = new templates();
    if (is_array($u["FetchMailsRulesSources"])) {
        while (list($num, $ligne) = each($u["FetchMailsRulesSources"])) {
            $arr = $fr->parse_config($ligne);
            $id = md5($line);
            $arr = $arr[1];
            if ($arr["ssl"]) {
                $ssl = "{using_ssl}";
            }
            if ($arr["port"] != null) {
                $port = "{with_port} {$arr["port"]}";
            } else {
                $port = null;
            }
            $img_disabled = "42-green.png";
            if ($arr["disabled"]) {
                $img_disabled = "42-red.png";
            }
            $line = "\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td width=1% valign='top'><img src='img/{$img_disabled}'></td>\n\t\t\t\t<td nowrap>\n\t\t\t\t<H5>{fetch}&nbsp; &#34;{$arr["poll"]}&#34;&nbsp;{$disabled}</H5>\n\t\t\t\t\t<div style='font-size:11px' id='{$id}'>\n\t\t\t\t\t\t{fetch_address} &#34;<strong>" . $arr["user"] . "</strong>&#34;<br>\n\t\t\t\t\t\t{protocol}: <strong>{$arr["proto"]} {$port} {$ssl}</strong><br>\n\t\t\t\t\t\t{and_send_to} <strong>&#34;" . $arr["is"] . "&#34;</strong>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr><td colspan=2 align='right'>\n\t\t\t\t<table style='width:1%'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . imgtootltip('32-zoom-in.png', '{view}', "LoadAjax('{$id}','{$page}?ViewScript={$num}&id={$id}');") . "</td>\n\t\t\t\t\t\t<td>" . imgtootltip('32-edit.png', '{apply}', "UserFetchMailRule({$num},'{$uid}');") . "</td>\n\t\t\t\t\t\t<td>" . imgtootltip('32-cancel.png', '{delete}', "UserDeleteFetchMailRule({$num});") . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t</table>";
            $left = RoundedLightGrey($tpl->_ENGINE_parse_body($line));
            $res[] = $left;
        }
    }
    if (is_array($res)) {
        echo $tpl->_ENGINE_parse_body(implode("<br>", $res));
    }
    echo $list;
}
Esempio n. 2
0
function PostfixLogs()
{
    include_once 'ressources/class.mysql.inc';
    $sql = "SELECT * FROM events WHERE event_id={$_GET["event"]} ORDER BY zDate DESC LIMIT 0,100";
    $my = new mysql();
    $html = "<table style='width:100%'>";
    $html = $html . "<tr style='background-color:#005447'>\n\t  <td width=1%>&nbsp;</td>\n\t  <td width=1% nowrap>&nbsp;</td>\n\t  <td>&nbsp;</td>\n\t  </tr>";
    $resultat = $my->QUERY_SQL($sql, 'artica_events');
    while ($ligne = @mysql_fetch_array($resultat, MYSQL_ASSOC)) {
        switch ($ligne["event_type"]) {
            case 0:
                $img = "icon_mini_warning.gif";
                break;
            case 1:
                $img = "icon-mini-ok.gif";
                break;
            case 2:
                $img = "icon-mini-info.gif";
                break;
            default:
                $img = "icon-mini-info.gif";
                break;
        }
        $html = $html . "<tr " . CellRollOver() . ">\n\t  <td width=1%><img src='img/{$img}' style='margin:2px'></td>\n\t  <td width=1% nowrap>{$ligne["zDate"]}</td>\n\t  <td>{$ligne["text"]}</td>\n\t  </tr>";
    }
    $html = $html . "</table>";
    $html = RoundedLightGrey($html);
    $page = $html;
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($page);
}
function LoadRblist($ou)
{
    $ldap = new clladp();
    $oudat = $ldap->OUDatas($ou);
    if (!is_array($oudat["SURBLServers"])) {
        echo "&nbsp;";
        exit;
    }
    $cell = CellRollOver() . " style='font-size:12px'";
    $serverlist = RblForm(1);
    $html = "\n\t<H5>{rbl_servers}</H5>\n\t<table style='width:90%'>";
    while (list($num, $val) = each($oudat["SURBLServers"])) {
        if (strpos($val, ':') > 0) {
            $tb = explode(":", $val);
            $rbl = $tb[0];
            $purc = $tb[1];
            $count = $count + $purc;
        } else {
            $country = $val;
            $action = "delete";
        }
        $html = $html . "\n\t\t\t<tr>\n\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t<td {$cell}><strong>{$rbl}</strong></td>\n\t\t\t<td {$cell} width=1%'><img src='img/i16.gif'></td>\n\t\t\t<td {$cell}><strong><a href='{$serverlist["{$rbl}"]["uri"]}' target='_new'>{$serverlist["{$rbl}"]["name"]}</a></strong></td>\n\t\t\t<td {$cell}><strong>" . Field_text("{$num}", $purc, 'width:50px', null, 'EditSurblRblServer(this)') . "</strong></td>\n\t\t\t<td {$cell} width=1%>" . imgtootltip('x.gif', '{delete}', "SURblDelete({$num})") . "</td>\n\t\t\t</tr>";
    }
    $html = $html . "<tr><td colspan=4 align='right' style='color:#005447;font-size:12px;border-top:1px solid black;padding:5px'><strong>{$count}%</strong></td></tr>";
    $tpl = new templates();
    echo "<br>" . RoundedLightGrey($tpl->_ENGINE_parse_body($html . "</table>"));
}
Esempio n. 4
0
function main_disks_discover()
{
    $users = new usersMenus();
    $Disks = $users->disks_size;
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?usb-scan-write=yes");
    if (!file_exists('ressources/usb.scan.inc')) {
        return $tpl->_ENGINE_parse_body("<H1>{error_no_socks}</H1>");
    }
    include_once "ressources/usb.scan.inc";
    if ($Disks != null) {
        $tbl = explode(";", $Disks);
        while (list($num, $val) = each($tbl)) {
            if (trim($val) != null) {
                $values = explode(",", $val);
                if (is_array($values)) {
                    $dc = $dc + 1;
                    $disk = $values[0];
                    $size = $values[1];
                    $occ = $values[2];
                    $disp = $values[3];
                    $pourc = $values[4];
                    $path = Get_mounted_path($disk, $_GLOBAL["usb_list"]);
                    $html = $html . "\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<table style='width:220px;margin:3px'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td width=1%>\n\t\t\t\t\t\t" . imgtootltip('scan-disk-48.png', $disk, "Loadjs('TreeBrowse.php?jdisk={$disk}&mounted={$path}&t={$_GET["t"]}');Loadjs('Tree.js');") . "</td>\n\t\t\t\t\t<td style='font-size:11px' valign='top'>\n\t\t\t\t\t\t{$disk} ({$pourc}% {used}).\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\t\n\t\t\t\t\t\n\t\t\t\t\t";
                }
            }
        }
    }
    $html = "<H5>{select_disk}</H5><br>" . RoundedLightGrey("\n\t<table style='width:100%'>\n\t{$html}\n\t</table>\n\t");
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
Esempio n. 5
0
function INDEX()
{
    $ldap = new clladp();
    $ou = $_GET["ou"];
    $Hash_datas = $ldap->OUDatas($ou);
    $h_type = array("spam" => "spam", "ham" => "ham");
    $domains1 = $ldap->hash_get_domains_ou($ou);
    $domainsF1 = Field_array_Hash($domains1, 'bogo_spam_domain', null, null, null, 0, 'width:150px');
    $type = Field_array_Hash($h_type, 'bogo_type', null, null, null, 0, 'width:100px');
    $hash_action = array("delete" => "{bogo_delete}", "quarantine" => "{bogo_quarantine}", "prepend" => "{bogo_prepend}");
    $form_email = "\n\t<input type='hidden' id='ou' value='{$ou}'>\n\t<H5>{bogo_robots}</H5>\n\t<table style='width:100%'>\n\t<tr>\n\t<td align='right' nowrap><strong>{add_bogo_spam}:</strong></td>\n\t<td>" . Field_text('bogo_spam') . "</td>\n\t<td>{$domainsF1}</td>\n\t<td>{$type}</td>\n\t<td><input type='button' value='{add}&nbsp;&raquo;' OnClick=\"javascript:bogoAddSpamUser();\"></td>\n\t</tr>\n\t</table>\n\t\n\t";
    for ($i = 1; $i < 10; $i++) {
        $h_level[$i . '0'] = $i . '0 %';
    }
    $actions_datas = explode(';', $Hash_datas["BogoFilterAction"]);
    $action = "\n\t<H5>{spam_action}</H5>\n\t{spam_action_text} " . Field_array_Hash($h_level, 'exceed', $actions_datas[0], null, null, 0, 'width:60px') . " {then} " . Field_array_Hash($hash_action, 'action', $actions_datas[1], null, null, 0, 'width:160px') . "<br><br>\n\t{if_bogo_prepend} " . Field_text('bogo_prepend', $actions_datas[2], 'width:150px') . "\n\t<div style='width:100%;text-align:right'><input type='button' value='{edit}&nbsp;&raquo;&raquo;' OnClick=\"javascript:BogoFilterAction();\"></div>\n\t\n\t";
    $area_robots = "<div id='robots'></div><script>LoadAjax('robots','{$page}?GetRobots={$ou}')</script>";
    $area_robots = RoundedLightGrey($area_robots);
    $action = RoundedLightGrey($action);
    $form_email = RoundedLightGrey($form_email);
    $page = CurrentPageName();
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/bg_bogofilter.jpg'></td>\n\t<td valign='top' width=99%>" . RoundedLightGreen("{bogo_intro}") . "</td>\n\t</tr>\n\t</table>\n\t{$form_email}\n\t<br>\n\t{$action}\n\t<br>\n\t{$area_robots}\n\t";
    $cfg["JS"][] = "js/bogofilter.js";
    $tpl = new template_users('{APP_BOGOFILTER}', $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
function page()
{
    $main = new main_cf();
    $html = "\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"postfix.js\"></script>\n\t<div id='postfix_security_rules'>" . RoundedLightGrey(postfix_security_rules()) . "</div>";
    $tpl = new template_users('{security_rules}', $html);
    echo $tpl->web_page;
}
Esempio n. 7
0
function sub_page()
{
    $dkim = new dkimfilter();
    $filteraction_array = array("a" => "accept the message", "d" => "discard the message", "t" => "temp-fail the message", "r" => "reject the message");
    $form = "\n<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' nowrap style='font-size:10px'><strong>{On-BadSignature}:&nbsp;</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($filteraction_array, 'On-BadSignature', $dkim->main_array["On-BadSignature"]) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' nowrap style='font-size:10px'><strong>{On-DNSError}:&nbsp;</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($filteraction_array, 'On-DNSError', $dkim->main_array["On-DNSError"]) . "</td>\n\t\t\t\t</tr>\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' nowrap style='font-size:10px'><strong>{On-InternalError}:&nbsp;</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($filteraction_array, 'On-InternalError', $dkim->main_array["On-InternalError"]) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' nowrap style='font-size:10px'><strong>{On-NoSignature}:&nbsp;</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($filteraction_array, 'On-NoSignature', $dkim->main_array["On-NoSignature"]) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' nowrap style='font-size:10px'><strong>{On-Security}:&nbsp;</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($filteraction_array, 'On-Security', $dkim->main_array["On-Security"]) . "</td>\n\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='right' nowrap style='font-size:10px'><strong>{On-SignatureMissing}:&nbsp;</strong></td>\n\t\t\t\t\t<td>" . Field_array_Hash($filteraction_array, 'On-SignatureMissing', $dkim->main_array["On-SignatureMissing"]) . "</td>\n\t\t\t\t</tr>\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 align='right'><input type='button' OnClick=\"javascript:ParseForm('ffm1','{$page}',true);\" value='&laquo;&nbsp;&nbsp;{save}&nbsp;&nbsp;&raquo;'></td>\n\t\t\t\t\t\t\t\n\t\t\t</table>\n\n";
    $form = "<br>" . RoundedLightGrey($form);
    return "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t<td valign='top' width=1%><img src='img/cpanel.png'></td>\n\t\t\t\t\t<td valign='top'>\n\t\t\t\t\t\t<H5>{select_action}</H5>\n\t\t\t\t\t\t<form name='ffm1'>\n\t\t\t\t\t\t{$form}\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\t\n\t\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t</table>\n\t\n\t\n\t";
}
Esempio n. 8
0
function TemplatesForms()
{
    //ArticaReportQuarantineTemplate
    $messages_deleted = RoundedLightGrey("<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>" . imgtootltip('icon_settings-64.png', '{edit}', "LoadQuarantineTemplate('ArticaMaxDayTemplate')") . "</td>\n\t<td valign='top'>\n\t\t<H5>{template_deleted}</h5>\n\t\t{template_deleted_text}\n\t\n\t</td>\n\t</tr>\n\t</table>", null, 1);
    $messages_report = RoundedLightGrey("<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>" . imgtootltip('icon_settings-64.png', '{edit}', "LoadQuarantineTemplate('ArticaReportQuarantineTemplate')") . "</td>\n\t<td valign='top'>\n\t\t<H5>{ArticaReportQuarantineTemplate}</h5>\n\t\t{ArticaReportQuarantineTemplate_text}\n\t\n\t</td>\n\t</tr>\n\t</table>", null, 1);
    $intro = "<H4>{templates}</h4>\n\t<p>{templates_explain}</p>\n\t<table style='width:100%'>\n\t<tr>\n\t<td width=50% valign='top'>{$messages_deleted}</td>\n\t<td width=50% valign='top'>{$messages_report}</td>\n\t</tr>\n\t</table>\n\t\n\t";
    return "<br>" . $intro;
}
Esempio n. 9
0
function step1()
{
    $html = "\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/artica_wizard.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"postfix.js\"></script>\n\t<table style='width:600px' align=center>\n<tr>\n<td width=1% valign='top'><img src='img/bg_wizard.jpg'>\n</td>\n<td valign='top'>\n\t<table>\n\t";
    $html = $html . "<tr><td valign='top'>  " . Paragraphe('folder-update.jpg', '{create_org_postfix}', '{create_org_postfix_text}', "artica.wizard.org.php") . "</td></tr>";
    $html = $html . "</table>\n</td>\n</tr>\n<tr>\n<td><span id='wizardpme'>" . RoundedLightGrey(Wizardpme()) . "</spam></td>\n</tr>\n\n</table>";
    $tpl = new template_users('{artica_wizard}', $html, 0, 0, 0, 0, $array);
    echo $tpl->web_page;
}
Esempio n. 10
0
function mem_status()
{
    $t = $_GET["t"];
    $tpl = new templates();
    include_once "ressources/class.os.system.tools.inc";
    $os = new os_system();
    $html = RoundedLightGrey($os->html_Memory_usage()) . "<br>";
    echo $tpl->_ENGINE_parse_body($html);
    echo "<script>LoadAjax('squid-stats-{$t}','android.squid.stats.status.php');</script>";
}
Esempio n. 11
0
function main_page()
{
    $from = array("TO" => "{q_to}", "FROM" => "{q_from}", "" => "{dont_know}");
    $dir = Field_array_Hash($from, 'direction');
    $b = new backup_email($_SESSION["ou"]);
    $messagenumber = $b->MessageNumber();
    $html = "\n\t<script language=\"JavaScript\">       \nvar timerID  = null;\nvar timerID1  = null;\nvar tant=0;\nvar reste=0;\n\nfunction whatsnew(){\nif(document.getElementById('leftpanel_content')){\n\tLoadAjax('leftpanel_content','users.whatsnew-backup.php');\n}\n\n}\n\nfunction demarre(){\n   tant = tant+1;\n   reste=10-tant;\n\tif (tant < 10 ) {                           \n      timerID = setTimeout(\"demarre()\",5000);\n      } else {\n               tant = 0;\n               //document.getElementById('wait').innerHTML='<img src=img/wait.gif>';\n               ChargeLogs();\n               demarre();                                //la boucle demarre !\n   }\n}\n\n\nfunction ChargeLogs(){\n\twhatsnew();\n\t}\n\n</script>\n<script>demarre();</script>\n<script>;setTimeout(\"whatsnew()\",3000);</script>\n\t\n\t<H2>Query Manager ({$messagenumber} emails)</H2>\n\t<code>{backup_text}</code>\n\t<input type='hidden' id='ou' value='{$_SESSION["ou"]}'>\n\t\n\t" . RoundedLightGrey("\n\t<table style='width:100%'>\n\t\n\t<tr>\n\t\t<td nowrap align='right'><strong>{search_messages_that}:</strong></td>\n\t\t<td>{$dir}</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap align='right'><strong>{with_email}:</strong></td>\n\t\t<td>" . Field_text('email') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap align='right'><strong>{with_subject}:</strong></td>\n\t\t<td>" . Field_text('subject') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td nowrap align='right'><strong>{with_body}:</strong></td>\n\t\t<td>" . Field_text('body') . "</td>\n\t</tr>\t\n\t<tr>\n\t<tr>\n\t<td colspan=2 align='right'>\n\t\t<input type='button' OnClick=\"javascript:findBackuphtml();\" value='{search}&nbsp;&raquo;'>\n\t</td>\n\t</tr>\t\n\t</table>") . "\n\t\n\t<div id='query_list'></div>\n\t\n\t\n\t\n\t";
    $cfg["JS"][] = "js/users.backup.js";
    $tpl = new template_users("{backup}", $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
Esempio n. 12
0
function StartPage()
{
    $usersmenus = new usersMenus();
    if ($usersmenus->dnsmasq_installed == true) {
        $dnsmasq = '{infos_dnsmasq}';
    }
    $searchname = RoundedLightGrey("<H5>{nic_dns_search}</H5>\n<p>{nic_dns_search_text}</p>\n<center>\n<input type=button value='{add_search_domains}&nbsp;&raquo;' OnClick=\"javascript:NicAddSearchDomain();\">\n<input type='hidden' id='add_search_domain_text' value='{add_search_domain_text}'>\n<div id='searchTable' style='padding:20px'>\n\t\t" . SearchTable() . "\n\t</div>\n</center>") . ($page = "\n\n<table style='width:100%'>\n<tr>\n<td valign='top'><img align='left' src='img/bg_static-dns.jpg' style='margin:3px'></td>\n<td valign='top'><p>{nic_static_dns_text} <strong>{$dnsmasq}</strong></p>\n</td>\n</tr>\n<tr>\n<td colspan=2>\n<br>" . RoundedLightGrey("\n\n\n\n<H5>{nic_nameserver}</H5>\n<p>{nic_nameserver_text}</p>\n<center>\n<input type=button value='{add_nameserver}&nbsp;&raquo;' OnClick=\"javascript:NicAddNameServer()\";>\n<input type='hidden' id='add_nameserver_text' value='{add_nameserver_text}'>\n<div id='nametable' style='padding:20px'>\n\t" . nameserverTable() . "\n</div>\n\n") . "</td></tr></table>");
    $JS["JS"][] = 'js/system.staticdns.js';
    $tpl = new template_users('{nic_static_dns}', $page, 0, 0, 0, 0, $JS);
    echo $tpl->web_page;
}
function Page()
{
    $main = new main_cf();
    $page = CurrentPageName();
    $intro = RoundedLightGreen('<img src="img/infowarn-64.png" align=left style="margin:3px">{send_isp_relay_text3}');
    $form = "" . RoundedLightGrey("\n\t<table style='width:100%'>\n\t<tr>\n\t<td>\n\t\t<H5>{servername}</H5>\n\t\t<br>\n\t\t{send_isp_relay_text2}\n\t</td>\n\t</tr>\n\t<tr>\n\t\t\t<td colspan=2>" . Field_text('isp_server_ip', $main->main_array["relayhost"]) . "</td>\n\t\t</tr>\t\n\t<tr>\n\t\t<td align='right' colspan=2><input type='button' OnClick=\"javascript:EditRelayhost();\" value='{edit}&nbsp;&raquo;'></td>\n\t</tr>\n\t</table>") . "\n\t<br>";
    $html = "\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' style='width:50%'>\n\n\t{$form}</td>\n\t<td valign='top'>\n\t\t" . RoundedLightGreen("<table style='width:100%'>\n\t<tr><td width=1%>" . imgtootltip('restore-on.png', '{go_back}', "MyHref('artica.wizard.php')") . "</td>\n\t<td><H5>{return_to} {artica_wizard}</H5></td>\n\t</tr></table>") . "<br>" . applysettings("postfix") . "<br>{$intro}</td>\n\t</tr>\n\t</table>";
    $cfg["LANG_FILE"] = "artica.wizard.php";
    $cfg["JS"][] = "js/postfix-sasl.js";
    $tpl = new template_users('{send_isp_relay}', $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
Esempio n. 14
0
function Page()
{
    $main = new main_cf();
    $smtp_sasl_auth_enable = $main->main_array["smtp_sasl_auth_enable"];
    $page = CurrentPageName();
    $intro = applysettings("postfix") . RoundedLightBlue('<p style="text-align:justify;"><img src="img/infowarn-64.png" align=left style="margin:3px">{smtp_sasl_auth_enable_text}</p>');
    $intro = $intro . "<br>" . "" . "<script>LoadAjax('sasllist','{$page}?loadsaslList=yes');</script>";
    $form = "" . RoundedLightGrey("\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>" . Field_yesno_checkbox_img('smtp_sasl_auth_enable', $smtp_sasl_auth_enable, '{enable_disable}') . "</td>\n\t<td>\n\t\t<H5>{smtp_sasl_auth_enable}</H5>\n\t\t<br>\n\t\t{smtp_sasl_auth_enable_text2}\n\t</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' colspan=2><input type='button' OnClick=\"javascript:EditSasl();\" value='{apply}&nbsp;&raquo;'></td>\n\t</tr>\n\t</table>") . "\n\t<br>\n\t" . RoundedLightGrey("\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'><img src='img/klakcon_285.png'></td>\n\t<td>\n\t\t<H5>{add_credentials}</H5>\n\t<br>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td colspan=2><strong>{isp_server_name}:</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2>" . Field_text('isp_server_name', null) . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td width=1% nowrap align='right'><strong>{username}:</strong></td>\n\t\t\t<td>" . Field_text('username', null) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right'><strong>{password}:</strong></td>\n\t\t\t<td>" . Field_text('password', null) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=2 align='right'><input type='button' value='{add}&nbsp;&raquo;' OnClick=\"javascript:sasl_add_isp_relay();\">\n\t\t</tr>\t\t\t\n\t\t</table>\n\t</td>\n\t</tr>\n\t</table>") . "<br>" . RoundedLightGrey("<H5>{table}</H5><div id='sasllist'></div>");
    $html = "\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=50%>\t\n\t{$form}</td>\n\t<td valign='top'  width=50%>" . RoundedLightGreen("<table style='width:100%'>\n\t<tr><td width=1%>" . imgtootltip('restore-on.png', '{go_back}', "MyHref('artica.wizard.php')") . "</td>\n\t<td><H5>{return_to} {artica_wizard}</H5></td>\n\t</tr></table>") . "<br>{$intro}</td>\n\t</tr>\n\t</table>";
    $cfg["LANG_FILE"] = "artica.wizard.php";
    $cfg["JS"][] = "js/postfix-sasl.js";
    $tpl = new template_users('{send_to_isp}', $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
Esempio n. 15
0
function popup()
{
    if (trim($_GET["MONTH"]) == null) {
        if ($_SESSION["ARTICA_SMTP_DAYS_GRAPH_MONTH"] != null) {
            $_GET["MONTH"] = $_SESSION["ARTICA_SMTP_DAYS_GRAPH_MONTH"];
        } else {
            $_GET["MONTH"] = calcul_month();
            $_SESSION["ARTICA_SMTP_DAYS_GRAPH_MONTH"] = $_GET["MONTH"];
        }
    }
    $field = ArrayDays();
    $html = "<h1>{monthly_statistics} {$_GET["MONTH"]}</H1>\n\t<div style='text-align:right;padding-bottom:9px;'>{$field}</div>\n\t" . RoundedLightWhite("<div style='width:100%;height:450px;overflow:auto'>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td align='center'>" . RoundedBlack("<a href='#' OnClick=\"javascript:ZoomCourbeParMois()\"><img src='" . courbeparmois() . "'></a>") . "</td>\n\t\t</tr>\n\t\t<tr><td>&nbsp;</td></tR>\n\t\t<tr>\n\t\t<td align='center'>" . RoundedLightGrey("<a href='#' OnClick=\"javascript:ZoomCamParMois()\"><img src='" . camparmois() . "'>") . "</a></td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td valign='top'>\n\t\t\t<hr>\n\t\t\t\n\t\t\t<div style='width:100%;height:300px;overflow;auto'>" . tableaudomains() . "</div></td>\n\t\t</tR>\n\t</table></div>");
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 16
0
function section_Fetchmail_Daemon()
{
    $page = CurrentPageName();
    $yum = new usersMenus();
    for ($i = 1; $i < 60; $i++) {
        $hash[$i * 60] = $i;
    }
    $fetch = new fetchmail();
    $list = Field_array_Hash($hash, 'FetchmailPoolingTime', $fetch->FetchmailPoolingTime, null, null, null, 'width:90px');
    $fetchmail_daemon = RoundedLightGrey("\n\t\t<form name=ffmFetch>\n\t\t\t\t\t<center>\n\t\t\t\t\t\n\t\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='right' nowrap><strong>{fetch_messages_every} </strong></td>\n\t\t\t\t\t\t<td align='left'>{$list}  (minutes)</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='right'><strong>{postmaster}</strong></td>\n\t\t\t\t\t\t<td align='left'>" . Field_text('FetchmailDaemonPostmaster', $fetch->FetchmailDaemonPostmaster) . "</td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 align='right'><input type='button' value='{submit}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('ffmFetch','{$page}',true);\"></td>\n\t\t\t\t\t</tr>\t\n\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</center>");
    $title = "{fetchmail}";
    $status = fetchmail_status();
    $html = "<table style='width:600px'>\n\t\t<tr>\n\t\t<td valign='top'><img src='img/bg_fetchmail.jpg'>\n\t\t<td valign='top'>{$status}</td>\n\t\t</tr>\n\t\t<td colspan=2>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t<td valign='top' width=60%>\n\t\t\t\t\t<H5>{fetchmail_daemon_settings}</H5>\n\t\t\t\t\t\t{$fetchmail_daemon}\n\t\t\t\t</td>\n\t\t\t\t<td valing='top'>" . applysettings("fetch") . "\n\t\t\t\t\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t\t</tr>\t\t\t\n\t\t\t\t\t</table>";
    $tpl = new template_users($title, $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
function PageAveServerUpdateConfig()
{
    $yum = new usersMenus();
    $tpl = new templates();
    if ($yum->AsPostfixAdministrator == false) {
        return $tpl->_ENGINE_parse_body("<h3>{not allowed}</H3>");
    }
    include_once dirname(__FILE__) . '/ressources/kav4mailservers.inc';
    $kav = new kav4mailservers(1);
    $array_conf = $kav->array_conf["updater.options"];
    $cron = $kav->CronTask();
    $UseUpdateServerUrl = Field_yesno_checkbox_img('UseUpdateServerUrl', $array_conf["UseUpdateServerUrl"]);
    $UseUpdateServerUrlOnly = Field_yesno_checkbox_img('UseUpdateServerUrlOnly', $array_conf["UseUpdateServerUrlOnly"]);
    $PassiveFtp = Field_yesno_checkbox_img('PassiveFtp', $array_conf["PassiveFtp"]);
    $html = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td valign='top'><img src='img/bg_download.jpg'></td>\n\t\t<td valign='top'>\n\t\t" . RoundedLightGreen("<strong>{schedule}:&laquo; {$cron} &raquo;</strong>") . "<br>" . RoundedLightGrey("<form name=ffmupdate>\n\t\t<input type='hidden' value='{$array_conf["PostUpdateCmd"]}' name='PostUpdateCmd'>\n\t\t<H4>{keepup2date settings}</H4>\n\t\t<table>\n\t\t<tr>\n\t\t<td>{$UseUpdateServerUrl}</td>\n\t\t<td align='left' nowrap>{UseUpdateServerUrl}</td>\n\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t<td>{$UseUpdateServerUrlOnly}</td>\n\t\t<td align='left'>{UseUpdateServerUrlOnly}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td>{$PassiveFtp}</td>\n\t\t<td align='left'>{PassiveFtp}</td>\n\t\t</tr>\t\t\t\n\t\t</table>\n\t\t<table>\n\t\t<tr>\n\t\t<td align='right' nowrap>{UpdateServerUrl}:</td>\n\t\t<td align='left'>" . Field_text('UpdateServerUrl', $array_conf["UpdateServerUrl"]) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td align='right'>{ProxyAddress}:</td>\n\t\t<td align='left'>" . Field_text('ProxyAddress', $array_conf["ProxyAddress"]) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td align='right'>{ConnectTimeout}:</td>\n\t\t<td align='left'>" . Field_text('ConnectTimeout', $array_conf["ConnectTimeout"], '') . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td colspan=2 align='right'><input type='button' OnClick=\"javascript:ParseForm('ffmupdate','users.kav.php',true);\" value='{submit}&nbsp;&raquo;'></td>\n\t\t</tr>\n\t\t</table>\n\t\t</form>") . "<br>\n\n\t\t\n\t\t\t\n\t\t<br>\n\t\t</td>\n\t\t</tr>\n\t\t<tr><td align='center' colspan=2><input type='button' OnClick=\"javascript:KavUpdates()\" value='&laquo;&nbsp;{update_now}&nbsp;&raquo;'></td></tr>\n\t\t<tr><td colspan=2>" . UpdatesError() . UpdatesSuccess() . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t";
    return $tpl->_ENGINE_parse_body($html);
}
Esempio n. 18
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);
}
Esempio n. 19
0
function wizard2()
{
    $sys = new systeminfos();
    while (list($num, $val) = each($sys->array_ip)) {
        $arr[$num] = $num;
    }
    $arr["all"] = "all";
    $arr[""] = '{select}';
    $nics = Field_array_Hash($arr, 'nic_hook', $user->ChangeAutoInterface);
    $main = new main_cf();
    if (is_array($main->array_mynetworks)) {
        $mynetwork = implode(',', $main->array_mynetworks);
    }
    $hash_relay = array("mail" => "mail", "relay" => "relay", "single" => "Hub");
    $fieldrelay = Field_array_Hash($hash_relay, 'relay', $relay_behavior, null, null, 0, 'width:100%;');
    $html = "\n\t<div style='padding:5px;margin:5px;width:100%'>\n\t\t\n\t" . RoundedLightGrey("\t\n\t<H4>{network_settings}</H4>\n\t<table width=100%>\n\t<tr>\n\t<td><img src='img/150-nic.png'></td>\n\t<td valign='top'>\t\n\t\t<table>\n\t\t\t<tr>\n\t\t\t\t<td width=60% class='caption'><H5>{inet_interfaces_title}</H5>{network_settings_text}</td>\n\t\t\t\t<td align='left'>{$nics}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td width=60% class='caption'><h5>{mynetworks_title}:</h5>{mynetworks_single_text}<p class=caption>{$mynetwork}</p></td >\n\t\t\t\t<td style='padding-left:5px' align='left'><input type='button' value='{add}&nbsp;&raquo;'  OnClick=\"javascript:postfix_add_network_v2();\"></td>\n\t\t\t</tr>\t\t\n\t\t\t<tr>\n\t\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t\t<td align='left'>&nbsp;</td>\n\t\t\t\n\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n</table>") . "\n\n<br>" . RoundedLightGrey("\n<H4>{organization}</h4>\t\n<table width=100%>\n\t<tr>\n\t<td colspan=3>\n\t\t<table width=100%>\n\t\t\t<td valign='top'><img src='img/150-org.png'></td>\n\t\t\t<td valign='top'>\t\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=60% class='caption' valign='top' align='right'><h5>{question_company_name}:</H5>\n\t\t\t\t\t\t<td style='padding-left:5px' align='left' class='caption' >" . Field_text('company_name', $_GET["company_name"]) . "</td>\n\t\t\t\t\t</tr>\t\t\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</table>\n\t</td>\n\t<tr><td align='right' colspan=3><input type='button' value='{finish}&nbsp;&raquo;' OnClick=\"javascript:EditWizar1();\"></td></tr>\n\t</tr>\n\t</table>") . "\n\t\n\t\n\t</div>\n\t";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
Esempio n. 20
0
function PageSystem_interfaces()
{
    $tpl = new templates();
    $sys = new systeminfos();
    if (!is_array($sys->array_ip)) {
        return $tpl->_ENGINE_parse_body('{system error} line' . __LINE__);
    }
    while (list($num, $val) = each($sys->array_ip)) {
        $ip = $ip . "<tr>\n\t\t<td width=1%><img src='img/nic-table.jpg'></td>\n\t\t<td width=1%>{$num}</td>\n\t\t<td>{$val["MAC"]}</td>\n\t\t<td >{$val["IP"]}</td>\n\t\t</tr>";
    }
    if (is_array($sys->array_dns_servers)) {
        while (list($num, $val) = each($sys->array_dns_servers)) {
            $count = $count + 1;
            $dns = $dns . "<tr>\n\t\t<td width=1%><img src='img/nic-table.jpg'></td>\n\t\t<td width=50%>{dns_server} {$count}</td>\n\t\t<td width=49%>{$val}</td>\n\t\t</tr>";
        }
    }
    $html = "<table style='width:600px' align=center>\n<tr>\n<td valign='top'>\n\t<img src='img/150-nic.jpg'>\n\t<table style='width:100%;margin-top:5px'>\n\t<tr>\n\t<td valign='top' >" . Paragraphe('folder-equerre-64.jpg', '{nic_static_dns}', '{nic_static_dns_text}', 'system.nic.staticdns.php') . "</td>\n\t</tr>\n\t<tr>\n\t<td valign='top' >" . Paragraphe('64-ip-settings.png', '{net_settings}', '{net_settings_text}', 'system.nic.config.php') . "</td>\n\t</tr>\t\n\t\n\t\n\t\n\t</table>\n\t\n</td>\n<td valign='top'>\t\n" . RoundedLightGrey("\n\t<h5>{nic_interfaces}</H5>\n\t\t<table style='width:70%' align='center'>\n\t\t{$ip}\n\t\t</table>\n\t") . "<br>" . RoundedLightGreen("\n\t<h5>{dns_servers}</H5>\n\t\t<table style='width:70%' align='center'>\n\t\t{$dns}\n\t\t</table>\t\t\n\t\t") . "\n\t</td>\n\t</tr>\n\t</table>";
    return $tpl->_ENGINE_parse_body($html);
}
Esempio n. 21
0
function INDEX()
{
    if (!isset($_GET["ou"])) {
        header('location:domains.index.php');
        exit;
    }
    $page = CurrentPageName();
    $ou = $_GET["ou"];
    $ldap = new clladp();
    $hash = $ldap->OUDatas($ou);
    $ArticaFakedMailFrom_table = array("pass" => '{pass}', "quarantine" => "{quarantine}", "delete" => "{delete}");
    $ArticaFakedMailFrom_field = Field_array_Hash($ArticaFakedMailFrom_table, "ArticaFakedMailFrom", $hash["ArticaFakedMailFrom"], null, null, null, 'width:100px');
    $ArticaDenyNoMXRecords_table = array('pass' => '{pass}', "reject" => "{reject}");
    $ArticaDenyNoMXRecords_field = Field_array_Hash($ArticaDenyNoMXRecords_table, "ArticaDenyNoMXRecords", $hash["ArticaDenyNoMXRecords"], null, null, null, 'width:100px');
    $ArticaOuTrustMyUSers_field = Field_yesno_checkbox_img('OuTrustMyUSers', $hash["OuTrustMyUSers"], '{enable_disable}');
    $ArticaOuTrustMyUSers = "<H5>{trust_users}</H5>\n\t<div class=caption>{trust_users_text}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap><strong>{trust_users}</strong></td>\n\t\t<td align='left' valign='top'>{$ArticaOuTrustMyUSers_field}</td>\n\t\t\n\t</tr>\t\n\t</table>\n\t\n\t";
    $ArticaOuTrustMyUSers = RoundedLightGreen($ArticaOuTrustMyUSers);
    $html = "\n\t<form name='FFMQ'>\n\t<table style='width:100%;'>\n\t<tr>\n\t\t<td width=50% valign='top' style='margin:4px;padding:4px'>\n\t<input type='hidden' name='ou' value='{$ou}'>\n\t" . RoundedLightGrey("<H5>{ArticaFakedMailFrom}</H5>\n\t<div class=caption>{ArticaFakedMailFrom_text}</div>\n\t<table style='width:90%;border:1px solid #CCCCCC;padding:5px;margin:5px'>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap><strong>{ArticaFakedMailFrom}</strong></td>\n\t\t<td align='left' valign='top'>{$ArticaFakedMailFrom_field}</td>\n\t\t\n\t</tr>\n\t</table>") . "</td>\n\t\n\t\n\t<td width=50% valign='top' style='margin:4px;padding:4px'>" . RoundedLightGrey("\n\t<H5>{ArticaDenyNoMXRecords}</H5>\n\t<div class=caption>{ArticaDenyNoMXRecords_text}</div>\n\t<table style='width:90%;border:1px solid #CCCCCC;padding:5px;margin:5px'>\n\t<tr>\n\t\t<td align='right' valign='top' nowrap><strong>{ArticaDenyNoMXRecords}</strong></td>\n\t\t<td align='left' valign='top'>{$ArticaDenyNoMXRecords_field}</td>\n\t\t\n\t</tr>\t\n\t</table>\n\t") . "\n\t<br>\n\t{$ArticaOuTrustMyUSers}\n\t</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2 align='right' style='border-top:1px solid #CCCCCC'><input type='submit' value='{apply}&nbsp;&raquo;' style='width:150px'></td>\n\t</tr>\n\t</table>\n\t</form>";
    $cfg["JS"][] = "js/quarantine.ou.js";
    $tpl = new template_users('{artica_filters_rules}', $html, 0, 0, 0, 0, $cfg);
    echo $tpl->web_page;
}
function LoadDenyCountries($ou)
{
    $ldap = new clladp();
    $oudat = $ldap->OUDatas($ou);
    if (!is_array($oudat["CountryDeny"])) {
        echo "&nbsp;";
        exit;
    }
    $cell = CellRollOver() . " style='font-size:12px'";
    $html = "\n\t<H5>{countries_deny_list}</H5>\n\t<table style='width:60%'>";
    while (list($num, $val) = each($oudat["CountryDeny"])) {
        if (strpos($val, ':') > 0) {
            $tb = explode(":", $val);
            $country = $tb[0];
            $action = $tb[1];
        } else {
            $country = $val;
            $action = "delete";
        }
        $html = $html . "\n\t\t\t<tr>\n\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t<td {$cell}><strong>{$country}</strong></td>\n\t\t\t<td {$cell}><strong>{$action}</strong></td>\n\t\t\t<td {$cell} width=1%>" . imgtootltip('x.gif', '{delete}', "CountryDelete({$num})") . "</td>\n\t\t\t</tr>";
    }
    $tpl = new templates();
    echo "<br>" . RoundedLightGrey($tpl->_ENGINE_parse_body($html . "</table>"));
}
Esempio n. 23
0
function blocker_settings()
{
    $users = new usersMenus();
    $page = CurrentPageName();
    $htmlblocker = new htmlblocker($_GET["ou"]);
    $ou = $_GET["ou"];
    $form = "\n\t\n\t<form name='FFM1'>\n\t<input type='hidden' name=ou value='{$ou}'>\n\t<input type='hidden' name='SaveGeneralSettings' value='yes'>\n\n\t<table style='width:100%'>\n\t<tr>\n\t<td align='right' nowrap><strong>{enable} {htmlSizeBlocker}:</strong></td>\n\t<td>" . Field_yesno_checkbox('BigMailHTMLEnabled', $htmlblocker->BigMailHTMLEnabled) . "</td>\n\t</tr>\n\t<tr>\n\t<td align='right'><strong>{path}:</strong></td>\n\t<td><strong>{$users->ARTICA_FILTER_QUEUE_PATH}/bightml</strong></td>\n\t</tr>\t\t\n\t<tr>\n\t<td align='right'><strong>{maxday}:</strong></td>\n\t<td>" . Field_text('maxday', $htmlblocker->params["config"]["maxday"], 'width:20px') . "</td>\n\t</tr>\n\t<tr>\n\t<td align='right'><strong>{prependsubject}:</strong></td>\n\t<td>" . Field_text('prependsubject', $htmlblocker->params["config"]["prependsubject"], 'width:200px') . "</td>\n\t</tr>\n\t<tr>\n\t<td align='right'><strong>{addhostname}:</strong></td>\n\t<td>" . Field_text('hostname', $htmlblocker->params["config"]["hostname"], 'width:300px') . "</td>\n\t<tr>\n\t<td></td>\n\t<td class=caption>{addhostname_text}</td>\n\t</tr>\t\n\t</tr>\t\n<tr>\n\t<td align='right' colspan=2><input type='button' value='{apply}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('FFM1','{$page}',true);\"></td>\n\t</tr>\t\n\t</table>\n\t</form>\n\t\n\t";
    $form = blocker_tabs() . "<br>" . RoundedLightGrey($form);
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($form);
}
Esempio n. 24
0
function main_status()
{
    $ini = new Bs_IniHandler();
    $sock = new sockets();
    $ini->loadString($sock->getfile('dansguardian_status', $_GET["hostname"]));
    if ($ini->_params["DANSGUARDIAN"]["running"] == 0) {
        $img = "okdanger32.png";
        $status = "{stopped}";
    } else {
        $img = "ok32.png";
        $status = "running";
    }
    $html = "\n<table style='width:1OO%'>\n<tr>\n<td width=1% valign='top'>\n<img src='img/{$img}'></td>\n<td>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td colspan=2>{dansguardian_status}:&nbsp;<span style='font-size:13px'>{$status}</span></strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td align='right' nowrap>{pid}:</strong></td>\n\t\t<td>{$ini->_params["DANSGUARDIAN"]["master_pid"]}</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td align='right'>{memory}:</strong></td>\n\t\t<td>{$ini->_params["DANSGUARDIAN"]["master_memory"]}&nbsp; mb</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td align='right' nowrap>{version}:</strong></td>\n\t\t<td>{$ini->_params["DANSGUARDIAN"]["master_version"]}</strong></td>\n\t\t</tr>\n\t</table>\n\t</td>\n</table>\n";
    $html = RoundedLightGrey($html);
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html . "<br>");
}
function daemons_status()
{
    $users = new usersMenus();
    $artica = new artica_general();
    $tpl = new templates();
    $ldap = new clladp();
    $sql = new mysql();
    $status = new status(1);
    $gd_info = gdinfos();
    if ($ldap->ldapFailed == true) {
        $ldap_error = $ldap->ErrorConnection() . "<br>";
    }
    $all = $status->StatusFailed();
    if ($users->collectd_installed) {
        if ($artica->EnableCollectdDaemon == 1) {
            $collectd = Paragraphe("64-charts.png", "{collectd_statistics}", "{collectd_statistics_text}", "javascript:YahooWin(790,'collectd.index.php?PopUp=yes')", "services_status_text", 300, 76);
        }
    }
    $interface = new networking();
    if (is_array($interface->array_TCP)) {
        while (list($num, $val) = each($interface->array_TCP)) {
            $iptext = $iptext . "<div style='font-size:11px'><strong>{nic}:{$num}:<a href='#' OnClick=\"javascript:Loadjs('system.nic.config.php?js=yes')\">{$val}</a></strong></div>";
        }
    }
    //$manage_services=Paragraphe("folder-tasks2-64.png","{services_status}","{services_status_text}$iptext","admin.index.services.status.php","services_status_text",300,76,1);
    $services = "\n\t{$collectd}\n\t";
    $ini = new Bs_IniHandler();
    $sock = new sockets();
    $ini->loadString($sock->GET_INFO("SmtpNotificationConfig"));
    if (trim($ini->_params["SMTP"]["enabled"] == null)) {
        $js = "javascript:Loadjs('artica.settings.php?ajax-notif=yes')";
        $services = Paragraphe('danger64.png', "{smtp_notification_not_saved}", "{smtp_notification_not_saved_text}", "{$js}", "smtp_notification_not_saved", 300, 80);
    }
    $sock = new sockets();
    $datas = trim($sock->getfile('aptcheck'));
    if (preg_match('#nb:([0-9]+)\\s+#is', $datas, $re)) {
        $services = Paragraphe('i64.png', "{upgrade_your_system}", "{$re[1]}&nbsp;{packages_to_upgrade}", "javascript:Loadjs('artica.repositories.php?show=update')", null, 300, 76);
    }
    if ($users->POSTFIX_INSTALLED) {
        if (!$users->POSTFIX_LDAP_COMPLIANCE) {
            $services = "\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td valign='top' width=1%><img src='img/rouage_off.png'></td>\n\t\t\t\t\t<td valign='top'><a href='#' OnClick=\"javascript:YahooWin(600,'index.remoteinstall.php','Install');\">\n\t\t\t\t\t<H5>{error_postfix_ldap_compliance}</H5><p class=caption>{error_postfix_ldap_compliance_text}\n\t\t\t\t\t</A>\n\t\t\t\t\t</p></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>";
            $services = RoundedLightYellow($services);
        } else {
            $ok = true;
            $main = new main_cf();
            if (!is_array($main->array_mynetworks)) {
                $ok = false;
            } else {
                while (list($num, $ligne) = each($main->array_mynetworks)) {
                    if ($ligne != "127.0.0.1") {
                        $rr[] = $ligne;
                    }
                }
                if (count($rr) == 0) {
                    $ok = false;
                }
            }
            if (!$ok) {
                $services = "<div id='servinfos'>" . Paragraphe('danger64.png', '{postfix_mynet_not_conf}', '{postfix_mynet_not_conf_text}', "postfix.network.php", null, 300, 73) . "</div>";
            }
        }
    }
    if ($users->BadMysqlPassword == 1) {
        $services = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/superuser-64-bad.png'></td>\n\t<td valign='top'><H5>{error_mysql_user}</H5><p class=caption>{error_mysql_user_text}</p></td>\n\t</tr>\n\t</table>";
        $services = RoundedLightGrey($services, "artica.settings.php", 1);
    }
    //
    if (!$users->POSTFIX_INSTALLED) {
        if ($users->SAMBA_INSTALLED) {
            $sock = new sockets();
            $SambaEnabled = $sock->GET_INFO("SambaEnabled");
            if ($SambaEnabled == null) {
                $SambaEnabled = 1;
            }
            if ($SambaEnabled == 1) {
                $samba = Paragraphe("64-share.png", '{SHARE_FOLDER}', '{SHARE_FOLDER_TEXT}', "javascript:Loadjs('SambaBrowse.php');", "SHARE_FOLDER_TEXT", 300, 76, 1);
            }
        }
    }
    $newversion = null;
    if (is_file(dirname(__FILE) . "/ressources/index.ini")) {
        $ini = new Bs_IniHandler(dirname(__FILE) . "/ressources/index.ini");
        $remote_version = $ini->_params["NEXT"]["artica"];
        $local_version = $users->ARTICA_VERSION;
        $remote_version_bin = str_replace('.', '', $remote_version);
        $local_version_bin = str_replace('.', '', $local_version);
        if ($local_version < $remote_version) {
            $newversion = Paragraphe('i64.png', "{upgrade_artica} {$remote_version}", "{upgrade_artica_text}", "javascript:Loadjs('artica.update.php?js=yes')", null, 300, 76);
        }
    }
    $final = "\n\t{$switch}\n\t{$ldap_error}\n\t{$all}\n\t{$pureftp_error}\n\t{$samba}\n\t{$newversion}\n\t{$check_apt}";
    file_put_contents('/usr/share/artica-postfix/ressources/logs/status.global.html', $final);
    system('/bin/chmod 755 /usr/share/artica-postfix/ressources/logs/status.global.html');
}
Esempio n. 26
0
function main_config_mimedefang()
{
    $users = new usersMenus();
    if (!$users->MIMEDEFANG_INSTALLED) {
        return null;
    }
    $users->LoadModulesEnabled();
    if ($users->MimeDefangEnabled != 1) {
        return null;
    }
    $sock = new sockets();
    $ini = new Bs_IniHandler();
    $ini->loadString($sock->GET_INFO("ArticaPerformancesSettings"));
    $MX_REQUESTS = $ini->_params["MIMEDEFANG"]["MX_REQUESTS"];
    if ($MX_REQUESTS == null) {
        $MX_REQUESTS = 200;
    }
    $MX_MINIMUM = $ini->_params["MIMEDEFANG"]["MX_MINIMUM"];
    if ($MX_MINIMUM == null) {
        $MX_MINIMUM = 2;
    }
    $MX_MAXIMUM = $ini->_params["MIMEDEFANG"]["MX_MAXIMUM"];
    if ($MX_MAXIMUM == null) {
        $MX_MAXIMUM = 10;
    }
    $MX_MAX_RSS = $ini->_params["MIMEDEFANG"]["MX_MAX_RSS"];
    if ($MX_MAX_RSS == null) {
        $MX_MAX_RSS = 30000;
    }
    $MX_MAX_AS = $ini->_params["MIMEDEFANG"]["MX_MAX_AS"];
    if ($MX_MAX_AS == null) {
        $MX_MAX_AS = 90000;
    }
    if ($MX_REQUESTS > 900) {
        $mimedefang_macro = 1;
    }
    if ($MX_REQUESTS < 300) {
        $mimedefang_macro = 2;
    }
    if ($MX_REQUESTS < 101) {
        $mimedefang_macro = 3;
    }
    if ($MX_REQUESTS < 60) {
        $mimedefang_macro = 4;
    }
    $arrp = array(0 => '{select}', 1 => "{high}", 2 => "{medium}", 3 => "{low}", 4 => '{very_low}');
    $arrp = Field_array_Hash($arrp, 'mimedefang_macro', $mimedefang_macro, "mimedefang_macro()");
    $html = "<H5>{mimedefang_consumption}</h5>\n\t<p class=caption>{mimedefang_consumption_text}</p>\n\t\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td nowrap width=1% align='right'><strong>{mimedefang_macro}:</strong></td>\n\t\t<td>{$arrp}</td>\t\n\t\t</tr>\n\t</table>\n\t\n<form name=ffmmimedefang>\n<table style='width:100%'>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_REQUESTS}:</strong></td>\n\t<td>" . Field_text('MX_REQUESTS', $MX_REQUESTS, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_REQUESTS_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MINIMUM}:</strong></td>\n\t<td>" . Field_text('MX_MINIMUM', $MX_MINIMUM, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MINIMUM_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MAXIMUM}:</strong></td>\n\t<td>" . Field_text('MX_MAXIMUM', $MX_MAXIMUM, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MAXIMUM_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MAX_RSS}:</strong></td>\n\t<td>" . Field_text('MX_MAX_RSS', $MX_MAX_RSS, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MAX_RSS_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MAX_AS}:</strong></td>\n\t<td>" . Field_text('MX_MAX_AS', $MX_MAX_AS, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MAX_AS_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td colspan=2 align='right'><input type=button OnClick=\"javascript:ParseForm('ffmmimedefang','{$page}',true);\" value='{apply}&nbsp;&raquo;'>\n</tr>\n</table>\n</form>\t";
    $tpl = new templates();
    return "<div style='float:left;margin:4px;width:300px'>" . RoundedLightGrey($tpl->_ENGINE_parse_body($html)) . "</div>";
}
Esempio n. 27
0
function LoadFetchMailRuleFromUser()
{
    $ldap = new clladp();
    $u = $ldap->UserDatas($_GET["LoadFetchMailRuleFromUser"]);
    $fr = new Fetchmail_settings();
    $tpl = new templates();
    while (list($num, $ligne) = each($u["FetchMailsRulesSources"])) {
        $arr = $fr->parse_config($ligne);
        $arr = $arr[1];
        $line = "\n\t\t<table>\n\t\t<tr>\n\t\t<td width=1% valign='top'><img src='img/fw_bold.gif'></td>\n\t\t<td width=1% nowrap valign='top'>{rule} {$num}</td>\n\t\t<td>" . $arr["poll"] . " {from} " . $arr["user"] . " {to} " . $arr["is"] . "</td>\n\t\t</tr>\n\t\t</table>";
        $res[] = RoundedLightGrey($tpl->_ENGINE_parse_body($line), "javascript:UserFetchMailRule({$num},'{$_GET["LoadFetchMailRuleFromUser"]}');", 1);
    }
    echo $tpl->_ENGINE_parse_body(implode("<br>", $res));
    echo $list;
}
Esempio n. 28
0
function COMPUTER_FIND()
{
    $gpid = $_GET["gpid"];
    $ou = $_GET["ou"];
    $tofind = $_GET["find_computer"];
    $ldap = new clladp();
    if ($tofind == null) {
        $tofind = '*';
    } else {
        $tofind = "*{$tofind}*";
    }
    $filter = "(&(objectClass=ArticaComputerInfos)(|(cn={$tofind})(ComputerIP={$tofind})(uid={$tofind}))(gecos=computer))";
    $attrs = array("uid", "ComputerIP", "ComputerOS");
    $dn = "dc=samba,{$ldap->suffix}";
    $html = "\n<input type='hidden' id='add_computer_confirm' value='{add_computer_confirm}'>\n<table style='width:100%'>";
    $hash = $ldap->Ldap_search($dn, $filter, $attrs);
    for ($i = 0; $i < $hash["count"]; $i++) {
        $realuid = $hash[$i]["uid"][0];
        $hash[$i]["uid"][0] = str_replace('$', '', $hash[$i]["uid"][0]);
        $html = $html . "<tr " . CellRollOver() . ">\n\t<td width=1%><img src='img/base.gif'></td>\n\t<td><strong>{$hash[$i]["uid"][0]}</strong></td>\n\t<td><strong>{$hash[$i][strtolower("ComputerIP")][0]}</strong></td>\n\t<td><strong>{$hash[$i][strtolower("ComputerOS")][0]}</strong></td>\n\t<td width=1%>" . imgtootltip('plus-16.png', '{add_computer}', "javascript:add_computer_selected('{$gpid}','{$hash[$i]["dn"]}','{$hash[$i]["uid"][0]}','{$realuid}')") . "</td>\n\t</tr>\n\t";
    }
    $html = $html . "</table>";
    $html = RoundedLightGrey($html);
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 29
0
function freshclam_mirrors()
{
    $clam = new clamav();
    $html = "<br><table style='width:100%'>";
    if (is_array($clam->freshclam_mirrors_selected)) {
        while (list($num, $line) = each($clam->freshclam_mirrors_selected)) {
            $html = $html . "<tr>\n\t\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t\t<td><strong style=font-size:13px'><code>{$num}</code></td>\n\t\t\t\t<td>" . imgtootltip('ed_delete.gif', '{delete}', "FresgClamMirrorDelete('{$num}')") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t";
        }
    }
    $html = $html . "</table>";
    $tpl = new templates();
    $html = $tpl->_ENGINE_parse_body($html);
    return RoundedLightGrey($html);
}
Esempio n. 30
0
function RightInfos()
{
    $kas = new kas_filter();
    $st = RoundedLightGrey($kas->KasStatus() . "</table>");
    $html = applysettings("kas") . "<br>{$st}";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}