Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [katabd] Members_Access plug in question

Quote Reply
Re: [katabd] Members_Access plug in question In reply to
Try this:

Code:
# work out if they are allowed to access this detailed page...
sub check_restrict_detail_page {

my ($page, $id, $link, $detail_match, $detail_name);
my (@ids,@locked);
$page = $IN->param('g') || $ENV{PATH_INFO} || '';
my $id;
if ($page =~ /(\d+)/) {
$id = $1;
}

if (!$id) {
print $IN->header();
print Links::SiteHTML::display('error', { error => Links::language('PAGE_INVALIDDETAIL', $page) });
return;
}

if ($DEBUG) {
print $IN->header();
print $id;
exit;
}

# grab the category in questions details....
my $cat_id = $DB->table('CatLinks')->select( { LinkID => $id } )->fetchrow;
if ($DB->table('Category')->count( { Restricted_Page => 1, ID => $cat_id } ) > 0 && !$USER->{Username}) {
print $IN->header();
print Links::SiteHTML::display('error', { error => $ErrorMessage } );
exit;
}

}

If that still doesn't work, try setting $DEUBG to 1, and then see what is outputted.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Members_Access plug in question katabd 7312 Feb 28, 2009, 10:07 PM
Thread Re: [katabd] Members_Access plug in question
Andy 7203 Mar 1, 2009, 5:21 AM
Thread Re: [Andy] Members_Access plug in question
Michael_Bray 7184 Mar 6, 2009, 11:50 PM
Thread Re: [Michael_Bray] Members_Access plug in question
Michael_Bray 7147 Mar 7, 2009, 12:12 AM
Thread Re: [Michael_Bray] Members_Access plug in question
Michael_Bray 7135 Mar 7, 2009, 1:54 AM
Post Re: [Michael_Bray] Members_Access plug in question
Andy 7125 Mar 7, 2009, 4:15 AM
Thread Re: [Michael_Bray] Members_Access plug in question
katabd 7087 Mar 9, 2009, 9:09 AM
Thread Re: [katabd] Members_Access plug in question
Andy 7094 Mar 9, 2009, 9:16 AM
Thread Re: [Andy] Members_Access plug in question
katabd 7036 Mar 11, 2009, 7:28 PM
Thread Re: [katabd] Members_Access plug in question
Andy 7024 Mar 12, 2009, 4:40 AM
Post Re: [Andy] Members_Access plug in question
Andy 6956 Mar 16, 2009, 12:38 AM