Apache-Wyrd

 view release on metacpan or  search on metacpan

Wyrd/Site/Login.pm  view on Meta::CPAN

use 5.006;
use strict;
use warnings;
no warnings qw(uninitialized);

package Apache::Wyrd::Site::Login;
use base qw(Apache::Wyrd::Interfaces::Setter Apache::Wyrd);
use Apache::Constants qw(OK);
use MIME::Base64;
use LWP::UserAgent;
use HTTP::Request::Common;
our $VERSION = '0.98';

=pod

=head1 NAME

Apache::Wyrd::Site::Login - HTML Interface for Apache::Wyrd::Services::(Pre)Auth

=head1 SYNOPSIS

  <BASENAME::Login>
    <BASENAME::Template name="login">
      <input type="text" name="username"><br>
      <input type="text" name="password">
    </BASENAME::Template>
    <BASENAME::Template name="username">
      You are logged in as $:username
    </BASENAME::Template>
    <BASENAME::Template name="error">
      Login Error: Try again.<br>
      <input type="text" name="username"><br>
      <input type="text" name="password">
    </BASENAME::Template>
  </BASENAME::Login>

=head1 DESCRIPTION

The Login Wyrd is used to provide an interface on any page for logging in as
a user of the site.  It requires three templates: One for the login itself (called "login"), another to show that the user is logged in which can show information about which user is logged in (called 'username'), and a third for login errors (see SY...

=head2 HTML ATTRIBUTES

NONE

=head2 PERL METHODS

I<(format: (returns) name (arguments after self))>

=over

=item (void) C<_form_template> (scalar)

_form_template provides the hidden data that is needed to supply the
Apache::Wyrd::Services::Auth handler with the necessary security credentials
and return values.  It does not need to be overridden when using the Auth or
PreAuth Services.   It is provided as a method in order to handle any other
parameters the webmaster has added to the login process.

=cut

sub _form_template {
	my ($self) = @_;
	#provide a ultra-rudimentary login form template, or use the one provided by the form attribute.
	return $self->{'form'} || q(
<form action="$:key_url" method="post">
<input type="hidden" name="ticket" value="$:preauth_url">
<input type="hidden" name="on_success" value="$:on_success">
<input type="hidden" name="use_error" value="$:use_error">
$:data
</form>



( run in 1.150 second using v1.01-cache-2.11-cpan-5a3173703d6 )