| 热门文章 |
 |
|
| 编辑推荐 |
 |
|
|
| 基于ADSI的NT帐号及Exchange Server帐号申请及验证模块源代码 |
|
|
作者:zhengsb
来源:CSDN 点击: 更新:2006-12-19
|
|
gt;<input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p> </form>
</body>
</html>
b>响应文件UserAdd.asp <HTML> <head> <meta name="Microsoft Theme" content="mstheme1530 1111, default"> </head> <BODY> <H1> </H1> <% ' Variables dim rbox set rbox = Server.CreateObject("RbsBoxGen.NTUserManager") '以下如果已在DLL的初始化事件中设置正确则无须设置,可提高安全性 'rbox.Domain="yourdomain" 'rbox.Admin="administrator" 'rbox.password="XXXXXX" 'rbox.Ntserver="yonrntserver" 'rbox.EmailAddress="@Xxx.xxx" 'rbox.ExchServer="yourExchangeServerName" 'rbox.ExchSite="yourExchangeSiteName" 'rbox.ExchOrganization="yourExchangeOrganizationName" rbox.getuserinfo rbox.CreateUser 'rbox.DeleteUser
if rbox.isok then set rbox = nothing response.write "注册成功!" else set rbox = nothing response.write "该用户名已被使用,请换一个名字再试!" end if
%> </BODY> </HTML>
2修改密码: a>.密码修改页面CHPWD.htm <html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> <SCRIPT LANGUAGE="VBScript"> <!-- Sub cmdOk_OnClick Dim TheForm Set TheForm = Document.MyForm
opwd=trim(TheForm.opwd.Value) npwd=trim(TheForm.npwd.Value) cpwd=trim(TheForm.cpwd.Value)
if opwd="" then msgbox "请输入旧密码!" exit sub end if
if npwd="" then msgbox "请输入新密码!" exit sub end if if cpwd="" then msgbox "请输入确认密码!" exit sub end if
if npwd<>cpwd then msgbox "新密码与确认密码不一致!" exit sub end if
if ucase(opwd)=ucase(npwd) then msgbox "新密码不得与旧密码相同!" exit sub end if
if len(npwd)<3 then msgbox "新密码长度不得小于3位!" exit sub end if
TheForm.submit
End Sub //--> </SCRIPT>
<meta name="Microsoft Theme" content="mstheme1530 1111, default"> </head>
<body> <form method="POST" action="Chpwd.asp" name="myform" target="_self"> <div align="center"> <center> <table width="100%" height="100%"><tr> <td valign="middle" align="center"> <div align="center"> <center> <table width="256" height="100" cellspacing="0" cellpadding="0" border="1" bordercolor="#FFFFFF"><tr><td> <div align="center"> <center> <table border="0" width="256" height="100" cellspacing="0" cellpadding="0" bgcolor="#C0C0C0"> <tr> <td width="92"> </td> <td width="160" colspan="2"> </td> </tr> </center> <tr> <td width="92"> <p align="center"><font size="3">旧 密 码:</font></td> <td width="160" colspan="2"><input type="password" name="oPwd" size="20"></td> </tr> <tr> <td width="92"> <p align="center"><font size="3">新 密 码:</font></td> <td width="160" colspan="2"><input type="password" name="nPWD" size="20"></td> </tr> <tr> <td width="92"> <p align="center"><font size="3">确认密码:</font></td> <td width="160" colspan="2"><input type="password" name="cPwd" size="20"></td> </tr> <tr> <td width="92"> </td> <td width="160" colspan="2"> <p align="center"> </td> </tr> <tr> <td width="92"> </td> <td width="80"> <p align="center"><input type="button" value="确定" name="cmdOK"></p> </td> <td width="80"> <p align="center"><input type="button" value="取消" name="Cancel" onclick="JavaScript:history.back();"></td> </tr> <tr> <td width="92"> </td> <td width="80"> </td> <td width="80"> </td> </tr> </table> </div> </td></tr></table> </center> </div></tr></table> </center> </div> </form> </body>
</html>
b>响应文件CHPWD.asp <HTML>
<head> <meta name="Microsoft Theme" content="mstheme1530 1111, default"> </head>
<BODY> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%" height="100%" align="center" valign="middle"> <% ' Variables dim rbox
uid=session("SID_UID") opwd=request.form("opwd") npwd=request.form("npwd") cpwd=request.form("cpwd") if opwd="" then response.write "请输入旧密码!" response.end end if
if npwd="" then response.write "请输入新密码!" response.end end if if cpwd="" then response.write "请输入确认密码!" response.end end if
if npwd<>cpwd then response.write "新密码与确认密码不一致!" response.end end if
if ucase(opwd)=ucase(npwd) then response.write "新密码不得与旧密码相同!" response.end end if
if len(npwd)<3 then response.write "新密码长度不得小于3位!" response.end end if
set rbox = Server.CreateObject("RbsBoxGen.NTUserManager")
' rbox.ResetPwd uid,npwd ' rbox.Login uid,npwd rbox.ChangePwd uid,opwd,npwd if rbox.isok then set rbox = nothing response.write "密码更改成功!" else set rbox = nothing response.write "旧密码输入错误!" end if response.end
%> </td> </tr> </table> </BODY> </HTML>
3.登陆验证(ASP): dim rbox set rbox = Server.CreateObject("RbsBoxGen.NTUserManager") '以下如果已在DLL的初始化事件中设置正确则无须设置,可提高安全性 'rbox.Domain="yourdomain" 'rbox.Admin="administrator" 'rbox.password="XXXXXX" 'rbox.Ntserver="yonrntserver" 'rbox.EmailAddress="@Xxx.xxx" 'rbox.ExchServer="yourExchangeServerName" 'rbox.ExchSite="yourExchangeSiteName" 'rbox.ExchOrganization="yourExchangeOrganizationName"
rbox.Login name,pass 'name:待验证的用户帐号,Pass:用户密码 Login=cbool(rbox.isok) '如果rbox.isok为真,验证通过. set rbox = nothing if Not Login then response.redirect Request.ServerVariables("HTTP_REFERER") response.end end if 上一页 [1] [2] [3] [4] [5]
|
|
|