This topic is locked
[SOLVED]

 Advanced security setting

6/3/2012 7:07:29 AM
PHPRunner General questions
M
maxcolo author

Hello everyone and thanks to all who want to help me, I apologize for English but I'm ItalianI have three tables
Users

id_utente

username

password
Puntivendita

id_pv

id_utente

address

city

ecc.....
Rilevamenti

id_rilevamento

id_punto vendita

id_utente
I would like every user who logs in can see only his record of two tables and Puntivendita Records. I tried to filter directly on the table with user_id =. $ _SESSION ['OwnerID'].**"**But unfortunately the syntax is wrong.I can give advice on how to connect the relationships and solve this problem.

thank you very much

C
cgphp 6/3/2012

In the "After successful login" event enter the following code:

$_SESSION['user_id'] = $data['id_utente'];


In the "Before SQL query" event of the Puntivendita and Rilevamenti tables, enter the following code:

$strWhereClause = "id_utente = " . $_SESSION['user_id'];
M
maxcolo author 6/3/2012

Thank you thank Cristian optimal solution, the code works correctly, but if I have a user group called Field instead can see the entire contents of two tables. Keep in mind that users or split a table users


user_id

username

password

email

group (admin, field, agents)
Thanks for your input much appreciated