Exemple #1
0
function LoadKasperskySettings($domain = null)
{
    if ($domain != null) {
        $_GET["LoadKasperskySettings"] = $domain;
    }
    $kav4mailservers = new kav4mailservers();
    $hash = $kav4mailservers->loadAvSettingsDomain($_GET["LoadKasperskySettings"]);
    $CuredQuarantine = Field_yesno_checkbox("CuredQuarantine", $hash["CuredQuarantine"]);
    $InfectedQuarantine = Field_yesno_checkbox("InfectedQuarantine", $hash["InfectedQuarantine"]);
    $SuspiciousQuarantine = Field_yesno_checkbox("SuspiciousQuarantine", $hash["SuspiciousQuarantine"]);
    $CorruptedQuarantine = Field_yesno_checkbox("CorruptedQuarantine", $hash["CorruptedQuarantine"]);
    $WarningQuarantine = Field_yesno_checkbox("WarningQuarantine", $hash["WarningQuarantine"]);
    $FilteredQuarantine = Field_yesno_checkbox("FilteredQuarantine", $hash["FilteredQuarantine"]);
    $ErrorQuarantine = Field_yesno_checkbox("ErrorQuarantine", $hash["ErrorQuarantine"]);
    $ProtectedQuarantine = Field_yesno_checkbox("ProtectedQuarantine", $hash["ProtectedQuarantine"]);
    $CuredAdminNotify = Field_yesno_checkbox("CuredAdminNotify", $hash["CuredAdminNotify"]);
    $InfectedAdminNotify = Field_yesno_checkbox("InfectedAdminNotify", $hash["InfectedAdminNotify"]);
    $SuspiciousAdminNotify = Field_yesno_checkbox("SuspiciousAdminNotify", $hash["SuspiciousAdminNotify"]);
    $CorruptedAdminNotify = Field_yesno_checkbox("CorruptedAdminNotify", $hash["CorruptedAdminNotify"]);
    $WarningAdminNotify = Field_yesno_checkbox("WarningAdminNotify", $hash["WarningAdminNotify"]);
    $FilteredAdminNotify = Field_yesno_checkbox("FilteredAdminNotify", $hash["FilteredAdminNotify"]);
    $ErrorAdminNotify = Field_yesno_checkbox("ErrorAdminNotify", $hash["ErrorAdminNotify"]);
    $ProtectedAdminNotify = Field_yesno_checkbox("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("CuredSenderNotify", $hash["CuredSenderNotify"]);
    $InfectedSenderNotify = Field_yesno_checkbox("InfectedSenderNotify", $hash["InfectedSenderNotify"]);
    $SuspiciousSenderNotify = Field_yesno_checkbox("SuspiciousSenderNotify", $hash["SuspiciousSenderNotify"]);
    $CorruptedSenderNotify = Field_yesno_checkbox("CorruptedSenderNotify", $hash["CorruptedSenderNotify"]);
    $WarningSenderNotify = Field_yesno_checkbox("WarningSenderNotify", $hash["WarningSenderNotify"]);
    $FilteredSenderNotify = Field_yesno_checkbox("FilteredSenderNotify", $hash["FilteredSenderNotify"]);
    $ErrorSenderNotify = Field_yesno_checkbox("ErrorSenderNotify", $hash["ErrorSenderNotify"]);
    $ProtectedSenderNotify = Field_yesno_checkbox("ProtectedSenderNotify", $hash["ProtectedSenderNotify"]);
    $CuredRecipientNotify = Field_yesno_checkbox("CuredRecipientNotify", $hash["CuredRecipientNotify"]);
    $InfectedRecipientNotify = Field_yesno_checkbox("InfectedRecipientNotify", $hash["InfectedRecipientNotify"]);
    $SuspiciousRecipientNotify = Field_yesno_checkbox("SuspiciousRecipientNotify", $hash["SuspiciousRecipientNotify"]);
    $CorruptedRecipientNotify = Field_yesno_checkbox("CorruptedRecipientNotify", $hash["CorruptedRecipientNotify"]);
    $WarningRecipientNotify = Field_yesno_checkbox("WarningRecipientNotify", $hash["WarningRecipientNotify"]);
    $FilteredRecipientNotify = Field_yesno_checkbox("FilteredRecipientNotify", $hash["FilteredRecipientNotify"]);
    $ErrorRecipientNotify = Field_yesno_checkbox("ErrorRecipientNotify", $hash["ErrorRecipientNotify"]);
    $ProtectedRecipientNotify = Field_yesno_checkbox("ProtectedRecipientNotify", $hash["ProtectedRecipientNotify"]);
    $CuredRecipientAttachReport = Field_yesno_checkbox("CuredRecipientAttachReport", $hash["CuredRecipientAttachReport"]);
    $InfectedRecipientAttachReport = Field_yesno_checkbox("InfectedRecipientAttachReport", $hash["InfectedRecipientAttachReport"]);
    $SuspiciousRecipientAttachReport = Field_yesno_checkbox("SuspiciousRecipientAttachReport", $hash["SuspiciousRecipientAttachReport"]);
    $CorruptedRecipientAttachReport = Field_yesno_checkbox("CorruptedRecipientAttachReport", $hash["CorruptedRecipientAttachReport"]);
    $WarningRecipientAttachReport = Field_yesno_checkbox("WarningRecipientAttachReport", $hash["WarningRecipientAttachReport"]);
    $FilteredRecipientAttachReport = Field_yesno_checkbox("FilteredRecipientAttachReport", $hash["FilteredRecipientAttachReport"]);
    $ErrorRecipientAttachReport = Field_yesno_checkbox("ErrorRecipientAttachReport", $hash["ErrorRecipientAttachReport"]);
    $ProtectedRecipientAttachReport = Field_yesno_checkbox("ProtectedRecipientAttachReport", $hash["ProtectedRecipientAttachReport"]);
    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>";
    }
    $html = "\n\t<fieldset>\n\t\t<legend>{LoadKasperskySettings_general_title}</legend>\n\t\t<table>\n\t\t<tr class=rowA>\n\t\t<td align=right>{LoadKasperskySettings_adminaddr}:</td>\n\t\t<input type='text' id='AdminAddress' value='{$hash["AdminAddress"]}'></td>\n\t\t</tr>\n\t\t{$QuarantinePath}\n\t\t</table>\n\t</fieldset>\n\t<fieldset>\n\t\t<legend>{av_notify_rules}</legend>\n\n<form name='kasperskyactions'>\t\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}</td>\n\t<td id='center' width=1%>{$InfectedQuarantine}</td>\n\t<td id='center' width=1%>{$InfectedAdminNotify}</td>\n\t<td id='center' >{$InfectedAdminAction}</td>\n\t<td id='center' width=1%>{$InfectedSenderNotify}</td>\n\t<td id='center' width=1%>{$InfectedRecipientNotify}</td>\n\t<td id='center' width=1%>{$InfectedRecipientAttachReport}</td>\n\t<td id='center' >{$InfectedRecipientAction}</td>\n\t\n</tr>\n<tr class=rowB align='right'>\n\t<td>{Cured}</td>\n\t<td id='center' width=1%>{$CuredQuarantine}</td>\n\t<td id='center' width=1%>{$CuredAdminNotify}</td>\n\t<td id='center' >{$CuredAdminAction}</td>\n\t<td id='center' width=1%>{$CuredSenderNotify}</td>\n\t<td id='center' width=1%>{$CuredRecipientNotify}</td>\n\t<td id='center' width=1%>{$CuredRecipientAttachReport}</td>\n\t<td id='center' >{$CuredRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowA align='right'>\n\t<td>{Suspicious} </td>\n\t<td id='center' width=1%>{$SuspiciousQuarantine}</td>\n\t<td id='center' width=1%>{$SuspiciousAdminNotify}</td>\n\t<td id='center' >{$SuspiciousAdminAction}</td>\n\t<td id='center' width=1%>{$SuspiciousSenderNotify}</td>\n\t<td id='center' width=1%>{$SuspiciousRecipientNotify}</td>\n\t<td id='center' width=1%>{$SuspiciousRecipientAttachReport}</td>\n\t<td id='center' >{$SuspiciousRecipientAction}</td>\n</tr>\t\t\t  \t\t\t\t \n<tr class=rowB align='right'>\n\t<td>{Corrupted}</td>\n\t<td id='center' width=1%>{$CorruptedQuarantine}</td>\t\n\t<td id='center' width=1%>{$CorruptedAdminNotify}</td>\t\t\n\t<td id='center'>{$CorruptedAdminAction}</td>\t\t\n\t<td id='center' width=1%>{$CorruptedSenderNotify}</td>\n\t<td id='center' width=1%>{$CorruptedRecipientNotify}</td>\n\t<td id='center' width=1%>{$CorruptedRecipientAttachReport}</td>\n\t<td id='center' >{$CorruptedRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n\n<tr class=rowA align='right'>\n\t<td>{Warning}</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>{$WarningAdminAction}</td>\n\t<td id='center' width=1%>{$WarningSenderNotify}</td>\n\t<td id='center' width=1%>{$WarningRecipientNotify}</td>\n\t<td id='center' width=1%>{$WarningRecipientAttachReport}</td>\n\t<td id='center' >{$WarningRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowB align='right'>\n\t<td>{Filtered}</td>\n\t<td id='center' width=1%>{$FilteredQuarantine}</td>\n\t<td id='center' width=1%>{$FilteredAdminNotify}</td>\n\t<td id='center' >{$FilteredAdminAction}</td>\n\t<td id='center' width=1%>{$FilteredSenderNotify}</td>\n\t<td id='center' width=1%>{$FilteredRecipientNotify}</td>\n\t<td id='center' width=1%>{$FilteredRecipientAttachReport}</td>\n\t<td id='center' >{$FilteredRecipientAction}</td>\n\t\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowA align='right'>\n\t<td>{Error}</td>\n\t<td id='center' width=1%>{$ErrorQuarantine}</td>\n\t<td id='center' width=1%>{$ErrorAdminNotify}</td>\n\t<td id='center' >{$ErrorAdminAction}</td>\n\t<td id='center' width=1%>{$ErrorSenderNotify}</td>\n\t<td id='center' width=1%>{$ErrorRecipientNotify}</td>\n\t<td id='center' width=1%>{$ErrorRecipientAttachReport}</td>\n\t<td id='center' >{$ErrorRecipientAction}</td>\n</tr> \t\t\t  \t\t\t\t \n<tr class=rowB align='right'>\n\t<td>{Protected}</td>\n\t<td id='center' width=1%>{$ProtectedQuarantine}</td>\n\t<td id='center' width=1%>{$ProtectedAdminNotify}</td>\n\t<td id='center' >{$ProtectedAdminAction}</td>\n\t<td id='center' width=1%>{$ProtectedSenderNotify}</td>\n\t<td id='center' width=1%>{$ProtectedRecipientNotify}</td>\n\t<td id='center' width=1%>{$ProtectedRecipientAttachReport}</td>\n\t<td id='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('{$_GET["LoadKasperskySettings"]}');\" style='float:right'></td></tr>\n</table>\n</fieldset>\n\t\t\t\n\t\t\n\t</fieldset>\n\t";
    $tpl = new templates();
    echo DIV_SHADOW($tpl->_parse_body($html), 'windows');
}
Exemple #2
0
function FilterByName_delete()
{
    $ldap = new clladp();
    if (preg_match('#kav:([0-9]+)#', $_GET["TreeKasSelect"], $reg)) {
        $gidNumber = $reg[1];
    }
    $HashGroup = $ldap->GroupDatas($gidNumber);
    $kav4mailservers = new kav4mailservers(1, $HashGroup["KasperkyAVScanningDatas"]);
    $hashKAV = $kav4mailservers->loadAvSettingsDomain($gidNumber);
    $tbl = explode(',', $hashKAV["FilterByName"]);
    $tbl[] = $ext;
    unset($tbl[$_GET["FilterByName_delete"]]);
    $hashKAV["FilterByName"] = implode(',', $tbl);
    while (list($num, $ligne) = each($hashKAV)) {
        $ini = $ini . "{$num}={$ligne}\n";
    }
    $ini = "[smtpscan.group:{$gidNumber}]\n{$ini}";
    $updatearray["KasperkyAVScanningDatas"][] = $ini;
    if (!is_array_key("KasperkyAVScanningDatas", $HashGroup)) {
        $ldap->Ldap_add_mod($HashGroup["dn"], $updatearray);
        if ($ldap->ldap_last_error != null) {
            echo $ldap->ldap_last_error;
            exit;
        }
    } else {
        $ldap->Ldap_modify($HashGroup["dn"], $updatearray);
        if ($ldap->ldap_last_error != null) {
            echo $ldap->ldap_last_error;
            exit;
        }
    }
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body('{deleted}');
}