Access denied page
avorio - November 14, 2005 - 01:19
Hello guys,
How do I generate a drupal_access_denied() page properly?
I'm calling the function drupal_access_denied(), but it still shows the page content after the "access denied" message. It's like the page was generated twice. Two headers, two menus, two everything. The first one, with the access denied message; but the second one as the real page.
What can I be doing wrong?
Pice of code:
<?php
if ($note['private'] == 1) {
drupal_access_denied();
} else {
[...]
}
?>Thank you so much.

drupal_access_denied() does
drupal_access_denied()does not stop the PHP process. It simply prints out an access denied page. If the code after this function prints out a page aswell then you will see both.Hi, Does anyone have an
Hi,
Does anyone have an answer to this problem? I have a CCK node type which has a user reference field in it. I have made the .tpl file to check whether the currently logged in user is the same as the reference, and if not, i want to throw an access denied error. If i just put drupal_access_denied(), it seems to print the access denied page twice (one inside the other).
Thanks,
Nick Schoonens