This topic is locked

List with OwnerID

8/29/2007 8:04:46 PM
PHPRunner General questions
M
mhoerner author

Hello,
I have user table. In this user table has each user a number 1, 2 or 3.
Than there are some views xxx_list.php for the users. Each view has an invisible field with the indicator 1, 2 or 3.
I will control, that each user see only their relevant entries. So each entry has the indicator 1, 2 or 3.
But in some cases, there are user, that have the indicator 3. Indicator 3 means, that the user can see the entries with the indicators 1 and 2.
I solved the problem with the ownerID for the indicators 1 and 2. But how I can control the users with the indicator 3? Because the user with the indicator 3 should see both relevant entries (indicator 1 and 2).
Regards,

Chris

Sergey Kornilov admin 9/1/2007

I would recommend to use BeforeSQLQuery event in PHPRunner 4.1.

I assume that current logged user indicator is stored in session variable.
The following code should work:

if ($_SESSION["Indicator"]==3)

$strSQL = AddWhere($strSQL, "indicator=1 or indicator=2");

else

$strSQL = AddWhere($strSQL, "indicator=" . $_SESSION["Indicator"]);
M
mhoerner author 9/7/2007

Hello,
but I need a solution now.

How long can I use the Beta PHPRunner 4.1?

Because I have only a license for PHPRunner 4.0
It doesn't works. Should I cut off the advance security option with the ownerID?
Regards,

Chris

Sergey Kornilov admin 9/7/2007

Michael,
if you purchased PHPRunner 4.0 less than one year ago PHPRunner 4.1 is a free upgrade for you.

Just use it.

M
mhoerner author 9/8/2007

Hello,
but it doesn't work. I don't see anything. Should I cut off function for ownerID?
Regards,

Chris

Sergey Kornilov admin 9/9/2007

Chris,
"it does not work" don't tell me anything. Please be descriptive and explain step by step what exactly you doing and how do you know it doesn't work.