[tbnl-devel] Re: default handler

Edi Weitz edi at agharta.de
Thu Dec 22 18:01:59 UTC 2005


Hi Jim!

On Thu, 22 Dec 2005 07:11:18 -0700 (MST), Jim Prewett <download at hpc.unm.edu> wrote:

> I've been pumping my co-worker, Jared, for information on dynamic
> websites.  Jared is the primary author of our
> trouble-ticket/accounting/inventory/testing/everything-but-the-kitchen-sink
> web application called AIRS.  AIRS is a Perl/Mason/MySQL based
> application.  (its on Sourceforge if you ever something like that
> FWIW)
>
> Jared was telling me that in AIRS, one of the tricks they do to
> ensure that a user is logged in with a valid session is to have what
> Jared calls a "default handler" which is invoked with every page (by
> Mason apparently).  I guess it serves to validate anything you need
> validated before a page is displayed; Jared notes that it can be
> used to temporarily "hijack" the functionality of the page (so, in
> AIRS's case, the list-ticket page will display the list of tickets
> to a logged in user, but a user without a valid session will be sent
> to the login page and after being successfully logged in, she will
> be shown the list of tickets).
>
> Does TBNL support anything like this "out of the box"?  If not, do
> you have any thoughts on how one might implement such a feature?
> Would you, maybe, define a macro like (with-valid-session ... )
> that would be called inside of each function that spits back a
> webpage?
>
> I like the idea, but i'm not necessarily after a 1:1 mapping to the
> concepts in Mason, I just want to implement the general idea.

Generally, I think that questions like these are better asked on the
TBNL mailing list (on Cc now, you need to be subscribed to post
something).  Other users might already have a solution for this and
people who have similar questions can later scan the archives.

No, TBNL doesn't have this out of the box but it should be flexible
enough to add whatever scheme you like.  I myself usually use macros
like WITH-VALID-SESSION, yes.

Cheers,
Edi.



More information about the Tbnl-devel mailing list