News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Wrong page is being displayed (index.php) when access is denied versus approved?

Started by rcane, April 19, 2022, 05:49:51 PM

Previous topic - Next topic

rcane

I've got a folder on the server that has some php files being used to display pdf's in a folder.

Depending on your SMF $user_info['groups'], you can either see the contents OR see the contents and have the ability to upload/delete them too.  Only a few folks get that privilege.

1. The php includes SSI.php to do the checking;
2. To simply view contents of the page you need to be regular member (0) or admin (1);
3. If you're not you get a simple pause and redirect;
4. otherwise it goes on.

if (!in_array(0, $user_info['groups'])) && (!in_array(1, $user_info['groups'])) {

echo "You are not permitted to view this.  Redirecting..."; //DENIAL MESSAGE
header('Refresh: 2; URL=http://myDomain.com/');
die;

}

But, when I test it with a incognito browser (chrome), private (Firefox), private(safari) or tor browser, using any account to test it all it doesn't show the reject message up above.  It's using one from a different index page--in a different folder--that has since been changed itself.


I can't see how it's looking at the proper conditions to proceed with showing the page, and applying the conditionals, but the error part is completely different. 


Advertisement: