Custom Page problem
Posted: 2020-07-27 23:41
Hi All,
I made a custom page for my project. as there were a few pages that made the section i put them into a folder and added that folder into the hooks folder.
when the user signs in they are presented with all the tables including the custom page. when the page is accessed it gives an "Access denied" error. but after signing in the second time it works fine.
is anyone able to assist?
As all signed in users should have access I added the following code...
<?php
define('PREPEND_PATH', '../../'); /* the extra "../" is because I have this in a folder within the hooks folder */
$hooks_dir = dirname(__FILE__);
include("$hooks_dir/../../defaultLang.php");
include("$hooks_dir/../../language.php");
include("$hooks_dir/../../lib.php");
include_once("$hooks_dir/../../header.php");
/* grant access to all logged users */
$mi = getMemberInfo();
if(!$mi['username'] || $mi['username'] == 'guest'){
echo "<h3>Access denied Please Sign In</h3>";
exit;
}
Barry
include_once("$hooks_dir/../../footer.php");
?>
I made a custom page for my project. as there were a few pages that made the section i put them into a folder and added that folder into the hooks folder.
when the user signs in they are presented with all the tables including the custom page. when the page is accessed it gives an "Access denied" error. but after signing in the second time it works fine.
is anyone able to assist?
As all signed in users should have access I added the following code...
<?php
define('PREPEND_PATH', '../../'); /* the extra "../" is because I have this in a folder within the hooks folder */
$hooks_dir = dirname(__FILE__);
include("$hooks_dir/../../defaultLang.php");
include("$hooks_dir/../../language.php");
include("$hooks_dir/../../lib.php");
include_once("$hooks_dir/../../header.php");
/* grant access to all logged users */
$mi = getMemberInfo();
if(!$mi['username'] || $mi['username'] == 'guest'){
echo "<h3>Access denied Please Sign In</h3>";
exit;
}
Barry
include_once("$hooks_dir/../../footer.php");
?>