If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > User Upate of Their Own Password (ASP with ADO)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-08-03, 14:35
LuzMagic LuzMagic is offline
Registered User
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 3
Red face User Upate of Their Own Password (ASP with ADO)

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
%>
Reply With Quote
  #2 (permalink)  
Old 01-13-03, 17:26
Frettmaestro Frettmaestro is offline
Registered User
 
Join Date: Jan 2003
Location: London, England
Posts: 106
This cannot be all the code? This doesn't make any sense at all... we need to see the function "ResetPassword". This is what doesn't work...
__________________
Frettmaestro
"Real programmers don't document, if it was hard to write it should be hard to understand!"
Reply With Quote
  #3 (permalink)  
Old 01-14-03, 07:29
LuzMagic LuzMagic is offline
Registered User
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 3
Talking Re: User Upate of Their Own Password (ASP with ADO)

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
%>
Reply With Quote
  #4 (permalink)  
Old 01-14-03, 07:40
Frettmaestro Frettmaestro is offline
Registered User
 
Join Date: Jan 2003
Location: London, England
Posts: 106
There is now way I can solve your problem with this code. It looks like someone has made an object (.dll) in VB or something that does all the actual work. The code you got here is just passing variables and updating status. You should contact whoever made it and ask if they can take a look at it...
__________________
Frettmaestro
"Real programmers don't document, if it was hard to write it should be hard to understand!"
Reply With Quote
  #5 (permalink)  
Old 01-14-03, 07:51
LuzMagic LuzMagic is offline
Registered User
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 3
Talking

This code is actually Microsoft's Web Admin Tool (Provisioning Tool). You can download the entire ASP code package off the Microsoft Homepage and check the Global.asp, Config.asp, and any other scripts that may be affecting the functionality of the Password.asp script.

I contacted the creator of this code, Conrad Agramont, Microsoft Programmer, but he has not responded after several requests over a two month period.

Quote:
Originally posted by Frettmaestro
There is now way I can solve your problem with this code. It looks like someone has made an object (.dll) in VB or something that does all the actual work. The code you got here is just passing variables and updating status. You should contact whoever made it and ask if they can take a look at it...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On