blib/lib/CGI/Application/Plugin/Authentication/Display/Classic.pm

filter: Statementstmt 100% 85 / 85 Branchbran 100% 52 / 52 Conditioncond 94.1% 16 / 17 MC/DCmcdc 80.0% 8 / 10 Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 98.2% 171 / 174 CC 34 SCAR 28.1
CC
34
Cov
99%
_login_styles
23.0
login_box
12.0
BEGIN
1.0
CRAP 16.6
« blib/lib/CGI/Application/Plugin/Authentication.pm ↑ Summary blib/lib/CGI/Application/Plugin/Authentication/Driver/Generic.pm »
1 package CGI::Application::Plugin::Authentication::Display::Classic;
2 14 ▶use base qw(CGI::Application::Plugin::Authentication::Display);
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 14 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 14 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub new {
10 55 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
11 55 my $cgiapp = shift;
12 55 my $self = CGI::Application::Plugin::Authentication::Display->new($cgiapp);
13 55 bless $self, $class;
14 55 return $self;
15 }
16  
17 sub login_box {
18 63 ▶ my $self = shift;
Subroutine login_box: called CC=12 SCAR=24.8
Pod documented
19 63 my $credentials = $self->_cgiapp->authen->credentials;
20 63 my $runmode = $self->_cgiapp->get_current_runmode;
21 63 ▶ my $destination = $self->_cgiapp->authen->_detaint_destination || $self->_cgiapp->authen->_detaint_selfurl;
Condition100%3/3
$self->_cgiapp->authen->_detaint_destination || $self->_cgiapp->authen->_detaint_selfurl
l!l&&r!l&&!r
2601
MC/DC100%2/2
$self->_cgiapp->authen->_detaint_destination || $self->_cgiapp->authen->_detaint_selfurl
$self->_cgiapp->authen->_detaint_destination $self->_cgiapp->authen->_detaint_selfurl
Truth table100%3/3
A || B
A= $self->_cgiapp->authen->_detaint_destinationB= $self->_cgiapp->authen->_detaint_selfurl
ABresult
1X1
011
000
22 63 my $action = $self->_cgiapp->authen->_detaint_url;
23 63 my $username = $credentials->[0];
24 63 my $password = $credentials->[1];
25 63 ▶ my $login_form = $self->_cgiapp->authen->_config->{LOGIN_FORM} || {};
Condition100%2/2
$self->_cgiapp->authen->_config->{'LOGIN_FORM'} || {}
l!l
1944
MC/DC100%1/1
$self->_cgiapp->authen->_config->{'LOGIN_FORM'} || {}
$self->_cgiapp->authen->_config->{'LOGIN_FORM'}
Truth table100%2/2
A
A= $self->_cgiapp->authen->_config->{'LOGIN_FORM'}
Aresult
11
00
26 63 my %options = (
27 TITLE => 'Sign In',
28 USERNAME_LABEL => 'User Name',
29 PASSWORD_LABEL => 'Password',
30 SUBMIT_LABEL => 'Sign In',
31 COMMENT => 'Please enter your username and password in the fields below.',
32 REMEMBERUSER_OPTION => 1,
33 REMEMBERUSER_LABEL => 'Remember User Name',
34 REMEMBERUSER_COOKIENAME => 'CAPAUTHTOKEN',
35 REGISTER_URL => '',
36 REGISTER_LABEL => 'Register Now!',
37 FORGOTPASSWORD_URL => '',
38 FORGOTPASSWORD_LABEL => 'Forgot Password?',
39 INVALIDPASSWORD_MESSAGE => 'Invalid username or password<br />(login attempt %d)',
40 INCLUDE_STYLESHEET => 1,
41 FORM_SUBMIT_METHOD => 'post',
42 %$login_form,
43 );
44  
45 63 my $messages = '';
46 63 ▶ if ( my $attempts = $self->_cgiapp->authen->login_attempts ) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $attempts = $self->_cgiapp->authen->login_attempts) { } 44 19 63
elsif ($options{'COMMENT'}) { } 18 1 19
47 44 $messages .= '<li class="warning">' . sprintf($options{INVALIDPASSWORD_MESSAGE}, $attempts) . '</li>';
48 } elsif ($options{COMMENT}) {
49 18 $messages .= "<li>$options{COMMENT}</li>";
50 }
51  
52 63 my $tabindex = 3;
53 63 my ($rememberuser, $username_value, $register, $forgotpassword, $javascript, $style) = ('','','','','','');
54 63 ▶ if ($options{FOCUS_FORM_ONLOAD}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($options{"FOCUS_FORM_ONLOAD"}) 1 62 63
55 1 $javascript .= "document.loginform.${username}.focus();\n";
56 }
57 63 ▶ if ($options{REMEMBERUSER_OPTION}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($options{"REMEMBERUSER_OPTION"}) 62 1 63
58 62 $rememberuser = qq[<input id="authen_rememberuserfield" tabindex="$tabindex" type="checkbox" name="authen_rememberuser" value="1" />$options{REMEMBERUSER_LABEL}<br />];
59 62 $tabindex++;
60 62 $username_value = $self->_cgiapp->authen->_detaint_username($username, $options{REMEMBERUSER_COOKIENAME});
61 62 ▶ $javascript .= "document.loginform.${username}.select();\n" if $username_value;
Branch: 1 branch
BranchTrueFalseTotal
if $username_value 33 29 62
62 }
63 63 my $submit_tabindex = $tabindex++;
64 63 ▶ if ($options{REGISTER_URL}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($options{"REGISTER_URL"}) 1 62 63
65 1 $register = qq[<a href="$options{REGISTER_URL}" id="authen_registerlink" tabindex="$tabindex">$options{REGISTER_LABEL}</a>];
66 1 $tabindex++;
67 }
68 63 ▶ if ($options{FORGOTPASSWORD_URL}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($options{"FORGOTPASSWORD_URL"}) 1 62 63
69 1 $forgotpassword = qq[<a href="$options{FORGOTPASSWORD_URL}" id="authen_forgotpasswordlink" tabindex="$tabindex">$options{FORGOTPASSWORD_LABEL}</a>];
70 1 $tabindex++;
71 }
72 63 ▶ if ($options{INCLUDE_STYLESHEET}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($options{"INCLUDE_STYLESHEET"}) 60 3 63
73 60 my $login_styles = $self->_login_styles;
74 60 $style = <<EOS;
75 <style type="text/css">
76 <!--/* <![CDATA[ */
77 $login_styles
78 /* ]]> */-->
79 </style>
80 EOS
81 }
82 63 ▶ if ($javascript) {
Branch: 1 branch
BranchTrueFalseTotal
if ($javascript) 34 29 63
83 34 $javascript = qq[<script type="text/javascript" language="JavaScript">$javascript</script>];
84 }
85  
86 63 my $html .= <<END;
87 $style
88 <form name="loginform" method="$options{FORM_SUBMIT_METHOD}" action="${action}">
89 <div class="login">
90 <div class="login_header">
91 $options{TITLE}
92 </div>
93 <div class="login_content">
94 <ul class="message">
95 ${messages}
96 </ul>
97 <fieldset>
98 <label for="${username}">$options{USERNAME_LABEL}</label>
99 <input id="authen_loginfield" tabindex="1" type="text" name="${username}" size="20" value="$username_value" /><br />
100 <label for="${password}">$options{PASSWORD_LABEL}</label>
101 <input id="authen_passwordfield" tabindex="2" type="password" name="${password}" size="20" /><br />
102 ${rememberuser}
103 </fieldset>
104 </div>
105 <div class="login_footer">
106 <div class="buttons">
107 <input id="authen_loginbutton" tabindex="${submit_tabindex}" type="submit" name="authen_loginbutton" value="$options{SUBMIT_LABEL}" class="button" />
108 ${register}
109 ${forgotpassword}
110 </div>
111 </div>
112 </div>
113 <input type="hidden" name="destination" value="${destination}" />
114 <input type="hidden" name="rm" value="${runmode}" />
115 </form>
116 $javascript
117 END
118  
119 63 return $html;
120 }
121  
122 sub _login_styles {
123 60 ▶ my $self = shift;
Subroutine _login_styles: called CC=23 SCAR=31.4
124 60 ▶ my $login_form = $self->_cgiapp->authen->_config->{LOGIN_FORM} || {};
Condition100%2/2
$self->_cgiapp->authen->_config->{'LOGIN_FORM'} || {}
l!l
1644
MC/DC100%1/1
$self->_cgiapp->authen->_config->{'LOGIN_FORM'} || {}
$self->_cgiapp->authen->_config->{'LOGIN_FORM'}
Truth table100%2/2
A
A= $self->_cgiapp->authen->_config->{'LOGIN_FORM'}
Aresult
11
00
125 60 my %colour = ();
126  
127 60 ▶ $colour{base} = $login_form->{BASE_COLOUR} || '#445588';
Condition100%2/2
$login_form->{'BASE_COLOUR'} || '#445588'
l!l
753
MC/DC100%1/1
$login_form->{'BASE_COLOUR'} || '#445588'
$login_form->{'BASE_COLOUR'}
Truth table100%2/2
A
A= $login_form->{'BASE_COLOUR'}
Aresult
11
00
128 60 ▶ $colour{lighter} = $login_form->{LIGHTER_COLOUR} if $login_form->{LIGHTER_COLOUR};
Branch: 1 branch
BranchTrueFalseTotal
if $login_form->{"LIGHTER_COLOUR"} 9 51 60
129 60 ▶ $colour{light} = $login_form->{LIGHT_COLOUR} if $login_form->{LIGHT_COLOUR};
Branch: 1 branch
BranchTrueFalseTotal
if $login_form->{"LIGHT_COLOUR"} 9 51 60
130 60 ▶ $colour{dark} = $login_form->{DARK_COLOUR} if $login_form->{DARK_COLOUR};
Branch: 1 branch
BranchTrueFalseTotal
if $login_form->{"DARK_COLOUR"} 9 51 60
131 60 ▶ $colour{darker} = $login_form->{DARKER_COLOUR} if $login_form->{DARKER_COLOUR};
Branch: 1 branch
BranchTrueFalseTotal
if $login_form->{"DARKER_COLOUR"} 9 51 60
132 60 ▶ $colour{grey} = $login_form->{GREY_COLOUR} if $login_form->{GREY_COLOUR};
Branch: 1 branch
BranchTrueFalseTotal
if $login_form->{"GREY_COLOUR"} 2 58 60
133
134 60 ▶ if ( grep { ! defined $colour{$_} || index($colour{$_}, '%') >= 0 } qw(lighter light dark darker) ) {
Branch: 2 branches
BranchTrueFalseTotal
if (grep {not defined $colour{$_} or index($colour{$_}, "%") != -1;} "lighter", "light", "dark", "darker") 59 1 60
not defined $colour{$_} or index($colour{$_}, "%") != -1 36 204 240
135 59 eval { require Color::Calc };
136 59 ▶ if ($@ && $login_form->{BASE_COLOUR}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@ and $login_form->{"BASE_COLOUR"}) 1 58 59
Condition100%3/3
$@ and $login_form->{"BASE_COLOUR"}
!ll&&!rl&&r
5711
MC/DC100%2/2
$@ and $login_form->{"BASE_COLOUR"}
$@ $login_form->{"BASE_COLOUR"}
Truth table100%3/3
A and B
A= $@B= $login_form->{"BASE_COLOUR"}
ABresult
0X0
100
111
137 1 warn "Color::Calc is required when specifying a custom BASE_COLOUR, and leaving LIGHTER_COLOUR, LIGHT_COLOUR, DARK_COLOUR or DARKER_COLOUR blank or when providing percentage based colour";
138 }
139 59 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 2 57 59
140 2 $colour{base} = '#445588';
141 2 $colour{lighter} = '#d0d5e1';
142 2 $colour{light} = '#a2aac4';
143 2 $colour{dark} = '#303c5f';
144 2 $colour{darker} = '#1b2236';
145 2 $colour{grey} = '#565656';
146 } else {
147 $colour{lighter} = !$colour{lighter}
148 ? Color::Calc::light_html($colour{base}, 0.75)
149 : $colour{lighter} =~ m#(\d{2})%#
150 ? Color::Calc::light_html($colour{base}, $1 / 100)
151 57 ▶ : $colour{lighter};
Branch: 2 branches
BranchTrueFalseTotal
!$colour{'lighter'} ? : 49 8 57
$colour{'lighter'} =~ /(\d{2})%/ ? : 6 2 8
152 $colour{light} = !$colour{light}
153 ? Color::Calc::light_html($colour{base}, 0.5)
154 : $colour{light} =~ m#(\d{2})%#
155 ? Color::Calc::light_html($colour{base}, $1 / 100)
156 57 ▶ : $colour{light};
Branch: 2 branches
BranchTrueFalseTotal
!$colour{'light'} ? : 49 8 57
$colour{'light'} =~ /(\d{2})%/ ? : 5 3 8
157 $colour{dark} = !$colour{dark}
158 ? Color::Calc::dark_html($colour{base}, 0.3)
159 : $colour{dark} =~ m#(\d{2})%#
160 ? Color::Calc::dark_html($colour{base}, $1 / 100)
161 57 ▶ : $colour{dark};
Branch: 2 branches
BranchTrueFalseTotal
!$colour{'dark'} ? : 49 8 57
$colour{'dark'} =~ /(\d{2})%/ ? : 5 3 8
162 $colour{darker} = !$colour{darker}
163 ? Color::Calc::dark_html($colour{base}, 0.6)
164 : $colour{darker} =~ m#(\d{2})%#
165 ? Color::Calc::dark_html($colour{base}, $1 / 100)
166 57 ▶ : $colour{darker};
Branch: 2 branches
BranchTrueFalseTotal
!$colour{'darker'} ? : 49 8 57
$colour{'darker'} =~ /(\d{2})%/ ? : 4 4 8
167 57 ▶ $colour{grey} ||= Color::Calc::bw_html($colour{base});
Condition66%2/3
$colour{"grey"} ||= Color::Calc::bw_html($colour{"base"})
l!l&&r!l&&!r
2550
MC/DC0%0/2
$colour{"grey"} ||= Color::Calc::bw_html($colour{"base"})
$colour{"grey"} Color::Calc::bw_html($colour{"base"})
Truth table66%2/3
A ||= B
A= $colour{"grey"}B= Color::Calc::bw_html($colour{"base"})
ABresult
1X1
011
000
168 }
169 }
170 60 ▶ $colour{grey} ||= '#565656';
Condition100%2/2
$colour{"grey"} ||= "#565656"
l!l
591
MC/DC100%1/1
$colour{"grey"} ||= "#565656"
$colour{"grey"}
Truth table100%2/2
A
A= $colour{"grey"}
Aresult
11
00
171 60 return <<END;
172 div.login {
173 width: 25em;
174 margin: auto;
175 padding: 3px;
176 font-weight: bold;
177 border: 2px solid $colour{base};
178 color: $colour{dark};
179 font-family: sans-serif;
180 }
181 div.login div {
182 margin: 0;
183 padding: 0;
184 border: none;
185 }
186 div.login .login_header {
187 background: $colour{base};
188 border-bottom: 1px solid $colour{darker};
189 height: 1.5em;
190 padding: 0.45em;
191 text-align: left;
192 color: #fff;
193 font-size: 100%;
194 font-weight: bold;
195 }
196 div.login .login_content {
197 background: $colour{lighter};
198 padding: 0.8em;
199 border-top: 1px solid white;
200 border-bottom: 1px solid $colour{grey};
201 font-size: 80%;
202 }
203 div.login .login_footer {
204 background: $colour{light};
205 border-top: 1px solid white;
206 border-bottom: 1px solid white;
207 text-align: left;
208 padding: 0;
209 margin: 0;
210 min-height: 2.8em;
211 }
212 div.login fieldset {
213 margin: 0;
214 padding: 0;
215 border: none;
216 width: 100%;
217 }
218 div.login label {
219 clear: left;
220 float: left;
221 padding: 0.6em 1em 0.6em 0;
222 width: 8em;
223 text-align: right;
224 }
225 /* image courtesy of http://www.famfamfam.com/lab/icons/silk/ */
226 #authen_loginfield {
227 background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAG5SURBVHjaYvz//z8DJQAggFiIVfh0twHn9w8KD9+/ZBT+9/cfExfvwwc87GxWAAFEtAFf3yl++/9XikHXL56BkYmJ4dKmcoUPT99PBQggRmK8ALT9v4BUBQMLrxxQMztY7N+PjwyXtk76BxBATMRoFjGewsDCx8jw9Oxyht9vboIxCDAxs/wCCCC8LoBrZv/A8PPpVoZ/39gZ7p57xcDLJ8Xw5tkdBrO8DYwAAcRElOYXaxn+/73DwC4vzyAmzsLw58kJsGaQOoAAYiJK868nDGwSXgxvjp1n+Hz7HoNawRFGmFqAAMIw4MBEDaI1gwBAAKEYsKtL/b9x2HSiNYMAQACBA3FmiqKCohrbfQ2nLobn97Yz6Br/JEozCAAEEDgh/eb6d98yYhEDBxsnw5VNZxnOffjLIKltw/D52B6GH89fMVjUnGbEFdgAAQRPiexMzAyfDk9gMJbmYbh17irDueMrGbjExBi8Oy8z4ksnAAEENuDY1S8MjjsnMSgaezJ8Z2Bm+P95PgPX6ycENYMAQACBwyDSUeQ/GzB926kLMEjwsjOwifKvcy05EkxMHgEIIEZKszNAgAEA+j3MEVmacXUAAAAASUVORK5CYII=') no-repeat 0 1px;
228 background-color: #fff;
229 border-top: solid 1px $colour{grey};
230 border-left: solid 1px $colour{grey};
231 border-bottom: solid 1px $colour{light};
232 border-right: solid 1px $colour{light};
233 padding: 2px 0 2px 18px;
234 margin: 0.3em 0;
235 width: 12em;
236 }
237 /* image courtesy of http://www.famfamfam.com/lab/icons/silk/ */
238 #authen_passwordfield {
239 background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKbSURBVHjaYvz//z8DPvBko+s0IJUJ5U6X8d+dhSwPEEAMIANw4ccbXKYB8f8/P+6BMYgNEkNWAxBAhDV/Pff/5+t5/39/2gcU/gc25P5qpzkwdQABxIjNCzBnS7p2Mfz5tJ+BkVWE4dWRxWA5oBcYHiyyYnj5heGAedYxR4AAwmXAf0mPWQx/3q9n+P/3I9AAMaCoBsPr4x0MDH/+MUgHrGG4P8eF4fVf9gMAAcSEK/D+/3oA1gxm/3kLJG8wSDhWMAjoeTJ8fxjNoJDQzyD0+7sDQACx4DKAkVWcgZGZG2jIV6AJfxn+/37F8OfPO6BhRxl+f/nIwC7xluHPm58MAAHEhMX5ILHp787OYvj/7zvDr7f7Gf59vw804DUwPM4x/P3+loFb0ZfhVlc1wxMu7psAAcSCEd9MjAzswoYMAppmDD9e9DKwcIkwMHFyMPx+dZnh7+9vDDxqwQx3Ji1jeMrJc9W1/JQOQAAheyFT2mctw9+vpxh+fz7A8O1JDQMrEz/QK2YMb47uZpD0SmEAmsRwu7eJ4QUX1wWXklOGIE0AAcQIim9YShOzSmf49W4xw5+PdxlYeIUYWLh9GS6vXPH+3U/Gd3K/vikzcTAzvOTkOmNXeNIUZitAALFAbF4D9N8Bhl+vJjP8/vCUgY1fkoGZ24PhysoV7178Y9vmW3M8FqZBHS3MAAIIZMDnP59P835/3Mnw98t7Bg5xNQZGNnOgzSvfv2ZgX+dbfiwVX14BCCCQAbyMrNwMDKxcDOxi/Az/WU0YLi1b8/E9K8cqr6JjGQwEAEAAMf378+/cn+//GFi5bRiYuMOBzt7w4RMH50IPIjSDAEAAsbz8+Gfdh9VFEr9//WX7//s/009uzlmuWUcqGYgEAAEGAIZWUhP4bjW1AAAAAElFTkSuQmCC') no-repeat 0 1px;
240 background-color: #fff;
241 border-top: solid 1px $colour{grey};
242 border-left: solid 1px $colour{grey};
243 border-bottom: solid 1px $colour{light};
244 border-right: solid 1px $colour{light};
245 padding: 2px 0 2px 18px;
246 margin: 0.3em 0;
247 width: 12em;
248 }
249 #authen_rememberuserfield {
250 clear: left;
251 margin-left: 8em;
252 }
253 #authen_loginfield:focus {
254 background-color: #ffc;
255 color: #000;
256 }
257 #authen_passwordfield:focus {
258 background-color: #ffc;
259 color: #000;
260 }
261 div.login a {
262 font-size: 80%;
263 color: $colour{dark};
264 }
265 div.login div.buttons input {
266 border-top: solid 2px $colour{light};
267 border-left: solid 2px $colour{light};
268 border-bottom: solid 2px $colour{grey};
269 border-right: solid 2px $colour{grey};
270 background-color: $colour{lighter};
271 padding: .2em 1em ;
272 font-size: 80%;
273 font-weight: bold;
274 color: $colour{dark};
275 }
276 div.login div.buttons {
277 display: block;
278 margin: 8px 4px;
279 width: 100%;
280 }
281 #authen_loginbutton {
282 float: right;
283 margin-right: 1em;
284 }
285 #authen_registerlink {
286 display: block;
287 }
288 #authen_forgotpasswordlink {
289 display: block;
290 }
291 ul.message {
292 margin-top: 0;
293 margin-bottom: 0;
294 list-style: none;
295 }
296 ul.message li {
297 text-indent: -2em;
298 padding: 0px;
299 margin: 0px;
300 font-style: italic;
301 }
302 ul.message li.warning {
303 color: red;
304 }
305 END
306 }
307  
308 =head1 DESCRIPTION
309  
310 This module provides a login box that works out of the box but which can be
311 configured to modify the styling.
312  
313 =head1 METHODS
314  
315 =head2 new
316  
317 The constructor must be passed the L<CGI::Application> object as the first
318 non-object argument.
319  
320 =head2 login_box
321  
322 This method will return the HTML for a login box that can be
323 embedded into another page. This is the same login box that is used
324 in the default authen_login runmode that the plugin provides.
325  
326 You can set this option to customize the login form that is created when a user
327 needs to be authenticated. If you wish to replace the entire login form with a
328 completely custom version, then just set LOGIN_RUNMODE to point to your custom
329 runmode.
330  
331 All of the parameters listed below are optional, and a reasonable default will
332 be used if left blank:
333  
334 =over 4
335  
336 =item TITLE (default: Sign In)
337  
338 the heading at the top of the login box
339  
340 =item USERNAME_LABEL (default: User Name)
341  
342 the label for the user name input
343  
344 =item PASSWORD_LABEL (default: Password)
345  
346 the label for the password input
347  
348 =item SUBMIT_LABEL (default: Sign In)
349  
350 the label for the submit button
351  
352 =item COMMENT (default: Please enter your username and password in the fields below.)
353  
354 a message provided on the first login attempt
355  
356 =item REMEMBERUSER_OPTION (default: 1)
357  
358 provide a checkbox to offer to remember the users name in a cookie so that
359 their user name will be pre-filled the next time they log in
360  
361 =item REMEMBERUSER_LABEL (default: Remember User Name)
362  
363 the label for the remember user name checkbox
364  
365 =item REMEMBERUSER_COOKIENAME (default: CAPAUTHTOKEN)
366  
367 the name of the cookie where the user name will be saved
368  
369 =item REGISTER_URL (default: <none>)
370  
371 the URL for the register new account link
372  
373 =item REGISTER_LABEL (default: Register Now!)
374  
375 the label for the register new account link
376  
377 =item FORGOTPASSWORD_URL (default: <none>)
378  
379 the URL for the forgot password link
380  
381 =item FORGOTPASSWORD_LABEL (default: Forgot Password?)
382  
383 the label for the forgot password link
384  
385 =item INVALIDPASSWORD_MESSAGE (default: Invalid username or password<br />(login attempt %d)
386  
387 a message given when a login failed
388  
389 =item INCLUDE_STYLESHEET (default: 1)
390  
391 use this to disable the built in style-sheet for the login box so you can provide your own custom styles
392  
393 =item FORM_SUBMIT_METHOD (default: post)
394  
395 use this to get the form to submit using 'get' instead of 'post'
396  
397 =item FOCUS_FORM_ONLOAD (default: 1)
398  
399 use this to automatically focus the login form when the page loads so a user can start typing right away.
400  
401 =item BASE_COLOUR (default: #445588)
402  
403 This is the base colour that will be used in the included login box. All other
404 colours are automatically calculated based on this colour (unless you hardcode
405 the colour values). In order to calculate other colours, you will need the
406 Color::Calc module. If you do not have the Color::Calc module, then you will
407 need to use fixed values for all of the colour options. All colour values
408 besides the BASE_COLOUR can be simple percentage values (including the % sign).
409 For example if you set the LIGHTER_COLOUR option to 80%, then the calculated
410 colour will be 80% lighter than the BASE_COLOUR.
411  
412 =item LIGHT_COLOUR (default: 50% or #a2aac4)
413  
414 A colour that is lighter than the base colour.
415  
416 =item LIGHTER_COLOUR (default: 75% or #d0d5e1)
417  
418 A colour that is another step lighter than the light colour.
419  
420 =item DARK_COLOUR (default: 30% or #303c5f)
421  
422 A colour that is darker than the base colour.
423  
424 =item DARKER_COLOUR (default: 60% or #1b2236)
425  
426 A colour that is another step darker than the dark colour.
427  
428 =item GREY_COLOUR (default: #565656)
429  
430 A grey colour that is calculated by desaturating the base colour.
431  
432  
433 =back
434  
435 LOGIN_FORM => {
436 TITLE => 'Login',
437 SUBMIT_LABEL => 'Login',
438 REMEMBERUSER_LABEL => 1,
439 BASE_COLOUR => '#0099FF',
440 LIGHTER_COLOUR => '#AAFFFF',
441 DARK_COLOUR => '50%',
442 }
443  
444 =head1 BUGS
445  
446 This is alpha software and as such, the features and interface
447 are subject to change. So please check the Changes file when upgrading.
448  
449 =head1 SEE ALSO
450  
451 L<CGI::Application>, perl(1)
452  
453 =head1 AUTHOR
454  
455 Author: Cees Hek <ceeshek@gmail.com>; Co-maintainer: Nicholas Bamber <nicholas@periapt.co.uk>.
456  
457 =head1 CREDITS
458  
459 Thanks to SiteSuite (http://www.sitesuite.com.au) for funding the
460 development of this plugin and for releasing it to the world.
461  
462 Thanks to Christian Walde for suggesting changes to fix the incompatibility with
463 L<CGI::Application::Plugin::ActionDispatch> and for help with github.
464  
465 =head1 LICENCE AND COPYRIGHT
466  
467 Copyright (c) 2005, SiteSuite. All rights reserved.
468 Copyright (c) 2010, Nicholas Bamber. All rights reserved.
469  
470 This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
471  
472 =head1 DISCLAIMER OF WARRANTY
473  
474 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
475  
476 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
477  
478 =cut
479  
480 14 1;
« blib/lib/CGI/Application/Plugin/Authentication.pm ↑ Summary blib/lib/CGI/Application/Plugin/Authentication/Driver/Generic.pm »