This topic is locked
[SOLVED]

 Eliminate back to login link on access denied

3/17/2006 8:02:53 PM
PHPRunner General questions
S
sloftus author

I have several parent / child link tables. When linked in this way the child table can be accessed from the list page from each record as it appears in red underlined. I have one particularly complex table linking to 3 separate child tables. However some of my users need access to all three child tables but I want different groups of users to access only one or another of the child tables. The only way I've found is to create separate table 'views' (which is a great enhancement by the way Sergey). However as my project grows I have many many 'views' customised for particular users. I've now reached the stage where its quite unmanageable. One reason I can't simplify things is because I can't deny access to one of the sub table links without the user being presented with a permission denied message along with a link back to the login page if a denied link is followed. PLEASE can there be an option to get rid of this annoying event and present the user with a link to the previous page (without having to use the back button). Better still could a pop up message appear "Access Denied" without even having to leave the page??
A solution would be very much appreciated. (Sorry for the long messag).

D
Dale 3/17/2006

I found this quite annoying also.
I modified the code and added the ability to go back to the existing page.

This allows the user to either Log in as a user with access or go back to the page.
In the list.php I changed the snippet as below. I add the section in bold.
if(!CheckSecurity(@$_SESSION["OwnerID"],"Search") && !CheckSecurity(@$_SESSION["OwnerID"],"Add"))

{

echo "<p><center> </center></p>";

echo "<p><center>Sorry, ".##SCRIPTMESSAGE(NO_PERMISSIONS)##." of information</center></p>";

echo "<p><center>Login as a user that has access <a href=\"login.php\">".##SCRIPTMESSAGE(BACK_TO_LOGIN)##."</a> or</center></p>";

echo "<p><center>Return to the previous page <a href=\"java script:history.back()\">".##SCRIPTMESSAGE(BACK)##."</a></center></p>";

return;

}
The user is still informed they have no Permissions but at least they can return.

Also you could doctor up the snippet to be formated a bit nicer.

S
sloftus author 3/20/2006

That works just fine.
Thanks for your help DaleM