CGI-Application-Plugin-Authentication

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
You can set this option to customize the login form that is created
when a user needs to be authenticated. If you wish to replace the
entire login form with a completely custom version, then just set
LOGIN_RUNMODE to point to your custom runmode.
 
All of the parameters listed below are optional, and a reasonable
default will be used if left blank:
 
DISPLAY_CLASS (default: Classic)
    the class used to display the login form. The alternative is
    "Basic" which aims for XHTML compliance and leaving style to
    CSS. See CGI::Application::Plugin::Authentication::Display for
    more details.
 
TITLE (default: Sign In)
    the heading at the top of the login box
 
USERNAME_LABEL (default: User Name)
    the label for the user name input
 
PASSWORD_LABEL (default: Password)

example/templates/login.tmpl  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<link rel="stylesheet" type="text/css" href="/css/template.css"/>
<!--[if lt IE 8]>
  <link rel="stylesheet" type="text/css" href="/css/ieonly.css" />
<![endif]-->
<!--[if lt IE 7]>
  <link rel="stylesheet" type="text/css" href="/css/ieonly6.css" />
<![endif]-->

example/templates/one.tmpl  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h2>This page is NOT protected</h2><a href="?rm=two">Protected Runmode</a>
</body>
</html>

example/templates/two.tmpl  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<TMPL_VAR NAME="login.enforce_protection">
</head>
<body>
<h2>This page is protected</h2><h2>username: test</h2><br/><a href="?rm=one">Un-Protected Runmode</a>
<TMPL_VAR NAME="login.logout_form">

lib/CGI/Application/Plugin/Authentication.pm  view on Meta::CPAN

430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
runmode.
 
All of the parameters listed below are optional, and a reasonable default will
be used if left blank:
 
=over 4
 
=item DISPLAY_CLASS (default: Classic)
 
the class used to display the login form. The alternative is C<Basic>
which aims for XHTML compliance and leaving style to CSS. See
L<CGI::Application::Plugin::Authentication::Display> for more details.
 
=item TITLE (default: Sign In)
 
the heading at the top of the login box
 
=item USERNAME_LABEL (default: User Name)
 
the label for the user name input

lib/CGI/Application/Plugin/Authentication/Display.pm  view on Meta::CPAN

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
=item
 
The subclass L<CGI::Application::Plugin::Authentication::Display::Classic>
is provided to ensure backwards compatibility with the old code. It has
the advantage of working out of the box but still retaining flexibility.
 
=item
 
The subclass L<CGI::Application::Plugin::Authentication::Display::Basic>
is provided to ensure XHTML compliance and to leave styling to CSS style-sheets.
 
=item
 
You can handle all the HTML side yourself in which case this code is not even loaded.
 
=item
 
You can use derived classes in templates that have dot support, which keeps
the display code close to the templates. This has other advantages. For example
one can use the C<enforce_protection> method to mark a template as being

lib/CGI/Application/Plugin/Authentication/Display/Basic.pm  view on Meta::CPAN

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
  <input type="hidden" name="destination" value="${destination}" />
  <input type="hidden" name="rm" value="${runmode}" />
</form>
END
 
    return $html;
}
 
=head1 NAME
 
CGI::Application::Plugin::Authentication::Display::Basic - XHTML compliant no frills login display driver
 
=head1 DESCRIPTION
 
This module provides a login box that works out of the box but which can be
configured to modify the styling.
 
=head1 METHODS
 
=head2 new

t/out/frontpage-dev  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Content-Type: text/html; charset=ISO-8859-1
 
This is public
    <script language="javascript">
    var devpopup_window = window.open("", "devpopup_window", "height=400,width=600,scrollbars,resizable");
    devpopup_window.document.write("<?xml version=\"1.0\"?>\n" +
        "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" +
        "\n" +
        "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
        "<head>\n" +
        "    <title>Devpopup results</title>\n" +
        "    <style type=\"text/css\">\n" +
        "        div.report { border: dotted 1px black; margin: 1em;}\n" +
        "        div.report h2 { color: #000; background-color: #ddd; padding:.2em; margin-top:0;}\n" +
        "        div.report_full, div.report_summary { padding: 0em 1em; }\n" +
        "        a:hover, div.report h2:hover, a.print_button:hover { cursor: pointer; background-color: #eee; }\n" +

t/out/generic_login  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Set-Cookie: CAPAUTH_DATA=; path=/; expires=;
Date
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/grey  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/grey2  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/login  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/login-dev  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Content-Type: text/html; charset=ISO-8859-1
 
This is public
    <script language="javascript">
    var devpopup_window = window.open("", "devpopup_window", "height=400,width=600,scrollbars,resizable");
    devpopup_window.document.write("<?xml version=\"1.0\"?>\n" +
        "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" +
        "\n" +
        "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
        "<head>\n" +
        "    <title>Devpopup results</title>\n" +
        "    <style type=\"text/css\">\n" +
        "        div.report { border: dotted 1px black; margin: 1em;}\n" +
        "        div.report h2 { color: #000; background-color: #ddd; padding:.2em; margin-top:0;}\n" +
        "        div.report_full, div.report_summary { padding: 0em 1em; }\n" +
        "        a:hover, div.report h2:hover, a.print_button:hover { cursor: pointer; background-color: #eee; }\n" +

t/out/missing_color  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/names_of_colours  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/names_of_colours_2  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/names_of_colours_3  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/other_permutations  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/percentage  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/redirection_failure  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/redirection_failure_basic  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<form id="loginform" method="post" action="">
  <div class="login">

t/out/success-dev  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Set-Cookie: CAPAUTH_DATA=; path=/; expires=;
Date
Content-Type: text/html; charset=ISO-8859-1
 
This is private
    <script language="javascript">
    var devpopup_window = window.open("", "devpopup_window", "height=400,width=600,scrollbars,resizable");
    devpopup_window.document.write("<?xml version=\"1.0\"?>\n" +
        "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" +
        "\n" +
        "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
        "<head>\n" +
        "    <title>Devpopup results</title>\n" +
        "    <style type=\"text/css\">\n" +
        "        div.report { border: dotted 1px black; margin: 1em;}\n" +
        "        div.report h2 { color: #000; background-color: #ddd; padding:.2em; margin-top:0;}\n" +
        "        div.report_full, div.report_summary { padding: 0em 1em; }\n" +
        "        a:hover, div.report h2:hover, a.print_button:hover { cursor: pointer; background-color: #eee; }\n" +

t/out/username  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Set-Cookie: CAPAUTH_DATA=; path=/; expires=;
Date
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<style type="text/css">
<!--/* <![CDATA[ */

t/out/username-basic  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Set-Cookie: CAPAUTH_DATA=; path=/; expires=;
Date
Content-Type: text/html; charset=ISO-8859-1
 
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Sign In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
 
<form id="loginform" method="post" action="">
  <div class="login">



( run in 0.793 second using v1.01-cache-2.11-cpan-95122f20152 )