Closed (fixed)
Project:
Content Templates (Contemplate)
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Mar 2010 at 16:18 UTC
Updated:
15 Apr 2010 at 15:00 UTC
Hi
Probably an easy programming question to those who can, but if you can't...
I'm using Views and Contemplate to show teasers and hide the body if the user doesn't have the correct role membership (e.g. the "agenda" role in this example):
global $user;
if (in_array('agenda', $user->roles)) {
print $body;
}
How should this be adapted so that, instead of simply hiding the body, an unauthorised user is redirected to a standard 403 page (i.e. "join now to read this article").
Kind regards,
Ali
Comments
Comment #1
jrglasgow commentedyou could do the following using the drupal_access_denied function:
once the drupal_access_denied function is called the Drupal 403 error page is shown
Comment #2
AliMartin commentedThanks jrglasgow - worked a treat :o)
Comment #3
jrglasgow commented