📄 userfiltermail.asp
字号:
<!--#include file="passinc.asp" -->
<%
issave = trim(Request("issave"))
mode = trim(Request("mode"))
dim fm
set fm = server.createobject("easymail.MailFilterManager")
fm.Load Session("wem")
if mode = "del" and Request.ServerVariables("REQUEST_METHOD") = "GET" then
id = trim(Request("id"))
if id <> "" then
if IsNumeric(id) = true then
if fm.Remove(CInt(id)) = true then
fm.Save
set fm = nothing
response.redirect "ok.asp?" & getGRSN() & "&gourl=userfiltermail.asp?" & getGRSN()
end if
end if
end if
end if
if mode = "up" and Request.ServerVariables("REQUEST_METHOD") = "GET" then
id = trim(Request("id"))
if id <> "" then
if IsNumeric(id) = true then
if fm.MoveUp(CInt(id)) = true then
fm.Save
end if
end if
end if
end if
if mode = "down" and Request.ServerVariables("REQUEST_METHOD") = "GET" then
id = trim(Request("id"))
if id <> "" then
if IsNumeric(id) = true then
if fm.MoveDown(CInt(id)) = true then
fm.Save
end if
end if
end if
end if
if mode = "mdel" and Request.ServerVariables("REQUEST_METHOD") = "POST" then
themax = fm.count
isedit = false
do while themax >= 0
if trim(request("check" & themax)) <> "" then
md = trim(request("check" & themax))
if IsNumeric(md) = true then
if fm.Remove(CInt(md)) = true then
isedit = true
end if
end if
end if
themax = themax - 1
loop
if isedit = true then
fm.Save
set fm = nothing
response.redirect "ok.asp?" & getGRSN() & "&gourl=userfiltermail.asp?" & getGRSN()
end if
end if
if issave = "1" and Request.ServerVariables("REQUEST_METHOD") = "POST" then
n_content = trim(Request("s_content"))
n_mode = trim(Request("s_mode"))
n_deal = trim(Request("s_deal"))
n_msg = trim(Request("s_msg"))
n_continue = trim(Request("s_continue"))
isok = false
if n_content <> "" and n_mode <> "" and n_deal <> "" then
if IsNumeric(n_content) = true and IsNumeric(n_mode) = true and IsNumeric(n_deal) = true then
isok = fm.Add(CInt(n_content), CInt(n_mode), CInt(n_deal), CInt(n_continue), n_msg)
end if
end if
if isok = true then
fm.Save
set fm = nothing
response.redirect "ok.asp?" & getGRSN() & "&gourl=userfiltermail.asp?" & getGRSN()
end if
end if
allnum = fm.count
%>
<HTML>
<HEAD>
<title>Corp.Email</title>
<LINK href="images\hwem.css" rel=stylesheet>
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function mdel() {
if (ischeck() == true)
{
f1.mode.value = "mdel";
f1.submit();
}
}
function ischeck() {
var i = 0;
var theObj;
for(; i<<%=allnum %>; i++)
{
theObj = eval("f1.check" + i);
if (theObj != null)
if (theObj.checked == true)
return true;
}
return false;
}
function addnew() {
var isok = false;
if (fnew.s_msg.value == "" && fnew.s_content.value != 3 && (fnew.s_mode.value == 1 || fnew.s_mode.value == 2))
isok = true;
if (fnew.s_msg.value != "")
isok = true;
if (isok == true)
{
if (fnew.s_content.value != 3)
{
fnew.submit();
}
else
{
if (fnew.s_msg.value >= 0)
fnew.submit();
}
}
}
function add_s_mode(a_value, a_text)
{
var oOption = document.createElement("OPTION");
oOption.text = a_text;
oOption.value = a_value;
fnew.s_mode.add(oOption);
}
function select_content_onchange()
{
var i = 0;
for (i; i < fnew.s_mode.length; i++)
{
fnew.s_mode.remove(i);
i--;
}
if (fnew.s_content.value != "3")
{
add_s_mode("1", "equal");
add_s_mode("2", "not equal to");
add_s_mode("3", "contains");
add_s_mode("4", "does not contain");
add_s_mode("5", "equal (asterisk supported)");
}
else
{
add_s_mode("1", " = ");
add_s_mode("6", " > ");
add_s_mode("7", " < ");
}
}
//-->
</SCRIPT>
<BODY>
<br>
<br>
<table width="95%" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF" style='border-top:1px #8CA5B5 solid;'>
<FORM ACTION="userfiltermail.asp" METHOD="POST" NAME="fnew">
<input type="hidden" name="issave" value="1">
<tr><td height="30" nowrap>
<table><tr><td align="left">
Step 1:
<select name="s_content" class=drpdwn LANGUAGE=javascript onchange="select_content_onchange()">
<option value="1">From Addr</option>
<option value="2">From Name</option>
<option value="3">Size</option>
<option value="4">Subject</option>
</select>
<select name="s_mode" class=drpdwn>
<option value="1">equal</option>
<option value="2">not equal to</option>
<option value="3">contains</option>
<option value="4">does not contain</option>
<option value="5">equal (asterisk supported)</option>
</select>
<input type="input" name="s_msg" class="textbox">
</td></tr><tr><td> Step 2:
<select name="s_deal" class=drpdwn>
<option value="1">Delete</option>
<option value="2">Auto-Response</option>
<option value="3">Move to Trash</option>
</select>
<select name="s_continue" class=drpdwn>
<option value="0">Stop</option>
<option value="1">Continue</option>
</select>
<input type="button" value="Create" onclick="javascript:addnew()" class="sbttn">
</td></tr></table>
</td></tr>
</form>
<tr><td bgcolor="#ffffff" style='border-bottom:1px #8CA5B5 solid;'>
</td></tr>
</table>
<br><br>
<table width="95%" border="0" align="center" cellspacing="0">
<tr><td align="right">
<input type="button" value="Return" onclick="javascript:location.href='viewmailbox.asp?<%=getGRSN() %>';" class="Bsbttn">
</td></tr>
</table>
<br>
<table width="95%" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF" style='border-top:1px #8CA5B5 solid;'>
<FORM ACTION="userfiltermail.asp" METHOD="POST" NAME="f1">
<input type="hidden" name="mode">
<tr bgcolor="#dbeaf5" style='border:1px #8CA5B5 solid;font-size: 9pt;'>
<td width="7%" align="center" height="25" bgcolor="#dbeaf5" style="border-left:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><a href="javascript:mdel()"><img src='images\del.gif' border='0' alt="Delete"></td>
<td width="8%" align="center" bgcolor="#dbeaf5" style="border-left:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>No.</b></font></td>
<td width="53%" align="center" bgcolor="#dbeaf5" style="border-left:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>Message</b></font></td>
<td width="12%" align="center" bgcolor="#dbeaf5" style="border-left:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>Next<br>Processing</b></font></td>
<td width="10%" align="center" bgcolor="#dbeaf5" style="border-left:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>Position<br>Adjustment</b></font></td>
<td width="12%" align="center" bgcolor="#dbeaf5" style="border-left:1px #8CA5B5 solid; border-right:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>Delete</b></font></td>
</tr>
<%
i = 0
do while i < allnum
fm.GetInfo i, filter_content, filter_mode, filter_deal, filter_continue, filter_msg
Response.Write " <tr>"
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'><input type='checkbox' name='check" & i & "' value='" & i & "'></td>"
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'>" & i + 1 & "</td>"
Response.Write " <td align='left' style='border-bottom:1px #8CA5B5 solid;'><font class='s'>" & server.htmlencode(getFilterStr(filter_content, filter_mode, filter_deal, filter_msg)) & "</font></td>"
if filter_continue = 0 then
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'><font class='s'>Stop</font></td>"
else
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'><font class='s'>Continue</font></td>"
end if
if allnum = 1 then
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'> </td>"
elseif i = 0 then
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'> <a href='userfiltermail.asp?mode=down&id=" & i & "'><img src='images\arrow_down.gif' border='0' align='absmiddle'></a></td>"
elseif i = allnum - 1 then
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'><a href='userfiltermail.asp?mode=up&id=" & i & "'><img src='images\arrow_up.gif' border='0' align='absmiddle'></a> </td>"
else
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'><a href='userfiltermail.asp?mode=up&id=" & i & "'><img src='images\arrow_up.gif' border='0' align='absmiddle'></a> <a href='userfiltermail.asp?mode=down&id=" & i & "'><img src='images\arrow_down.gif' border='0' align='absmiddle'></a></td>"
end if
Response.Write " <td align='center' style='border-bottom:1px #8CA5B5 solid;'><a href='userfiltermail.asp?mode=del&id=" & i & "&" & getGRSN() & "'><img src='images\del.gif' border='0' alt='Delete'></a></td>"
Response.Write " </tr>" & chr(13)
filter_content = NULL
filter_mode = NULL
filter_deal = NULL
filter_msg = NULL
i = i + 1
loop
%>
</table>
<table width="95%" border="0" align="center" cellspacing="0">
<tr><td align="right">
<br><input type="button" value="Return" onclick="javascript:location.href='viewmailbox.asp?<%=getGRSN() %>';" class="Bsbttn">
</td></tr>
</form>
</table>
<br><br><br>
<div align="center">
<table width="95%" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF" style='border-top:1px #8CA5B5 solid;'>
<tr>
<td colspan="2" height="10">
</td>
</tr>
<tr>
<td width="15%" valign="top"><font color="#FF3333"> *Note: Size</font></td>
<td width="85%">You have entered the unit of mail size as "byte".<br>
</td>
</tr>
<tr>
<td colspan="2" height="10">
</td>
</tr>
</table>
</div>
<br>
<div style="position: absolute; left: 20; top: 10;">
<a href="help.asp#userfiltermail" target="_blank"><img src="images/help.gif" border="0" alt="Help"></a></div>
</BODY>
</HTML>
<%
set fm = nothing
function getFilterStr(f_content, f_mode, f_deal, f_msg)
if f_msg = "" then
Exit Function
end if
if f_deal = 1 then
getFilterStr = getFilterStr & "Delete when the "
elseif f_deal = 2 then
getFilterStr = getFilterStr & "Reply when the "
elseif f_deal = 3 then
getFilterStr = getFilterStr & "Move to recycle bin when the "
else
getFilterStr = ""
Exit Function
end if
if f_content = 1 then
getFilterStr = "[From Addr] "
elseif f_content = 2 then
getFilterStr = "[From Name] "
elseif f_content = 3 then
getFilterStr = "[Size] "
elseif f_content = 4 then
getFilterStr = "[Subject] "
else
getFilterStr = ""
Exit Function
end if
if f_mode = 1 then
getFilterStr = getFilterStr & "equal "
elseif f_mode = 2 then
getFilterStr = getFilterStr & "does not equal to "
elseif f_mode = 3 then
getFilterStr = getFilterStr & "contains "
elseif f_mode = 4 then
getFilterStr = getFilterStr & "does not contain "
elseif f_mode = 5 then
getFilterStr = getFilterStr & "equal (asterisk supported) "
elseif f_mode = 6 then
getFilterStr = getFilterStr & "> "
elseif f_mode = 7 then
getFilterStr = getFilterStr & "< "
else
getFilterStr = ""
Exit Function
end if
getFilterStr = getFilterStr & f_msg
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -