admincreate.asp
来自「蓝芒3.0A最新所有功能完整破解版」· ASP 代码 · 共 416 行
ASP
416 行
<!--#include file="passinc.asp" -->
<%
if isadmin() = false then
response.redirect "noadmin.asp"
end if
%>
<%
domain = trim(request("domain"))
dim ei
set ei = server.createobject("easymail.domain")
ei.Load
i = 0
allnum = ei.GetCount()
dim showdomainselect
showdomainselect = ""
do while i < allnum
cdomainstr = ei.GetDomain(i)
if cdomainstr = domain then
showdomainselect = showdomainselect & "<option value='" & cdomainstr & "' selected>" & cdomainstr & "</option>"
else
showdomainselect = showdomainselect & "<option value='" & cdomainstr & "'>" & cdomainstr & "</option>"
end if
cdomainstr = NULL
i = i + 1
loop
'======================================================
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."
end if
username = trim(request("username"))
pw = trim(request("pw"))
pw1 = trim(request("pw1"))
crmode = trim(request("crmode"))
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 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
isdomain = ei.IsDomain(domain)
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 crmode = "0" then
if easymail.isUser(username) = true then
errstr="User already exists."
isok = false
end if
else
if easymail.isUser(username & "@" & domain) = true then
errstr="User already exists."
isok = false
end if
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")
if crmode = "0" then
easymail.adduser1 username, pw, domain, "From: " & Request.ServerVariables("REMOTE_ADDR"), CInt(accessmode)
else
easymail.adduser1 username & "@" & domain, pw, domain, "From: " & Request.ServerVariables("REMOTE_ADDR"), CInt(accessmode)
end if
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="admincreate.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>
<%
if crmode = "0" then
%>
Your logon ID is: <font class="s" color="#FF3333"><%=username %></font></font></b></div>
<%
else
%>
Your logon ID is: <font color="#FF3333"><%=username & "@" & domain %></font></b></div>
<%
end if
%>
</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='showuser.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="admincreate.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 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="66%" border="0">
<tr><td colspan="2" height="30" style='border-bottom:1px #8CA5B5 solid;'>
<input type=radio <% if crmode = "0" then response.write "checked"%> value="0" name="crmode"> Create common account<br>
<input type=radio <% if crmode <> "0" then response.write "checked"%> value="1" name="crmode"> Create account containing domain name<br>
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><font class="s" color="#104A7B"><b>ID:</b></font></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;"><font class="s" color="#104A7B"><b>Domain Name:</b></font></td>
<td height="30">
<select name="domain" class="drpdwn" size="1">
<%=showdomainselect %>
</select>
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><font class="s" color="#104A7B"><b>Password:</b></font></td>
<td height="30">
<input type="password" name="pw" maxlength="32" class="textbox">
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><font class="s" color="#104A7B"><b>Re-type Password:</b></font></td>
<td height="30">
<input type="password" name="pw1" maxlength="32" class="textbox">
</td>
</tr>
<tr>
<td height="30" style="font-size:9pt;"><font class="s" color="#104A7B"><b>Access:</b></font></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='showuser.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 + -
显示快捷键?