Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Good way to redirect to a "members only" section of website

by Shuraski (Scribe)
on Feb 02, 2013 at 17:02 UTC ( #1016723=note: print w/ replies, xml ) Need Help??


in reply to Re: Good way to redirect to a "members only" section of website
in thread Good way to redirect to a "members only" section of website

Yagna, my best advice is to use Catalyst to get this functionality nicely.

You include Catalyst::Plugin::Authentication just like it says in the Catalyst Tutorial.

You basically end up leading off each templated page that you want restricted to logged-in users with this:

[% IF c.user_exists %] ...the rest of your content here... [% END %]
Your home page or whatever you want to call it won't include this code at the head, so users who haven't logged in yet can see the content that you've not restricted. It works nicely without a lot of fuss. Have fun!


Comment on Re^2: Good way to redirect to a "members only" section of website
Download Code
Re^3: Good way to redirect to a "members only" section of website
by yagna (Novice) on Feb 02, 2013 at 17:18 UTC
    Hi Shuraski, Since my application is simple I wanted to stay away from frameworks. I will test it out just get a feel for using catalyst. Thanks, Yagna

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016723]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-12-22 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls