I am trying to use a link to allow users to change their password after they login. I am putting this in a footer include. But how do you pass the users password/Username onto the Change_password.cfm(action page). It works but it does pass the current login users info. Please advice
Thanks,
Ahmad
This is the Links page:
<cfquery name = "main" datasource = "MIP" username = "MIP" password = "MIPadmin">
SELECT UserGroup, pwd_lastmod, UserID
FROM Users
ORDER BY User_Name ASC
</CFquery>
<CFoutput query="main"><a href="Change_password.cfm?id=#UserID#"></cfoutput> Change Password</a>
The Change_password.cfm page:
<CFIF IsDefined("action"
>
<cfquery name = "main" datasource = "MIP" username = "MIP" password = "MIPadmin">
SELECT COUNT(*)
AS nUser
FROM Users
WHERE User_Name = '#Form.password#'
AND UserID <> #id#
</CFquery>
<!--- <CFIF #main.nUser# GT 0>
<CFLocation url = "modify_user.cfm?error=1">
</CFIF> --->
<cfquery name = "updato" datasource = "MIP" username = "MIP" password = "MIPadmin">
UPDATE Users
SET
User_Name = '#Form.login_name#',
Password = '#Form.password#',
Active = 'Y'
WHERE UserID = #id#
</CFquery>
<CFLocation url = "index.cfm">
</CFIF>
<cfquery name = "main" datasource = "MIP" username = "MIP" password = "MIPadmin">
SELECT UserID, User_name, Password, UserGroup
FROM Users
WHERE UserID = #id#
ORDER BY User_Name ASC
</CFquery>
<CFform name = "mod_form" method="POST" action="change_password.cfm?action=add&id=#id#">
Username: <input type="text" name="login_name" value="#user_name#" size="20" maxlength="15" onFocus="this.blur()">
Password:
<input type = "password" name = "password" maxlength = "15" size = "20" value = "#password#" >
Re-type Passwor:
<input value = "#password#" type = "password" name = "reword" maxlength = "15" size = "20">
<input type = "button" value = "Change" onClick = "JavaScript: var hForm = new IMipForm(); hForm.Validate
<input type = "button" onClick = "window.location = 'index.cfm';" value = "CANCEL">
Thanks,
Ahmad
This is the Links page:
<cfquery name = "main" datasource = "MIP" username = "MIP" password = "MIPadmin">
SELECT UserGroup, pwd_lastmod, UserID
FROM Users
ORDER BY User_Name ASC
</CFquery>
<CFoutput query="main"><a href="Change_password.cfm?id=#UserID#"></cfoutput> Change Password</a>
The Change_password.cfm page:
<CFIF IsDefined("action"
<cfquery name = "main" datasource = "MIP" username = "MIP" password = "MIPadmin">
SELECT COUNT(*)
AS nUser
FROM Users
WHERE User_Name = '#Form.password#'
AND UserID <> #id#
</CFquery>
<!--- <CFIF #main.nUser# GT 0>
<CFLocation url = "modify_user.cfm?error=1">
</CFIF> --->
<cfquery name = "updato" datasource = "MIP" username = "MIP" password = "MIPadmin">
UPDATE Users
SET
User_Name = '#Form.login_name#',
Password = '#Form.password#',
Active = 'Y'
WHERE UserID = #id#
</CFquery>
<CFLocation url = "index.cfm">
</CFIF>
<cfquery name = "main" datasource = "MIP" username = "MIP" password = "MIPadmin">
SELECT UserID, User_name, Password, UserGroup
FROM Users
WHERE UserID = #id#
ORDER BY User_Name ASC
</CFquery>
<CFform name = "mod_form" method="POST" action="change_password.cfm?action=add&id=#id#">
Username: <input type="text" name="login_name" value="#user_name#" size="20" maxlength="15" onFocus="this.blur()">
Password:
<input type = "password" name = "password" maxlength = "15" size = "20" value = "#password#" >
Re-type Passwor:
<input value = "#password#" type = "password" name = "reword" maxlength = "15" size = "20">
<input type = "button" value = "Change" onClick = "JavaScript: var hForm = new IMipForm(); hForm.Validate
<input type = "button" onClick = "window.location = 'index.cfm';" value = "CANCEL">