CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Form security

Print topic Send  topic

Author Message
telmiger

Posts: 61
Posted: 06/28/2004, 9:18 PM

I am trying to acomplish the following.

I have project and to each project can have multiple employees assigned to it.

An employee can add or edit information only in projects that he is assigned too.

I put the following code in the after initialize event. project_employee contains the employees assigned to the project.

global $conversations1;
global $DBcns;
$current_project = CCGetParam("project_id", "");

if ($current_project != 0 && CCGetUserID() != CCDLookUp("user_id", "project_employee", "project_id=".
$DBcns->ToSQL($current_project, ccsInteger), $DBcns))
{
$conversations1->InsertAllowed = false;
$conversations1->UpdateAllowed = false;
$conversations1->DeleteAllowed = false;
}

The code works if only 1 person is assigned to the project. I am not sure on how to turn this code into an array so it will compare the UserId to multiple entries in the project_employee table.

Any help would be appreciatet.

Tony Elmiger
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.