Use ASP to check MDaemon system administrator Login

Source: Internet
Author: User
//////////////////////////////////////////////////////////////////////////////
[MDaemon] Use ASP to check MDaemon system administrator Login
Original Author: Jia Jun (Jaron)
Website: http://www.jiangdu.net;
Mail: jaron@jdinfo.net
First published in Jiangdu Information Network, 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 = "No This user"
End If
If Iuserid <> 1 Then
smessage = "Insufficient permissions, please login with system administrator"
Else
If Spassword = Omduser.getpassword (Iuserid) Then
Session ("mdusers") = slogin
Omduser.getfree Iuserid
smessage = "Log on correctly"
Else
smessage = "Password Error"
End If
End If
End If
%>
Administrator Login Sample!
<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" Password1 "></TD></TR>
<tr><td></td><td><input type= "Submit" value= "Add" name= "Cmdlogin" id= "Submit1" ></ Td></tr>
</TABLE>
<%=sMessage%>
</FORM>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.