<%@ LANGUAGE="VBSCRIPT" %> <% OPTION EXPLICIT 'Server.ScriptTimeout = 300 %> <% ' This Script allows users to change their password. ' Although Password history is not saved, email history should be saved to allow users to revert to old email addresses. DIM pageLanguage response.ContentType="text/html" Response.charset = "UTF-8" pageLanguage="ENG" DIM username,oldpass,newpass,newpass2,action username=request.form("username") oldpass=request.form("oldpass") newpass=request.form("newpass") newpass2=request.form("newpass2") action=request.form("action") responsePageHeader "Change Password" DIM err,errs err=0 errs="" if newpass<>newpass2 then err=1 errs="Password verification does not match." end if if newpass="" then err=1 errs="Please enter new password." end if if oldpass="" then err=1 errs="Please enter old password." end if if len(newpass)<6 then err=1 errs="Password must be at least 6 characters long." end if ' Check if username/password are valid DIM conntemp,rstemp,mySQL set conntemp=server.createobject("adodb.connection") conntemp.open "DSN=CDizzMain" DIM userID userID=0 mySQL="SELECT userID FROM users WHERE username='" & degeresh(username) & "' AND password='" & degeresh(oldpass) & "'" Set rstemp=conntemp.execute(mySQL) If rstemp.eof Then err=1 errs="Invalid username or password" else userID=cLng(rstemp("userID")) End If rstemp.close if username="" or err=1 then if username<>"" then prt "

" & errs & "

" end if responsePageHeader2 %>

CDizz Registration - Change Password

Username:
Old Password:
New Password:
Confirm New Password:
<% else ' Change the password to the new one if userID>0 then mySQL="UPDATE users SET password='" & degeresh(newpass) & "' WHERE userID=" & userID Set rstemp=conntemp.execute(mySQL) prt "

Password successfully changed

" responsePageHeader2 %>

Return to CDizz home page.

<% else prt "

Problem with user data

" responsePageHeader2 prt "

Please report this error to support@cdizz.com

" end if End If Set rstemp=nothing conntemp.close set conntemp=nothing responsePageFooter response.end %>