PDA

View Full Version : "canview" permission


Jakeman
09-06-2003, 07:41 PM
(vB 2.2.9)

near the end of forum/global.php where it checks if the user can view the forum, I have added two extra conditions to:

1) allow my users to view my "vB integrated" pages that are outside the forum directory.

2) allow everyone to view the forumhome page.

the first condition has always worked for the first goal. Today I tried adding the second condition to achieve the second goal but it isn't working... guests are still getting a "no permission" page on my forumhome page.

if (!$permissions['canview'] && strstr($PHP_SELF, "/forum/") && !strstr($PHP_SELF, "/forum/index.php")) {
if (substr($currentscript,-strlen('register.php'))!='register.php' and substr($currentscript,-strlen('member.php'))!='member.php') {
show_nopermission();
} elseif ($action!="register" and $action!="signup" and $action!="activate" and $action!="login" and $action!="logout" and $action!="lostpw" and $action!="emailpassword" and $action!="addmember" and $action!="coppaform" and $a!="act" and $a!="ver" and $action!="resetpassword" and $a!="pwd") {
show_nopermission();
}
}

these two conditions in the first "if" statement are the ones I added:

&& strstr($PHP_SELF, "/forum/") && !strstr($PHP_SELF, "/forum/index.php")

does anyone know why this isn't working?

Jakeman
09-06-2003, 07:45 PM
pfft... they check that permission again at the top of forum/index.php

if (!$permissions['canview']) {
show_nopermission();
}