CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Password issue when updating user fields

Print topic Send  topic

Author Message
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;
}
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.