tedm
Posts: 1
|
| Posted: 11/20/2008, 8:04 AM |
|
Using CCS 4.1.00.027
PHP, MYSQL DB
Encrpted passwords = yes
Code Expression = MD5({password})
Setup a table record on a page for user management.
When use changes password, the change is reflected properly in the database.
Here is the problem, when the user doesn't change password the password is set to null in the database.
I setup a hidden field within the form to store the original password.
Using the Preserve Password event, identifying the password control, the shadow control and setting a value.
I setup a encrypt password on the before build update, naming same password and shadow control, along with the same value set in the preserve event.
Any help appreciated, I have verified that the value is properly set in the hidden1control.
Here is the event code for the Before Build Update (as autogenerated by CCS).
function tblsecurityusers1_ds_BeforeBuildUpdate(& $sender)
{
$tblsecurityusers1_ds_BeforeBuildUpdate = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $tblsecurityusers1; //Compatibility
if ("password" != $Component->DataSource->UserPW->GetValue()) {
$Component->DataSource->UserPW->SetValue(CCEncryptPasswordDB($Component->DataSource->UserPW->GetValue()));
} else {
$Component->DataSource->UserPW->SetValue(CCDecryptString($Component->DataSource->Hidden1->GetValue(), CCS_ENCRYPTION_KEY_FOR_COOKIE));
}
return $tblsecurityusers1_ds_BeforeBuildUpdate;
}
|
 |
 |
|