Where should I place a function that I want to run before the cached page is served (Drupal)

Posted by kidbrax on Stack Overflow See other posts from Stack Overflow or by kidbrax
Published on 2010-04-28T14:30:32Z Indexed on 2010/04/28 14:33 UTC
Read the original article Hit count: 181

Filed under:
|
|
|

We have a intranet site that runs on Drupal. If an employee hits the site from outside our network they are required to login first. If they are already in our network, they can browse around freely. So we have a function that checks where they are coming from and redirects them to a login page if they are from outside. If we enable caching, they are not redirected because the cached page is rendered without running our function. The code currently exists inside of the theme_preprocess function. Where can I put it so that it always runs before the cached pages are served?

© Stack Overflow or respective owner

Related posts about drupal

Related posts about cache