开发者

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

开发者 https://www.devze.com 2022-12-28 06:15 出处:网络
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.S开

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. S开发者_如何转开发o 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?


hook_boot should work just fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消