domaincreate.asp
来自「蓝芒3.0A最新所有功能完整破解版」· ASP 代码 · 共 405 行
ASP
405 行
<!--#include file="passinc.asp" -->
<%
domain = trim(request("domain"))
dim ei
set ei = server.createobject("easymail.domain")
ei.Load
if ei.GetUserManagerDomainCount(Session("wem")) < 1 then
set ei = nothing
response.redirect "noadmin.asp"
end if
i = 0
allnum = ei.GetUserManagerDomainCount(Session("wem"))
dim iscontrol
iscontrol = false
dim showdomainselect
showdomainselect = ""
do while i < allnum
cdomainstr = ei.GetUserManagerDomain(Session("wem"), i)
if cdomainstr = domain then
iscontrol = true
showdomainselect = showdomainselect & "<option value='" & cdomainstr & "' selected>" & cdomainstr & "</option>"
else
showdomainselect = showdomainselect & "<option value='" & cdomainstr & "'>" & cdomainstr & "</option>"
end if
cdomainstr = NULL
i = i + 1
loop
if domain <> "" and iscontrol = false then
set ei = nothing
response.redirect "noadmin.asp"
end if
'======================================================
dim errstr
if trim(request("errstr")) <> "" then
errstr = trim(request("errstr"))
else
errstr = "Please enter your desired user name and password, and select a domain name.<br> (Note: Account containing domain name)"
end if
username = trim(request("username"))
pw = trim(request("pw"))
pw1 = trim(request("pw1"))
if pw <> pw1 then
errstr = "Your new password entries did not match."
end if
if username <> "" and domain <> "" then
if pw = "" or pw1 = "" then
errstr = "Please enter password."
end if
end if
dim comeinadd
comeinadd = false
if iscontrol = true and Session("Reg") = "next" and username <> "" and domain <> "" and pw <> "" and pw1 <> "" and pw = pw1 and Request.ServerVariables("REQUEST_METHOD") = "POST" then
dim isok
isok = true
dim isdomain
isdomain = false
ei.GetControlMsg domain, isshow, maxuser, manager
mdn = ei.GetUserNumberInDomain(domain)
isdomain = ei.IsDomain(domain)
if mdn >= maxuser then
errstr="Maximum number of user reached in the current domain."
isok = false
end if
if isdomain = false then
errstr="Invalidation domain name."
isok = false
end if
if InStr(username, "!") or InStr(username, """") or InStr(username, "#") or InStr(username, "$") or InStr(username, "%") then
errstr="Your Email Name contains Invalid characters."
isok = false
end if
if InStr(username, "&") or InStr(username, "`") or InStr(username, "(") or InStr(username, ")") or InStr(username, "*") then
errstr="Your Email Name contains Invalid characters."
isok = false
end if
if InStr(username, "+") or InStr(username, ",") or InStr(username, "/") or InStr(username, ":") then
errstr="Your Email Name contains Invalid characters."
isok = false
end if
if InStr(username, ";") or InStr(username, "<") or InStr(username, "=") or InStr(username, ">") or InStr(username, "?") then
errstr="Your Email Name contains Invalid characters."
isok = false
end if
if InStr(username, "@") or InStr(username, "[") or InStr(username, "\") or InStr(username, "]") or InStr(username, "^") then
errstr="Your Email Name contains Invalid characters."
isok = false
end if
if InStr(username, "'") or InStr(username, "{") or InStr(username, "|") or InStr(username, "}") or InStr(username, "~") then
errstr="Your Email Name contains Invalid characters."
isok = false
end if
if InStr(username, " ") or InStr(username, Chr(9)) then
errstr="Your Email Name contains Invalid characters."
isok = false
end if
'-----
Set easymail = Application("em")
if easymail.isUser(username & "@" & domain) = true then
errstr="User already exists."
isok = false
end if
Set easymail = nothing
if isok = true then
comeinadd = true
end if
end if
Session("Reg") = ""
'------------------------------------------------
if comeinadd = true and Request.ServerVariables("REQUEST_METHOD") = "POST" then
accessmode = trim(request("accessmode"))
if IsNumeric(accessmode) = false then
accessmode = "0"
end if
Set easymail = Application("em")
easymail.adduser1 username & "@" & domain, pw, domain, "From: " & Request.ServerVariables("REMOTE_ADDR"), CInt(accessmode)
Set easymail = nothing
%>
<html>
<head>
<title>Corp.Email</title>
<LINK href="images\hwem.css" rel=stylesheet>
</head>
<body>
<br><br>
<div align="center">
<form name="fc" action="domaincreate.asp">
<table width="450" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF" height="210">
<tr>
<td height="28" align="center" bgcolor="#dbeaf5" nowrap height="28" style="border-left:1px #8CA5B5 solid; border-top:1px #8CA5B5 solid; border-right:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>Congratulations</b></font></td>
</tr>
<tr bgcolor="#EFF7FF" align="center">
<td><br>
<div align="center">
<table width="90%" border="0">
<tr>
<td>
<div align="center"></div>
</td>
</tr>
<tr>
<td height="1">
<div align="center">
<hr size="1">
</div>
</td>
</tr>
<tr>
<td height="1">
<div align="center" style="font-size:9pt;"><font class="s" color="#104A7B"><b>Mailbox [ <%=username & "@" & domain %> ] creation successful.<br><br>
Your logon ID is: <font color="#FF3333"><%=username & "@" & domain %></font></font></b></div>
</td>
</tr>
<tr>
<td height="1">
<div align="center">
<hr size="1">
</div>
</td>
</tr>
</table>
<br>
</div>
</td>
</tr>
<tr>
<td height="40" bgcolor="#ffffff">
<div align="right">
<input type="submit" value="<< Previous" class="Bsbttn">
<input type="button" value="Return" onClick="javascript:location.href='showdomainusers.asp?<%=getGRSN() %>'" class="Bsbttn">
</div>
</td>
</tr>
</table>
<input type="hidden" name="GRSN" value="<%=createGRSN() %>">
</form>
</div>
</body>
</html>
<%
else
%>
<html>
<head>
<title>Corp.Email</title>
<LINK href="images\hwem.css" rel=stylesheet>
<SCRIPT LANGUAGE=javascript>
<!--
function checkpw(){
if (fc.username.value == "")
{
alert("User ID cannot be empty.");
fc.username.focus();
return ;
}
if (fc.pw.value == "")
{
alert("Password cannot be empty.");
fc.pw.focus();
return ;
}
if (fc.pw1.value == "")
{
alert("Password cannot be empty.");
fc.pw1.focus();
return ;
}
if (fc.pw.value != fc.pw1.value)
alert("Your password did not match.");
else
fc.submit();
}
//-->
</script>
</head>
<body>
<br><br>
<div align="center">
<form name="fc" METHOD="POST" action="domaincreate.asp">
<table width="450" border="0" align="center" cellspacing="0" bgcolor="#EFF7FF" height="254">
<tr bgcolor="#dbeaf5">
<td height="28" align="center" nowrap height="28" style="border-left:1px #8CA5B5 solid; border-top:1px #8CA5B5 solid; border-right:1px #8CA5B5 solid; border-bottom:1px #8CA5B5 solid;"><font class="s" color="#104A7B"><b>Create Account</b></font></td>
</tr>
<tr bgcolor="#EFF7FF" align="center">
<td><br>
<div align="center">
<table width="90%" border="0">
<tr>
<td>
<div align="center"></div>
</td>
</tr>
<tr>
<td height="1">
<div align="center">
<hr size="1">
</div>
</td>
</tr>
<tr>
<td height="1">
<div style="font-size:9pt;"> <%=errstr %></div>
</td>
</tr>
<tr>
<td height="1">
<div align="center">
<hr size="1">
</div>
</td>
</tr>
<tr>
<td height="1">
<div align="center">
<table width="68%" border="0">
<tr>
<td height="30" style="font-size:9pt;"><b>ID:</b></td>
<td height="30">
<input type="text" name="username" value="<%=username %>" maxlength="32" class="textbox">
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><b>Domain Name:</b></td>
<td height="30">
<select name="domain" class="drpdwn" size="1">
<%=showdomainselect %>
</select>
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><b>Password:</b></td>
<td height="30">
<input type="password" name="pw" maxlength="32" class="textbox">
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><b>Re-type Password:</b></td>
<td height="30">
<input type="password" name="pw1" maxlength="32" class="textbox">
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><b>Access:</b></td>
<td height="30">
<select name="accessmode" class="drpdwn" size="1">
<%
anum = 0
do while anum < 7
if amode = anum then
response.write "<option value=""" & anum & """ selected>" & getaccessmode(anum) & "</option>"
else
response.write "<option value=""" & anum & """>" & getaccessmode(anum) & "</option>"
end if
anum = anum + 1
loop
%>
</select>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table><br>
</div>
</td>
</tr>
<tr>
<td height="40" bgcolor="#ffffff" align="right">
<input type="button" value="Submit" onClick="javascript:checkpw();" class="Bsbttn">
<input type="button" value="Cancel" onClick="javascript:location.href='showdomainusers.asp?<%=getGRSN() %>'" class="Bsbttn">
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
<%
Session("Reg") = "next"
end if
%>
<%
set ei = nothing
%>
<%
function createGRSN()
Randomize
createGRSN = Int((9999999 * Rnd) + 1)
end function
function getaccessmode(amode)
if amode = 0 then
getaccessmode = "http/smtp/pop"
elseif amode = 1 then
getaccessmode = "smtp/pop"
elseif amode = 2 then
getaccessmode = "http/smtp"
elseif amode = 3 then
getaccessmode = "http/pop"
elseif amode = 4 then
getaccessmode = "http"
elseif amode = 5 then
getaccessmode = "smtp"
elseif amode = 6 then
getaccessmode = "pop"
end if
end function
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?