This topic is locked

how to create different user rights within a record

11/8/2006 3:19:13 PM
PHPRunner General questions
S
specpa author

Hi,
I want to create the following list
index store subject remark

1 A wallet found in closet

2 B shoe eaten by the dog
A login person (belonging to a site) can only see and edit the data from his site.

table login:

ID groupID storeID name pasword email

1 admin admin fgfgfdg 1@w.com

2 store A paul sdwer 1@b.com

3 store B carin fdhgf 2@c.com

4 central ? john fdgfdg 3@d.com
to get different access rights for the different groupIDs is succesful, also editing data only from their own store based on storeID is succesful.

I would like to create a special site user or group (central) which can read data from all sites but only edit the remark field.

Do i need to create a seperate table for the remarks to get different access rights for this column. How to proceed?
best regards specpa

Alexey admin 11/9/2006

Hi,
I recommend you to create a custom view for your first table.

Make "remark" the only editable field in this view and grant "central" group an access to this view.
To create a custom view proceed to the Datasource table tab in PHPRunner, choose the table in the list and click Add table view.

S
specpa author 11/16/2006

Thanx, works great and is easy to maintain.
now I have the problem that user beloging to group central is redirected to the default page where it has no rights.
login:

ID groupID storeID name pasword email

1 admin admin admin fgfgfdg 1@w.com

2 store A paul sdwer 1@b.com

3 store B carin fdhgf 2@c.com

4 central ? john fdgfdg 3@d.com
how can I "redirect to another page", "after succesful login" depandant on groupID in the logon table.

(if login is admin then page a, if login is store page b, if login is central page c).
best regards Paul Speckens

Sergey Kornilov admin 11/16/2006

You can try something like this:

function AfterSuccessfulLogin()

{
if ($_SESSION["GroupID"]=="admin")

{

header("Location: page1.php");

exit();

}

else if ($_SESSION["GroupID"]=="store")

{

header("Location: page2.php");

exit();

}

else if ($_SESSION["GroupID"]=="central")

{

header("Location: page3.php");

exit();

}
}