Пример #1
0
function DaemonErrors()
{
    $kav = new kav4mailservers(1);
    $daemon_errors = $kav->DaemonErrors();
    if (is_array($daemon_errors)) {
        $html = $html . "<H4>{daemon_error}</H4>\n\t\t\t<center>\n\t\t\t<table style='width:100%'>\n\t\t\t<tr style='background-color:#005447;'>\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td style='color:white;font-weight:bold' width=5%>{date}</td>\n\t\t\t<td style='color:white;font-weight:bold'>{details}</td>\n\t\t\t</tr>";
        while (list($key, $val) = each($daemon_errors)) {
            if (preg_match('#\\[([0-9\\-:\\s\\/]+).+?\\]#', $val, $reg)) {
                $val = str_replace($reg[0], '', $val);
                $count = $count + 1;
                $html = $html . "<tr>\n\t\t\t\t<td width=1% class='bottom'><img src='img/status_warning.jpg'></td>\n\t\t\t\t<td class='bottom' nowrap><div style='color:red;font-size:10px;padding:3px;'>{$reg[1]}</div></td>\n\t\t\t\t<td class='bottom'><div style='color:red;font-size:11px;padding:3px;'>{$val}</div></td>\n\t\t\t\t</tR>";
            }
        }
        $html = $html . "</table></center>";
    }
    if ($count > 0) {
        return $html;
    }
}
function UpdatesSuccess()
{
    $kav = new kav4mailservers(1);
    $updates_success = $kav->UpdatesSuccess();
    if (is_array($updates_success)) {
        $html = $html . "<H5>{updates_success}</H5>\n\t\t\t<center>\n\t\t\t<table style='width:450px'>\n\t\t\t<tr style='background-color:#005447;'>\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td style='color:white;font-weight:bold'  width=5%>{date}</td>\n\t\t\t<td style='color:white;font-weight:bold'>{details}</td>\n\t\t\t</tr>";
        while (list($key, $val) = each($updates_success)) {
            if ($count > 5) {
                break;
            }
            if (preg_match('#\\[([0-9\\-:\\s\\/]+).+?\\]#', $val, $reg)) {
                $val = str_replace($reg[0], '', $val);
                $count = $count + 1;
                $html = $html . "<tr>\n\t\t\t\t<td width=1% class='bottom'><img src='img/status_ok.jpg'></td>\n\t\t\t\t<td class='bottom' nowrap><div style='color:blue;font-size:11px;padding:3px;'>{$reg[1]}</div></td>\n\t\t\t\t<td class='bottom'><div style='color:blue;font-size:11px;padding:3px;'>{$val}</div></td>\n\t\t\t\t</tR>";
            }
        }
        $html = $html . "</table></center>";
    }
    return $html;
}
Пример #3
0
function kasperskyactions()
{
    $domain = $_GET["kasperskyactions"];
    $kav4mailservers = new kav4mailservers();
    unset($_GET["kasperskyactions"]);
    $_GET["Check"] = "yes";
    $_GET["AddXHeaders"] = "yes";
    $_GET["Recipients"] = '.*@' . str_replace('.', '\\.', $domain);
    $_GET["QuarantinePath"] = dirname(__FILE__) . "/kaspersky/quarantines/{$domain}";
    $kav4mailservers->EditAvSettingsDomain($domain, $_GET);
    echo LoadKasperskySettings($domain);
}
Пример #4
0
function List_domains($ou = null)
{
    if ($ou == null) {
        return null;
    }
    $ldap = new clladp();
    $hash = $ldap->hash_get_domains_ou($ou);
    $kav4mailservers = new kav4mailservers();
    if (!is_array($hash)) {
        return null;
    }
    $html = "\n\t<fieldset>\n\t<legend>{ARRAY_TITLE}</legend>\n\t<table style='width:95%' align='center'>\n\t<tr class=rowT>\n\t\t\n\t\t<td colspan=2>&nbsp;</TD>\n\t\t<td nowrap>{ARRAY_TITLE_TRANSPORT}</TD>\n\t\t<td nowrap>{ARRAY_TITLE_USERS}</TD>\n\t\t<td nowrap>{ARRAY_TITLE_AV}</TD>\n\t\t<td>&nbsp;</TD>\n\t\n\t</TR>\n\t";
    while (list($num, $ligne) = each($hash)) {
        if ($class = 'rowA') {
            $class = 'rowB';
        } else {
            $class = "rowA";
        }
        $users_numbers = 0;
        $users_numbers = $ldap->HashGetUsersAccounts($ou, $ligne);
        $redirect = $ldap->GetTransportTable($ligne);
        if ($redirect == null) {
            $redirect = "local/dns";
        }
        if ($kav4mailservers->IsDomainLicenced($ligne) == true) {
            $kav = "<img src='img/status_ok.jpg'>";
        } else {
            $kav = "<img src='img/status_permission.gif'>";
        }
        $html = $html . "<tr class={$class}>\n\t\t<td  align='center' valign='top' width=1%>\n\t\t\t<img src='img/upload.gif'>\n\t\t</td>\n\t\t<td valign='top' style='font-size:13px;letter-spacing:3px'>\n\t\t\t<a href='domains.edit.php?domain={$ligne}&ou={$ou}' style='font-size:13px;' onMouseOver=\"javascript:AffBulle('{js_expand_domain}');\" OnMouseOut=\"javascript:HideBulle();\" >{$ligne}</a>\n\t\t</td>\n\t\t<td width=1% align='center'>{$redirect}</td>\n\t\t<td width=1% align='center'>" . count($users_numbers) . "</td>\n\t\t<td width=1% align='center'>{$kav}</td>\n\t\t<td width=1%  valign='top'><a href=\"javascript:DelDomain('{$ligne["domain"]}','');\"><img src='img/deluser.gif' onMouseOver=\"javascript:AffBulle('{js_del_domain}');\" OnMouseOut=\"javascript:HideBulle();\"></a></td>\t\t\n\t\t</tr>";
    }
    $tpl = new Templates();
    $html = $tpl->_parse_body($html);
    return $html . "</table></fieldset>";
}
Пример #5
0
function SaveFunctions()
{
    $key = $_GET["KEY"];
    unset($_GET["KEY"]);
    $conf = new kav4mailservers(0, null, 1);
    while (list($num, $ligne) = each($_GET)) {
        $conf->array_conf[$key][$num] = $ligne;
    }
    $conf->Save();
    $conf->SaveToServer();
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body('{success}');
}
Пример #6
0
function LicenseDomain_Delete()
{
    $domain = $_GET["LicenseDomain_Delete"];
    $kav4mailservers = new kav4mailservers();
    if ($kav4mailservers->error == true) {
        return "{error_no_socks}";
    }
    while (list($num, $ligne) = each($kav4mailservers->LicenseDomains)) {
        if ($ligne == $domain) {
            unset($kav4mailservers->LicenseDomains[$num]);
        }
    }
    $kav4mailservers->Save();
    echo protected_domains();
}
Пример #7
0
function LoadAvNotify()
{
    $notify = $_GET["LoadAvNotify"];
    if (!isset($_GET["LoadAvNotifyType"])) {
        $_GET["LoadAvNotifyType"] = "recipient";
    }
    $LoadAvNotifyType = $_GET["LoadAvNotifyType"];
    $kas = new kav4mailservers();
    $notifyLdapField = "TemplateNotify{$notify}{$LoadAvNotifyType}";
    $Htemplate = $kas->Load_template_notify_datas($notify, $LoadAvNotifyType);
    $subject = $Htemplate["SUBJECT"];
    $templ = $Htemplate["TPL"];
    $page = CurrentPageName();
    //ParseForm
    $html = "<div style='padding:5px;margin:5px'>\n\t\t<h4>{notify_templates} &laquo;{$notify}&raquo;</h4>\n\t\t\n\t\t" . FieldTabNotify() . "\n\t\t<form name='{$notifyLdapField}'>\n\t\t<input type='hidden' name='LdapField' value='{$notifyLdapField}'>\n\t\t<input type='hidden' name='NotifyAction'  value='{$LoadAvNotifyType}'>\n\t\t<input type='hidden' name='notifydest'  value='{$notify}'>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td colspan=2 class=caption style='margin:3px'>{" . $notify . "}&nbsp;&raquo;&raquo;&nbsp;{" . "{$LoadAvNotifyType}} </td>\n\t\t</tr>\n\t\t<tr><td colspan=2 class=caption style='margin:3px'>&nbsp;</td></tr>\t\t\n\t\t<tr>\n\t\t<td align='right' nowrap>{subject}</td>\n\t\t<td>" . Field_text('subject', $subject) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=2><textarea name='body_template' style='width:100%' rows=20>{$templ}</textarea></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=2 align='right'><input type='button' value='{edit}&nbsp&raquo;' OnClick=\"javascript:ParseForm('{$notifyLdapField}','{$page}',true);\"></td>\n\t\t</tr>\t\t\n\t\t</table>\n\t\t<div class=caption>%SENDER%, %RECIPIENT%,, %DATE%, %VIRUSNAME%, %MSGID%, %SUBJECT%, %DATETIME%, %HEADERS%, %ACTION%</div>\n\t\t";
    $tpl = new templates();
    echo $tpl->_parse_body($html);
}