in reply to CGI::Application::Authentication and Static Pages
And you can call check in every runmode. Furthermore, you are aware that with CGI::Application::Plugin::Authentication, you can block ALL runmodes NOT matching whatever.. such as..# uses CGI::Application::Plugin::Forward and Authen.. etc # you must know these by now.. sub break_a_leg : Runmode { my $self = shift; $self->__check or return $self->forward('error'); # ... do whatever... } sub __check { my $self = shift; $self->authen or die('no way.'); $self->_my_sub_check_user_input() or return 0; return 1; }
#more incomplete code.. sub _authen_config { my $self = shift; # authenticate $self->authen->config( DRIVER => [ 'Generic', sub { return $self->_verify_credentials(@_); }, ], LOGIN_SESSION_TIMEOUT => '45m', # TODO change to 35m for release CREDENTIALS => ['authen_username','authen_password','authen_captcha'], STORE => 'Session', LOGIN_RUNMODE => 'login', ); $self->authen->protected_runmodes(qr/^(?!login)/); return 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI::Application::Authentication and Static Pages
by techcode (Hermit) on Jan 20, 2008 at 01:43 UTC |