//////////////////////////////////////////////////////////////////////////////
// [mdaemon] 用asp检查mdaemon系统管理员登录
// 原创作者: 贾俊 (jaron)
// 网址: http://www.jiangdu.net ;
// 邮件: jaron@jdinfo.net
// 首次发表于江都资讯网,2003-01-12
//////////////////////////////////////////////////////////////////////////////
<%
set omduser = server.createobject("mdusercom.mduser")
set omduserinfo = server.createobject("mdusercom.mduserinfo")
omduser.loaduserdll
cappdir = omduser.getappdir
dim adomains()
dim itotalaccounts
dim itotaldomains
itotaldomains = omduser.getdomaincount
itotalaccounts = omduser.usercount
redim adomains(0,itotaldomains)
omduser.getdomainnames(adomains)
if request.form("cmdlogin") = "add" then
slogin = request.form("txtusername")
spassword = request.form("txtpassword")
iuserid = omduser.getbyemail(slogin)
if iuserid = -1 then
smessage = "无此用户"
end if
if iuserid <> 1 then
smessage = "权限不够,请用系统管理员登录"
else
if spassword = omduser.getpassword(iuserid) then
session("mdusers") = slogin
omduser.getfree iuserid
smessage = "正确登录"
else
smessage = "口令错误"
end if
end if
end if
%>
管理员登录示例!
<form action="login.asp" method=post id="form1">
<table id="table1">
<tr><td>domain:</td><td><input size=50 name="txtdomain" id="text1"></td></tr>
<tr><td>user name:</td><td><input size=25 name="txtusername" id="text3"></td></tr>
<tr><td>password:</td><td><input type="password" size=25 name="txtpassword" id="password1"></td></tr>
<tr><td></td><td><input type="submit" value="add" name="cmdlogin" id="submit1"></td></tr>
</table>
<%=smessage%>
</form>
