Gantry-Plugins-Uaf

 view release on metacpan or  search on metacpan

lib/Gantry/Plugins/Uaf.pm  view on Meta::CPAN

                # standard page loads work quite nicely.
                #
                # --> $gobj->uaf_authn->set_token($user);
                #
                $gobj->uaf_user($user);
                $gobj->session_unlock();

            } else { 

                $gobj->session_unlock();
                $gobj->uaf_authn->relocate($gobj->uaf_authn->login_rootp); 
            
            }
            
        }

    }

}

sub do_login {

lib/Gantry/Plugins/Uaf/Authenticate.pm  view on Meta::CPAN


            $user = $self->validate($params->{username}, 
                                    $params->{password});

            if (defined($user)) {

                $gobj->session_update('uaf_user', $user);

                if ($count > $limit) {

                    $self->relocate($denied_rootp);
                    return;

                }

                $gobj->session_update('uaf_login_attempts', 0);
                $self->set_token($user);
                $self->relocate($app_rootp);

            } else {

                $self->relocate($login_rootp); 

            }

        } else {

            $uaf_title = $gobj->fish_config('uaf_title') || 'Please Login';
            $uaf_wrapper = $gobj->fish_config('uaf_wrapper') || 'default.tt';
            $uaf_template = $gobj->fish_config('uaf_template') || 'uaf_login.tt';

            $gobj->template_wrapper($uaf_wrapper);

lib/Gantry/Plugins/Uaf/Authenticate.pm  view on Meta::CPAN

    }

}

sub logout {
    my ($self) = shift;

    my $app_rootp = $self->{gantry}->app_rootp || "/";

    $self->invalidate();
    $self->relocate($app_rootp);

}

sub relocate($$) {
    my ($self, $url) = @_;

    $self->{gantry}->relocate($url);

}

sub set_token($$) {
    my ($self, $user) = @_;

    my $salt = $user->attribute('salt');
    my $path = $self->{gantry}->fish_config('uaf_cookie_path') || '/';
    my $domain = $self->{gantry}->fish_config('uaf_cookie_domain') || "";
    my $secure = $self->{gantry}->fish_config('uaf_cookie_secure');

lib/Gantry/Plugins/Uaf/Authenticate.pm  view on Meta::CPAN


This method also implements a simple three tries at login attempts. If after 
three tries, all attempts are redirected to "/login/denied", which displays 
a simple "denied" page. After a succesful login, a redirect is sent for "/".

=item logout($)

This method handles the url "/logout". It runs the invalidate() method and 
then redirects back to "/".

=item relocate($$)

Handles relocations, it currently just calls the Gantry relocate() 
function.

=item set_token($$)

This method creates the security token. It is passed the User object. The 
default action is to create a token using parts of the User object and
random data. This token is then stored in the session store and sent to the
browser as a cookie.

=item avoid($)



( run in 0.973 second using v1.01-cache-2.11-cpan-5511b514fd6 )