Sorry, I added the Main.asp "Function" code amd CurrentUser.asp code that's included within the Password.asp code.
Thanks so much for taking a look this problem!
We’re using the ASP scripts, canned within the Microsoft Web Admin Tool, to permit our customers to manage their own account information. One script in particular (password.asp), will not permit customers to update their password. All other Web Admin Tool scripts work well.
Here’s the password.asp code that returns "Status of Update:Failed" message:
=======================================
<!--#Include File="Lib/Main.asp" -->
<!--#Include File="Lib/CurrentUser.asp" -->
<%
Dim OldPassword, NewPassword, ConfirmPassword, postform
Dim OutString, v_userObj
postform = Request.Form("postform")
OldPassword = Request.Form("OldPassword")
NewPassword = Request.Form("NewPassword")
ConfirmPassword = Request.Form("ConfirmPassword")
outString = ""
If PostForm then
If NewPassword = ConfirmPassword then
outString = ResetPassword(curUserObj, OldPassword, NewPassword)
Else
outString = "Passwords do not match"
End If
End If
' Get the current user Object from Lib/CurrentUser.asp
Set v_userObj = curUserObj
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Change My Password</title>
<!--#Include File="Header.asp" -->
<!--#Include File="SideBars/Home.asp" -->
<SCRIPT language=JavaScript>
//This script block is used to specify Help params unique to this page
H_TOPIC="h_Password.asp"
</SCRIPT>
<form id=form1 name=form1 method=post action="Password.asp">
<input type=hidden name=postform value=true>
<%
If outString <> "" then
Response.Write "<Font Color=""red""><strong>"
Response.Write "Status of Update: " & outString
Response.Write "</strong></font>"
End If
%>
Here’s the Main.asp code :
=======================================
'************************************************* *******************
'*
'* Function UpdatePassword(oUser, g_OldPassword, g_NewPassword)
'* Purpose: Update a Users Password
'* Input: oUser AdsPath Of User (Object)
'* g_OldPassword Old Password (String)
'* g_NewPassword New Password (String)
'*
'* Output: None
'*
'************************************************* *******************
Function UpdatePassword(oUser, g_OldPassword, g_NewPassword)
On Error Resume Next
' Change the Password
oUser.ChangePassword g_OldPassword, g_NewPassword
IF Err.number <> 0 then
UpdatePassword = "Failed to Reset Your ChapNet Password"
' Write to Log
WriteLog "UpdatePassword",1, g_AuthUser
Exit Function
Else
' Write to Log
WriteLog "UpdatePassword",0, g_AuthUser
End If
End Function
Here’s the CurrentUser.asp code :
=======================================
<%
' Get the current Users information from the Header
Auth_User = Request.ServerVariables("Auth_User")
Dim Auth_User '// Used in Lib\CurrentUser.asp
Dim curUserObj '// Used in Lib\CurrentUser.asp
Dim oSysInfo
Call DoCurrentUser
Sub DoCurrentUser()
On Error Resume Next
' Check to see if the current User Object has already been set.
If Not IsObject(curUserObj) then
' Get the Current Users information. This information is just a cached version of
' the currently logged on user.
Set oSysInfo = Server.CreateObject("ADSystemInfo")
' Get Current User Object
Set curUserObj = GetObject("LDAP://" & oSysInfo.username)
If Err.number <> 0 then
Response.Write "Could not Get User Object<br>"
Response.Write "Err.description: " & Err.description & "<BR>"
Response.Write "Err.number: " & Err.number & "<BR>"
Response.Write "oSysInfo.username: " & oSysInfo.username& "<BR>"
Response.End
End If
DetailError "Unable to Get Current User Object. Get Auth_User: " & Auth_User
' Destroy Objects
Set oSysInfo = Nothing
End If
End Sub
%>