CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Update allowed with UserID - help wanted

Print topic Send  topic

Author Message
Mikevg
Posted: 04/21/2003, 4:42 AM

I am trying to implement form security (CCS and PHP Templates) where a user can update their own record, identified by their email address, even if they do not have the Group Level required to amend other records.

Site security is implemented and uses email address as login : most users are Group 1 = Browse only. I want to enable the Submit button (Update Allowed) when the login name matches the email address of the current record, selected from a grid

I am using the following code in the After Initialise event of the linked record page, where 'Directoryv2' is the database, 'thedirectory' is the form and 'dir_email' is the field which contains the email address.

$db = new clsDBDirectoryv2();
global $thedirectory;

if ( CCGetUserLogin() == CCGetValue($db,dir_email))
{
$thedirectory->UpdateAllowed = true;
}

Unfortunately, the if statement fails - I have tried lots of permutations with/without $signs, quotes, etc. Can anyone please assist ? I'm losing the plot and substantial amounts of hair with this one!!



JD
Posted: 04/22/2003, 11:50 AM

to at least fix your if statement;

global $thedirectory;
if (CCGetUserLogin() = $thedirectory->dir_email->Value) {
the rest you have;
}

This will work if you have the dir_email field on your page somewhere like in a hidden field. if it is in a hidden field replace dir_email with teh hidden field name.

Hope this helps. I have not used the record security. You might check docs.codecharge.com for documentation.
Mikevg
Posted: 04/23/2003, 3:09 PM

Hi JD, thanks for the contrib.

Unfortunately it doesn't work (either with = or ==). I'm obviously missing something fundamental - and suspect it relates to the state of the record set at the point of the 'After Initialise'.

Have tried the documentation, but the words 'needle' and 'haystack' figure largely!!

Thanks again for the assist.

Regards

   


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.