function GeneralSettings()
{
    $ave = new kav4mailservers(1, null, 1);
    $page = CurrentPageName();
    $tpl = new Templates(null, null, null, 1);
    $html = Tabs() . "\n\t<fieldset>\n\t\t<legend>{general_settings}</legend>\n\t<form name='ffm1'>\t\t\n\t<table style='width:100%'>\n\t<input type='hidden' name='KEY' value='smtpscan.general'>\n\t\t<tr>\n\t\t\t<td align='right' nowrap><strong>{NotifyFromAddress}:</strong></td>\n\t\t\t<td>" . Field_text('NotifyFromAddress', $ave->array_conf["smtpscan.general"]["NotifyFromAddress"]) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t<tr>\n\t\t\t<td align='right' valign='top'>" . Field_yesno_checkbox_img('EHLOsupport8BITMIME', $ave->array_conf["smtpscan.general"]["EHLOsupport8BITMIME"], '{enable_disable}') . "</td>\n\t\t\t<td align='left' class='caption'><strong>:{EHLOsupport8BITMIME}</strong>{EHLOsupport8BITMIME_text}</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t\n\t\t<tr>\n\t\t\t<td align='right' valign='top'>" . Field_yesno_checkbox_img('EHLOsupportDSN', $ave->array_conf["smtpscan.general"]["EHLOsupportDSN"], '{enable_disable}') . "</td>\n\t\t\t<td align='left' class=caption><strong>:{EHLOsupportDSN}</strong>{EHLOsupportDSN_text}</td>\n\t\t</tr>\n\t\t\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t<tr>\n\t\t\t<td align='right' valign='top'>" . Field_yesno_checkbox_img('EHLOsupportXFORWARD', $ave->array_conf["smtpscan.general"]["EHLOsupportXFORWARD"], '{enable_disable}') . "</td>\n\t\t\t<td align='left'><strong>:{EHLOsupportXFORWARD}</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><strong>{EHLOattrsXFORWARD}:</strong></td>\n\t\t\t<td align='right' valign='top'>" . Field_text('EHLOattrsXFORWARD', $ave->array_conf["smtpscan.general"]["EHLOattrsXFORWARD"]) . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t<td>&nbsp;</td>\n\t\t<td class='caption'>{EHLOsupportXFORWARD_text}<br><b>protocol:</b>{$ave->array_conf["smtpscan.general"]["Protocol"]} &laquo&nbsp;{$ave->array_conf["smtpscan.general"]["ForwardMailer"]}&nbsp;&raquo</td>\n\t\t</tr>\n\t\t<tr><td colspan=2 style='text-align:right;padding-right:10px'><input type='button' value='{submit}&nbsp;&raquo;' OnClick=\"javascript:ParseForm('ffm1','{$page}',true);\"></td></tr>\n\t</table>\n\t</form>\n\t</fieldset>";
    return $tpl->_ENGINE_parse_body($html);
}
function PostfixLoadeMailsQueue()
{
    $tpl = new templates();
    $tot = $_GET["total"];
    if (!isset($_GET["numStart"])) {
        $numStart = 0;
    }
    if (!isset($_GET["tab"])) {
        $tab = 0;
    } else {
        $tab = $_GET["tab"];
    }
    if ($tab == '') {
        $tab = 0;
    }
    $queue_name = $_GET["PostfixLoadeMailsQueue"];
    $ini = new Bs_IniHandler();
    if (!is_file('ressources/databases/postfix-queue-cache.conf')) {
        return $tpl->_ENGINE_parse_body("{no_cache_created}");
    }
    $ini->loadFile('ressources/databases/postfix-queue-cache.conf');
    $PagesNumber = $ini->get($queue_name, 'PagesNumber');
    if ($PagesNumber > 0) {
        $tabublation = Tabs($PagesNumber, $queue_name);
    }
    $filetemp = "ressources/databases/queue.list.{$tab}.{$queue_name}.cache";
    if (!is_file($filetemp)) {
        return $tpl->_ENGINE_parse_body("<strong>{unable_to_locate}: {$filetemp}</strong>");
    }
    $datas = explode("\n", file_get_contents($filetemp));
    $countRows = count($datas);
    $number_pages = round($tot / $countRows);
    $html = "\n\t<H4>{queue} {$queue_name} {$PagesNumber} {pages}  {$countRows} {lines}</H4>\n\t<div align='right' class=caption>{from_cache_file} {$filetemp}</div>\n\t{$tabublation}\n\t<table style='width:100%'>\n\t<tr class='caption'>\n\t<td><strong>{date}</strong></td>\n\t<td><strong>{operation}</strong></td>\n\t<td><strong>{mail_from}</strong></td>\n\t<td><strong>{mail_to}</strong></td>\n\t<td><strong>{delete}</strong></td>\n\t</tr>\n\t";
    while (list($num, $val) = each($datas)) {
        $val = str_replace('<sender></sender>', '<sender>unknown</sender>', $val);
        if (preg_match('#<file>(.+?)</file><path>(.+?)</path><time>(.+?)</time><named_attr>(.+?)</named_attr><sender>(.+?)</sender><recipient>(.+?)</recipient><subject>(.+?)</subject>#', $val, $regs)) {
            $file = $regs[1];
            $path = $regs[2];
            $time = PostFixTimeToPhp($regs[3]);
            $named = $regs[4];
            $sender = $regs[5];
            $recipient = $regs[6];
            $subject = utf8_decode($subject);
            $subject = htmlentities('"' . $regs[7] . '"');
            $varClick = "OnClick=\"javascript:LoadMailID('{$file}','{$queue_name}','{$tab}')\"";
            $tooltips = "<strong>{$file}</strong><br>{$subject}";
            $html = $html . "\n\t\t\t<tr " . CellRollOver(null, $tooltips) . " class=caption>\n\t\t\t<td nowrap {$varClick}>{$time}</td>\n\t\t\t<td {$varClick}>{$named}</td>\n\t\t\t<td {$varClick}>{$sender}</td>\n\t\t\t<td {$varClick}>{$recipient}</td>\n\t\t\t<td align='center' width=1%>" . imgtootltip('x.gif', '{delete}', "DeleteMailID('{$queue_name}','{$tab}','{$file}')") . "</td>\n\t\t\t</tr>\n\t\t\t";
            $count = $count + 1;
            if ($count > 100) {
                break;
            }
        }
    }
    $tpl = new templates();
    $html = $tpl->_ENGINE_parse_body($html);
    $html = $html . "</table>";
    return $html;
}
Beispiel #3
0
function kav_page()
{
    $gidNumber = $_SESSION["privileges"]["gidNumber"];
    if (preg_match('#kav:([0-9]+)#', $_GET["TreeKasSelect"], $reg)) {
        $gidNumber = $reg[1];
    }
    $ldap = new clladp();
    $HashGroup = $ldap->GroupDatas($gidNumber);
    $ini = new Bs_IniHandler();
    $ini->loadString($HashGroup["KasperkyAVScanningDatas"]);
    $hash = $ini->_params["smtpscan.group:{$gidNumber}"];
    $CuredQuarantine = Field_yesno_checkbox_img("CuredQuarantine", $hash["CuredQuarantine"]);
    $InfectedQuarantine = Field_yesno_checkbox_img("InfectedQuarantine", $hash["InfectedQuarantine"]);
    $SuspiciousQuarantine = Field_yesno_checkbox_img("SuspiciousQuarantine", $hash["SuspiciousQuarantine"]);
    $CorruptedQuarantine = Field_yesno_checkbox_img("CorruptedQuarantine", $hash["CorruptedQuarantine"]);
    $WarningQuarantine = Field_yesno_checkbox_img("WarningQuarantine", $hash["WarningQuarantine"]);
    $FilteredQuarantine = Field_yesno_checkbox_img("FilteredQuarantine", $hash["FilteredQuarantine"]);
    $ErrorQuarantine = Field_yesno_checkbox_img("ErrorQuarantine", $hash["ErrorQuarantine"]);
    $ProtectedQuarantine = Field_yesno_checkbox_img("ProtectedQuarantine", $hash["ProtectedQuarantine"]);
    $CuredAdminNotify = Field_yesno_checkbox_img("CuredAdminNotify", $hash["CuredAdminNotify"]);
    $InfectedAdminNotify = Field_yesno_checkbox_img("InfectedAdminNotify", $hash["InfectedAdminNotify"]);
    $SuspiciousAdminNotify = Field_yesno_checkbox_img("SuspiciousAdminNotify", $hash["SuspiciousAdminNotify"]);
    $CorruptedAdminNotify = Field_yesno_checkbox_img("CorruptedAdminNotify", $hash["CorruptedAdminNotify"]);
    $WarningAdminNotify = Field_yesno_checkbox_img("WarningAdminNotify", $hash["WarningAdminNotify"]);
    $FilteredAdminNotify = Field_yesno_checkbox_img("FilteredAdminNotify", $hash["FilteredAdminNotify"]);
    $ErrorAdminNotify = Field_yesno_checkbox_img("ErrorAdminNotify", $hash["ErrorAdminNotify"]);
    $ProtectedAdminNotify = Field_yesno_checkbox_img("ProtectedAdminNotify", $hash["ProtectedAdminNotify"]);
    $arrayA = array("unchanged" => "Unchanged", "remove" => "Remove");
    $arrayB = array("unchanged" => "Unchanged", "remove" => "Remove", "cured" => "Cured");
    $CuredAdminAction = Field_array_Hash($arrayB, "CuredAdminAction", $hash["CuredAdminAction"]);
    $InfectedAdminAction = Field_array_Hash($arrayA, "InfectedAdminAction", $hash["InfectedAdminAction"]);
    $SuspiciousAdminAction = Field_array_Hash($arrayA, "SuspiciousAdminAction", $hash["SuspiciousAdminAction"]);
    $CorruptedAdminAction = Field_array_Hash($arrayA, "CorruptedAdminAction", $hash["CorruptedAdminAction"]);
    $WarningAdminAction = Field_array_Hash($arrayA, "WarningAdminAction", $hash["WarningAdminAction"]);
    $FilteredAdminAction = Field_array_Hash($arrayA, "FilteredAdminAction", $hash["FilteredAdminAction"]);
    $ErrorAdminAction = Field_array_Hash($arrayA, "ErrorAdminAction", $hash["ErrorAdminAction"]);
    $ProtectedAdminAction = Field_array_Hash($arrayA, "ProtectedAdminAction", $hash["ProtectedAdminAction"]);
    $CuredRecipientAction = Field_array_Hash($arrayB, "CuredRecipientAction", $hash["CuredRecipientAction"]);
    $InfectedRecipientAction = Field_array_Hash($arrayA, "InfectedRecipientAction", $hash["InfectedRecipientAction"]);
    $SuspiciousRecipientAction = Field_array_Hash($arrayA, "SuspiciousRecipientAction", $hash["SuspiciousRecipientAction"]);
    $CorruptedRecipientAction = Field_array_Hash($arrayA, "CorruptedRecipientAction", $hash["CorruptedRecipientAction"]);
    $WarningRecipientAction = Field_array_Hash($arrayA, "WarningRecipientAction", $hash["WarningRecipientAction"]);
    $FilteredRecipientAction = Field_array_Hash($arrayA, "FilteredRecipientAction", $hash["FilteredRecipientAction"]);
    $ErrorRecipientAction = Field_array_Hash($arrayA, "ErrorRecipientAction", $hash["ErrorRecipientAction"]);
    $ProtectedRecipientAction = Field_array_Hash($arrayA, "ProtectedRecipientAction", $hash["ProtectedRecipientAction"]);
    $CuredSenderNotify = Field_yesno_checkbox_img("CuredSenderNotify", $hash["CuredSenderNotify"]);
    $InfectedSenderNotify = Field_yesno_checkbox_img("InfectedSenderNotify", $hash["InfectedSenderNotify"]);
    $SuspiciousSenderNotify = Field_yesno_checkbox_img("SuspiciousSenderNotify", $hash["SuspiciousSenderNotify"]);
    $CorruptedSenderNotify = Field_yesno_checkbox_img("CorruptedSenderNotify", $hash["CorruptedSenderNotify"]);
    $WarningSenderNotify = Field_yesno_checkbox_img("WarningSenderNotify", $hash["WarningSenderNotify"]);
    $FilteredSenderNotify = Field_yesno_checkbox_img("FilteredSenderNotify", $hash["FilteredSenderNotify"]);
    $ErrorSenderNotify = Field_yesno_checkbox_img("ErrorSenderNotify", $hash["ErrorSenderNotify"]);
    $ProtectedSenderNotify = Field_yesno_checkbox_img("ProtectedSenderNotify", $hash["ProtectedSenderNotify"]);
    $CuredRecipientNotify = Field_yesno_checkbox_img("CuredRecipientNotify", $hash["CuredRecipientNotify"]);
    $InfectedRecipientNotify = Field_yesno_checkbox_img("InfectedRecipientNotify", $hash["InfectedRecipientNotify"]);
    $SuspiciousRecipientNotify = Field_yesno_checkbox_img("SuspiciousRecipientNotify", $hash["SuspiciousRecipientNotify"]);
    $CorruptedRecipientNotify = Field_yesno_checkbox_img("CorruptedRecipientNotify", $hash["CorruptedRecipientNotify"]);
    $WarningRecipientNotify = Field_yesno_checkbox_img("WarningRecipientNotify", $hash["WarningRecipientNotify"]);
    $FilteredRecipientNotify = Field_yesno_checkbox_img("FilteredRecipientNotify", $hash["FilteredRecipientNotify"]);
    $ErrorRecipientNotify = Field_yesno_checkbox_img("ErrorRecipientNotify", $hash["ErrorRecipientNotify"]);
    $ProtectedRecipientNotify = Field_yesno_checkbox_img("ProtectedRecipientNotify", $hash["ProtectedRecipientNotify"]);
    $CuredRecipientAttachReport = Field_yesno_checkbox_img("CuredRecipientAttachReport", $hash["CuredRecipientAttachReport"]);
    $InfectedRecipientAttachReport = Field_yesno_checkbox_img("InfectedRecipientAttachReport", $hash["InfectedRecipientAttachReport"]);
    $SuspiciousRecipientAttachReport = Field_yesno_checkbox_img("SuspiciousRecipientAttachReport", $hash["SuspiciousRecipientAttachReport"]);
    $CorruptedRecipientAttachReport = Field_yesno_checkbox_img("CorruptedRecipientAttachReport", $hash["CorruptedRecipientAttachReport"]);
    $WarningRecipientAttachReport = Field_yesno_checkbox_img("WarningRecipientAttachReport", $hash["WarningRecipientAttachReport"]);
    $FilteredRecipientAttachReport = Field_yesno_checkbox_img("FilteredRecipientAttachReport", $hash["FilteredRecipientAttachReport"]);
    $ErrorRecipientAttachReport = Field_yesno_checkbox_img("ErrorRecipientAttachReport", $hash["ErrorRecipientAttachReport"]);
    $ProtectedRecipientAttachReport = Field_yesno_checkbox_img("ProtectedRecipientAttachReport", $hash["ProtectedRecipientAttachReport"]);
    $Check = Field_yesno_checkbox_img("Check", $hash["Check"]);
    $AddXHeaders = Field_yesno_checkbox_img("AddXHeaders", $hash["AddXHeaders"]);
    if ($hash["QuarantinePath"] != null) {
        $QuarantinePath = basename($hash["QuarantinePath"]);
        $QuarantinePath = "\n\t\t<tr class=rowA>\n\t\t\t<td align='right'>{QuarantinePath}</td>\n\t\t\t<td>{$QuarantinePath}</td>\n\t\t</tr>";
    }
    $Infected_row = texttooltip('{Infected}', '{click_to_change_notif_content}', "LoadAvNotify('Infected')");
    $Cured_row = texttooltip('{Cured}', '{click_to_change_notif_content}', "LoadAvNotify('Cured')");
    $Suspicious_row = texttooltip('{Suspicious}', '{click_to_change_notif_content}', "LoadAvNotify('Suspicious')");
    $Corrupted_row = texttooltip('{Corrupted}', '{click_to_change_notif_content}', "LoadAvNotify('Corrupted')");
    $Warning_row = texttooltip('{Warning}', '{click_to_change_notif_content}', "LoadAvNotify('Warning')");
    $Filtered_row = texttooltip('{Filtered}', '{click_to_change_notif_content}', "LoadAvNotify('Filtered')");
    $Error_row = texttooltip('{Error}', '{click_to_change_notif_content}', "LoadAvNotify('Error')");
    $Protected_row = texttooltip('{Protected}', '{click_to_change_notif_content}', "LoadAvNotify('Protected')");
    $html = "<div style='float:left;margin-left:-120px;margin-top:-100px;'></div>" . Tabs() . "<br><br>\n\n\t<form name='kasperskyactions'>\t\n\t<input type='hidden' name='GidNumber' value='{$gidNumber}'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td width='1%' valign='top'>&nbsp;</td>\n\t<td valign='top'>\n\t\n\t\n\t\t<h4>{LoadKasperskySettings_general_title}</H4>\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t<td align=right>{LoadKasperskySettings_adminaddr}:</td>\n\t\t\t\t<td><input type='text' name='AdminAddress' value='{$hash["AdminAddress"]}'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td align=right>{LoadKasperskySettings_Check}:</td>\n\t\t\t\t<td>{$Check}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td align=right>{LoadKasperskySettings_AddXHeaders}:</td>\n\t\t\t\t<td>{$AddXHeaders}</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t{$QuarantinePath}\n\t\t\t\t</table>\n\t\n\t</tr>\n\t</table>\n\t\n\t\t<h4>{av_notify_rules}</H4>\n\n\t\n<table>\n<tr class=rowT>\n\t<td rowspan=2>{objects}</td>\n\t<td  rowspan=2>{Quarantine}</td>\n\t<td colspan=2>{Administrator_rules}</td>\n\t<td >{sender_rules}</td>\n\t<td colspan=3>{recipient_rules}</td>\n</tr>\n<tr class=rowT>\n\t<td >{notify}</td>\n\t<td>{actions}</td>\n\t<td >{notify}</td>\n\t<td >{notify}</td>\n\t<td>{attach_report}</td>\n\t<td>{actions}</td>\n\t\n</tr>\n<tr class=rowA align='right'>\n\t<td>{$Infected_row}</td>\n\t<td align='center' width=1%>{$InfectedQuarantine}</td>\n\t<td align='center' width=1%>{$InfectedAdminNotify}</td>\n\t<td align='center'  width=1%>{$InfectedAdminAction}</td>\n\t<td align='center' width=1%>{$InfectedSenderNotify}</td>\n\t<td align='center' width=1%>{$InfectedRecipientNotify}</td>\n\t<td align='center' width=1%>{$InfectedRecipientAttachReport}</td>\n\t<td align='center' >{$InfectedRecipientAction}</td>\n\t\n</tr>\n<tr class=rowB align='right'>\n\t<td>{$Cured_row}</td>\n\t<td align='center' width=1%>{$CuredQuarantine}</td>\n\t<td align='center' width=1%>{$CuredAdminNotify}</td>\n\t<td align='center'  width=1%>{$CuredAdminAction}</td>\n\t<td align='center' width=1%>{$CuredSenderNotify}</td>\n\t<td align='center' width=1%>{$CuredRecipientNotify}</td>\n\t<td align='center' width=1%>{$CuredRecipientAttachReport}</td>\n\t<td align='center' >{$CuredRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowA align='right'>\n\t<td>{$Suspicious_row}</td>\n\t<td align='center' width=1%>{$SuspiciousQuarantine}</td>\n\t<td align='center' width=1%>{$SuspiciousAdminNotify}</td>\n\t<td align='center' >{$SuspiciousAdminAction}</td>\n\t<td align='center' width=1%>{$SuspiciousSenderNotify}</td>\n\t<td align='center' width=1%>{$SuspiciousRecipientNotify}</td>\n\t<td align='center' width=1%>{$SuspiciousRecipientAttachReport}</td>\n\t<td align='center' >{$SuspiciousRecipientAction}</td>\n</tr>\t\t\t  \t\t\t\t \n<tr class=rowB align='right'>\n\t<td>{$Corrupted_row}</td>\n\t<td align='center' width=1%>{$CorruptedQuarantine}</td>\t\n\t<td align='center' width=1%>{$CorruptedAdminNotify}</td>\t\t\n\t<td align='center'  width=1%>{$CorruptedAdminAction}</td>\t\t\n\t<td align='center' width=1%>{$CorruptedSenderNotify}</td>\n\t<td align='center' width=1%>{$CorruptedRecipientNotify}</td>\n\t<td align='center' width=1%>{$CorruptedRecipientAttachReport}</td>\n\t<td align='center' >{$CorruptedRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n\n<tr class=rowA align='right'>\n\t<td>{$Warning_row}</td>\n\t<td class=center width=1%>{$WarningQuarantine}</td>\n\t<td class=center width=1%>{$WarningAdminNotify}</td>\t\n\t<td class=center width=1%>{$WarningAdminAction}</td>\n\t<td align='center' width=1%>{$WarningSenderNotify}</td>\n\t<td align='center' width=1%>{$WarningRecipientNotify}</td>\n\t<td align='center' width=1%>{$WarningRecipientAttachReport}</td>\n\t<td align='center' >{$WarningRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowB align='right'>\n\t<td>{$Filtered_row}</td>\n\t<td align='center' width=1%>{$FilteredQuarantine}</td>\n\t<td align='center' width=1%>{$FilteredAdminNotify}</td>\n\t<td align='center'  width=1%>{$FilteredAdminAction}</td>\n\t<td align='center' width=1%>{$FilteredSenderNotify}</td>\n\t<td align='center' width=1%>{$FilteredRecipientNotify}</td>\n\t<td align='center' width=1%>{$FilteredRecipientAttachReport}</td>\n\t<td align='center' >{$FilteredRecipientAction}</td>\n\t\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowA align='right'>\n\t<td>{$Error_row}</td>\n\t<td align='center' width=1%>{$ErrorQuarantine}</td>\n\t<td align='center' width=1%>{$ErrorAdminNotify}</td>\n\t<td align='center'  width=1%>{$ErrorAdminAction}</td>\n\t<td align='center' width=1%>{$ErrorSenderNotify}</td>\n\t<td align='center' width=1%>{$ErrorRecipientNotify}</td>\n\t<td align='center' width=1%>{$ErrorRecipientAttachReport}</td>\n\t<td align='center' >{$ErrorRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowB align='right'>\n\t<td>{$Protected_row}</td>\n\t<td align='center' width=1%>{$ProtectedQuarantine}</td>\n\t<td align='center' width=1%>{$ProtectedAdminNotify}</td>\n\t<td align='center'  width=1%>{$ProtectedAdminAction}</td>\n\t<td align='center' width=1%>{$ProtectedSenderNotify}</td>\n\t<td align='center' width=1%>{$ProtectedRecipientNotify}</td>\n\t<td align='center' width=1%>{$ProtectedRecipientAttachReport}</td>\n\t<td align='center' >{$ProtectedRecipientAction}</td>\n</tr>\n</form>\n<tr class=rowA align='right' >\n\t<td colspan=8><input type='button' value='{bt_edit_notify}' OnClick=\"javascript:EditKasperskySettings();\" style='float:right'></td></tr>\n</table>\n\t\n\t";
    $tpl = new templates();
    $html = $tpl->_ENGINE_parse_body($html);
    echo DIV_SHADOW($html, 'windows');
}