You could do the check in a model file -- all (non-conditional) model files
are executed on every request (before the requested controller action).
E.g.:
if not (session.version_selected or
request.function=='version_selection_page'):
redirect(URL('default','version_selection_page')
Anthony
On Sunday, July 10, 2011 3:22:44 PM UTC-4, Luis Goncalves wrote:
> Hello Everyone!
>
> Is there a simple/efficient/secure way to temporarily redirect all requests
> to a specific page?
> (all requests except for those that define a few actions that are permitted
> at that point in time)
>
> The context:
>
> - When user logs in, he needs to choose the version of the website to
> use (different version access different sets of data)
> - Until he chooses a version, clicking on any of the menu options, or
> links, or typing in any URL should not execute normally, but rather send
> him
> (keep him on) a page that tells him to "please select a version"
> - Ideally, selecting the version is done from the 'version' menubar
> option, so these still have to work properly.
>
> An ugly way to do this is to have every single possible action
> (URL,controller) check if the version selection has been done or not, but
> that seems like an inelegant, brute-force approach (and prone to errors if
> new functionality is added whilst forgetting to include the check).
>
> Thanks!!!
>
> Luis.
>