Currently using this to check the permissions of a user, If the user is logged in then it shows the file and lists the DIR. This works fine along with the login screen showing up if the user is not shown to be logged in.
I need it to be that if the product is not owned by the user (i.e. the permission is not level 3) then it will automatically link them to the brochure. I had a header setup to send the user but it does not function as I want it to.
Now what it does is loads the page but does not pass on the DIV (hence the name to check on the f12 debug to see if it had passed)
What am I missing?
p.s. the PHP logs show no errors
-- Update --
Gone through and commented out sections to see if the IF statement was attached to wrong thing, currently nothing still getting same problem
<?php
if (!securePage($_SERVER['PHP_SELF'])){die();}
$parts = parse_url($_SERVER["REQUEST_URI"]);
$page_name = basename($parts['path']);
//Links for logged in user
if(isUserLoggedIn()) {
//Links for permission level 3 (BOF)
if ($loggedInUser->checkPermission(array(3))){
if ($handle = opendir('CD500/')) {
while (false !== ($file = readdir($handle)))
{
if ($file != '.' && $file != '..'){
$thelist .= '<a href="/CD500/'.$file.'" target="_blank" >'.$file.'</a></br>';
}
}
closedir($handle);
echo "
<div id='output'>
List of help files:</div>
<div id='List'>
$thelist ";
}
else {
echo " asdfasdfasdfadf ";
}
}
?>
<div id='default'>
<?php } else { ?>
<li><a class="<?php echo ($page_name=='login.php')?'selected':'';?>" href="login.php">Login</a></li>
<li><a class="<?php echo ($page_name=='register.php')?'selected':'';?>" href="register.php">Register</a></li>
<li><a class="<?php echo ($page_name=='forgot-password.php')?'selected':'';?>" href="forgot-password.php">Forgot Password</a></li>
<?php } ?></div>