jim7567g
Posts: 38
|
| Posted: 01/16/2005, 11:37 AM |
|
I would like to know if anyone could share the code needed to validate a current password field before updating the users record with a new password. I'm new to php programming and just can't get a grasp on this.
Thanks for any help I can get.
Jim
_________________
Jim |
 |
 |
mrachow
Posts: 509
|
| Posted: 01/16/2005, 11:44 PM |
|
I'm using event OnClick of form Login, control password
$forValidation = $Login->password->GetValue();
_________________
Best regards,
Michael |
 |
 |
jim7567g
Posts: 38
|
| Posted: 01/17/2005, 2:14 AM |
|
I'm not quite sure I fully understand how you do this. I am trying to use a standard editable grid with two fields, one for the old password and one for the new password. When the user clicks the submit button I would like to validate that the the old password is the same as the users current password before updating the database with the new password.
It sounds as if your using the Login.php form to do this? Can you explain or show more of the code your using?
Thanks for the response,
Jim
_________________
Jim |
 |
 |
peterr
Posts: 5971
|
| Posted: 01/17/2005, 9:10 AM |
|
Jim,
May I ask why you are not using the standard record form for that?
BTW, I suspect that Michael is using record form, which is named "Login".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
jim7567g
Posts: 38
|
| Posted: 01/17/2005, 1:37 PM |
|
Hi Peterr, the answer to your question is easy to answer. 
Quote :I'm still learning to program lol 
I guess I should try the record form and see how that works. I think that the name "Login" for a password change form confused me.
_________________
Jim |
 |
 |
peterr
Posts: 5971
|
| Posted: 01/17/2005, 1:44 PM |
|
Yeah, I'm also not 100% sure if that was the record form, but it makes most sense. The editable grid is little too complex for simple tasks.
And to be honest I'm still learning to program too
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
jim7567g
Posts: 38
|
| Posted: 01/17/2005, 1:46 PM |
|
I'll try the record grid and see if it offers additional ways to validate entries and report back.
_________________
Jim |
 |
 |
jim7567g
Posts: 38
|
| Posted: 01/17/2005, 2:41 PM |
|
Ok, I figured it out. I'll share it here incase there are some other newbies like myself who can benefit from it.
I used a record form and set it to allow update only.
I set 3 control fields in the record grid "current pass, new pass, user login (hidden)"
I set both current pass and new pass to required.
On the user login control field I used Server Before Show event to set the field to the users login from the session using the "Retrieve Value for Control event.
In the forms events I then set a Login event to the Server Before Update event and specified that the users login would come from the hidden user login control and that the password would come from the current password control.
To finish it up I used a custom update to update the user_pass field in the database with the new password control where the users_id was equal to the users session UserID.
It's running like a fined tuned engine now... Yeee Haaa!!!
_________________
Jim |
 |
 |