Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2003
    Location
    Northern Virginia
    Posts
    3

    Red face Unanswered: 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
    %>

  2. #2
    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!"

  3. #3
    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
    %>

  4. #4
    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!"

  5. #5
    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.

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •