Member
Member
mric   30-07-2015, 20:07
#1

Hello

When a user opens a link (page or album) I would like to check his rights and transparently redirect to a given page.

I idea is not to use nginx nor Apache redirect.

For instance

  • anonymous requests "/pages/members" and is redirected to "/pages/join"
  • logged in user requests "/pages/members" and is granted access

I would like to manage multiple rediect (not only "/pages/members").

Obviously the idea could be applied to any other criteria. For instance you logged 10 times today then are redirected to a given page.

I suspect I may use zp_register_filter/zp_apply_filter('getLink'...) for that and I also suspect the routing is done in zp-core/index.html
However I cannot figure out the details.

Thank you for your advice.

Member
Member
sbillard   10-08-2015, 01:30
#2

There is a filter named load_theme_script that is called during the page loading process. It returns the script to be loaded. You can create a plugin which registers that filter.

Your handler for that filter would decide if a redirect should happen and return a different script and/or suitably modify global variables so that the loaded script does what you want.

Administrator
Administrator
acrylian   10-08-2015, 08:08
#3

@mric: Sorry, somehow missed your post… The answer given above is the way to go.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.