line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Auth::Kokolores::Plugin::Example; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1298
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: example for a kokolores plugin |
6
|
|
|
|
|
|
|
our $VERSION = '1.00'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'Auth::Kokolores::Plugin'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
12
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
13
|
|
|
|
|
|
|
# code to be executed by main process |
14
|
|
|
|
|
|
|
# load modules and initialize global parameters here |
15
|
0
|
|
|
|
|
|
return; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub child_init { |
19
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
20
|
|
|
|
|
|
|
# code to ve executed in the child process after forking |
21
|
|
|
|
|
|
|
# setup connections etc. here |
22
|
0
|
|
|
|
|
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub authenticate { |
26
|
0
|
|
|
0
|
0
|
|
my ( $self, $r ) = @_; |
27
|
|
|
|
|
|
|
# parameters are passed within $r (Auth::Kokolores::Request) |
28
|
|
|
|
|
|
|
# just return a true value on success |
29
|
|
|
|
|
|
|
# or a false value on failure |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if( $r->password eq 'secret' ) { |
32
|
0
|
|
|
|
|
|
return 1; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return 0; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub shutdown { |
39
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
40
|
|
|
|
|
|
|
# code to be executed before the child is shutdown |
41
|
|
|
|
|
|
|
# close connections, files, etc. |
42
|
0
|
|
|
|
|
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=pod |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=encoding UTF-8 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Auth::Kokolores::Plugin::Example - example for a kokolores plugin |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 VERSION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
version 1.00 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DESCRIPTION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This plugin checks if the supplied password is "secret". |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
If you want to start a kokolores plugin. You can use this |
66
|
|
|
|
|
|
|
plugin as a start. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 USAGE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
<Plugin myauth> |
71
|
|
|
|
|
|
|
module="Example" |
72
|
|
|
|
|
|
|
</Plugin> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHOR |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Markus Benning <ich@markusbenning.de> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This software is Copyright (c) 2016 by Markus Benning <ich@markusbenning.de>. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This is free software, licensed under: |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |