By profix898 on
How can I detect 'access denied' and 'page not found' error pages from a contributed module? How is it possible to find out whether the page currently viewed is such a page or loaded correctly? The path seems to stay the same. For example: a user tries to access node/xy, but he/she does not have the proper permission to view that page, so the user is directed to 'access denied' page (the path however is still node/xy). Is there any global variable or stg. reflecting the 403 state? How is this handled internally? Can I hook into error pages from contrib modules?
Comments
Perhaps looking at/using the
Perhaps looking at/using the customerror module might help?
-K
Detect access denied within module - Drupal 7.x
($status = drupal_get_http_header('status')) && strpos($status, '200') !== 0