I have a Cat app with the usual Session and Authentication
stuff running, though I'm using my own Authz stuff instead
of
any of the built-in Roles tools. It's a typical setup with
regular users who can just view things, some users with
add/edit privs, and superusers who can create new users
etc.
In a previous, non-Cat version of this app I had a function
so
that people using the app from the main company location
would
automatically be logged in as a generic "regular"
user, and
only if they tried to do any adding/editing would get
redirected to a login page. I forgot about this and didn't
build it into the Cat version, and now I've learned that
the
reason people continue to use the clunky old version
instead
of my shiny fast featureful Cat app is that they're too
lazy
to log in, so I'd like to add this.
The way it looked, more or less, in the old one was:
if ( !defined( $self->login_user() ) ) {
if ( $ENV =~ m/hairyIPaddressRegEx/ ) {
$self->login("generic");
$self->redirect( $self-> );
} else {
# redirect to login page
}
}
What's the Right Way to do this in Cat?
Thanks.
Jesse, still not programming much lately
_______________________________________________
List: Catalyst lists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalyst lists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/
|