CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 TIP - Custom Insert and modifying the DataSource

Print topic Send  topic

Author Message
idh63

Posts: 76
Posted: 09/19/2008, 9:19 AM

I wanted to add this tip to the forum for others so that:

1. Instead of always posting a question and not helping others, I have finally been able to post something of value.

2. Save Yessoftware support from going though the same thing with someone else.

This tip pertains to modifying the DataSource on a form. A signup form is a good example.

You want to encrypt the password field and in CCS4.x there is a new way to get this done, CCEncryptPasswordDB($value).

In the following, the password text box name is 'pword'.

If your form insert is automatic, in other words, You have not created a custom insert, then following the instructions found in the manual for using CCS's "Add Action | Encrypt Password" on BeforeBuildInsert will work fine.

The resulting CCS generated code is:
$Component->DataSource->pword->SetValue(CCEncryptPasswordDB($Component->DataSource->pword->GetValue()))

I usually have to use Custom Insert on my signup forms and I have found that the instructions in the manual do not hold true. So I always had to encrypt the password in the form field using Before Insert and the following :
$formname->pword->SetValue(CCEncryptPasswordDB($formname->pword->GetValue()))

This works but if there is an insert error and the user is returned to the signup form, the password field is now populated with the encrypted password.

So for Custom Insert, here is the solution as provided by Yessoftware support:
$Container->DataSource->cp["pword"]->SetValue(CCEncryptPasswordDB($Container->DataSource->cp["pword"]->GetValue()));

I know this may be obvious to seasoned CCS users with advanced php programming skills.

I have seen other members posts in the past about problems altering the DataSource and I had a "me too" moment, so I hope this tip proves helpful.
View profile  Send private message
CCSGuy


Posts: 5
Posted: 09/19/2008, 11:34 PM

Thanks for the tip. I have run into this problem before myself.
_________________
Continuous effort - not strength or intelligence - is the key to unlocking our potential.

Sir Winston Churchill
View profile  Send private message
gregmelson

Posts: 19
Posted: 09/20/2008, 1:02 AM

Awesome Tip! thank you idh63
_________________
greg
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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