if (!iMEMBER) {
redirect("index.php");
}
require_once "pgdeny.php";
<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }
$furl = FUSION_SELF;
$auser = $userdata['user_name'];
$getgid = dbquery(
"SELECT link_name, link_url, link_visibility FROM ".DB_SITE_LINKS."
WHERE link_url='$furl'"
);
$gid = dbarray($getgid);
$puid = $gid['link_visibility'] ;
$getugid = dbquery(
"SELECT user_groups, user_level FROM ".DB_USERS."
WHERE user_name='$auser'"
);
$gotuid = dbarray($getugid);
$ulid = $gotuid['user_level'];
$ugid = substr($gotuid['user_groups'],1);
//$puid = The page visibility ID
//$ugid = The user GROUP ID
//$ulid = The user LEVEL ID
if (iGUEST) {
if ($puid > '0')
redirect("index.php");
}
?>
Quote
mlynchl wrote:
The other issue is getting the links that FUSION_SELF doesn't get, like infusions/aw_ecal_panel/calendar.php?cal=month&
FUSION_SELF only gets the first file name like news.php or articles.php...
require_once "pgdeny.php";
<?php
if (!defined("IN_FUSION")) { die("Access Denied"); }
if ((!iSUPERADMIN) || (!iADMIN)) {
$furl = FUSION_SELF;
$auser = $userdata['user_name'];
$getgid = dbquery(
"SELECT link_name, link_url, link_visibility FROM ".DB_SITE_LINKS."
WHERE link_url='$furl'"
);
$gid = dbarray($getgid);
$puid = $gid['link_visibility'] ;
$getugid = dbquery(
"SELECT user_groups, user_level FROM ".DB_USERS."
WHERE user_name='$auser'"
);
$gotuid = dbarray($getugid);
$ulid = $gotuid['user_level'];
$ugid = substr($gotuid['user_groups'],1);
//$puid = The page visibility ID
//$ugid = The user GROUP ID
//$ulid = The user LEVEL ID
if (iGUEST) {
if ($puid > '0')
redirect("index.php");
}
if ((iMEMBER) && (!iUSER_GROUPS)){
if ($puid > '0' && $puid < '101')
redirect("index.php");
if ($puid > $ulid) redirect("index.php");
}
if (iUSER_GROUPS) {
if ($puid > '0' && $puid < '101') {
if ($ugid != $puid)
redirect("index.php");
}
if ($puid > '101')
redirect("index.php");
}
}
?>
Quote
JoiNNN wrote:
Installation:
- place this file in /includes/ folder
- open /includes/header_includes.php file and add: include INCLUDES."disable_pages.php";
- go to Settings > Main, click Enable button on 'Disable Pages' section and add your pages
Quote
Use of undefined constant TRUE_PHP_SELF - assumed 'TRUE_PHP_SELF' Linje: 28
Quote
JoiNNN wrote:
@smokeman
I've wrote/tested the code on 7.02.04, haven't tested other versions.
Quote
mlynchl wrote:
Well so far what I have works for guests, members and members part of a group, however there is something not working right when I try to use FUSION_REQUEST or TRUE_PHP_SELF as the database search, I used echo to view these and they start with a / so I had that removed using substr but still didn't work... So for now, what I have will work on PHP_Fusion's main pages that doesn't have a directory included in the link, like forum/index.php, but works on everything else like faq.php and contact.php
Category Forum
Announcements & Security IssuesLabels
None yet
Statistics
6 participants
Notifications
You are not receiving notifications from this thread.
Related Questions