Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Ultimate 403 Error Page
If user isn't logged in it displays login prompt, if user is logged in and still gets a 403 then it displays a 'you are not authorised' message.
Step 1 of 2
Create a page and assign in admin/settings/error-reporting
Step 2 of 2
Add the following to the page:
<?php
global $user;
if ($user->uid) {
Print "Although you are logged in you are unfortunately not authorised to view this page.";
}
if (!$user->uid) {
print drupal_get_form('user_login');
}
?>