Line 0
Link Here
|
|
|
1 |
package Koha::Exceptions::Password; |
2 |
|
3 |
# This file is part of Koha. |
4 |
# |
5 |
# Koha is free software; you can redistribute it and/or modify it under the |
6 |
# terms of the GNU General Public License as published by the Free Software |
7 |
# Foundation; either version 3 of the License, or (at your option) any later |
8 |
# version. |
9 |
# |
10 |
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY |
11 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
12 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
13 |
# |
14 |
# You should have received a copy of the GNU General Public License along |
15 |
# with Koha; if not, write to the Free Software Foundation, Inc., |
16 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
17 |
|
18 |
use Modern::Perl; |
19 |
|
20 |
use Exception::Class ( |
21 |
|
22 |
'Koha::Exceptions::Password' => { |
23 |
description => 'Something went wrong!', |
24 |
}, |
25 |
'Koha::Exceptions::Password::Invalid' => { |
26 |
isa => 'Koha::Exceptions::Password', |
27 |
description => 'Invalid password' |
28 |
}, |
29 |
'Koha::Exceptions::Password::TooShort' => { |
30 |
isa => 'Koha::Exceptions::Password', |
31 |
description => 'Password is too short', |
32 |
fields => ['length','min_length'] |
33 |
}, |
34 |
'Koha::Exceptions::Password::TooWeak' => { |
35 |
isa => 'Koha::Exceptions::Password', |
36 |
description => 'Password is too weak' |
37 |
}, |
38 |
'Koha::Exceptions::Password::TrailingWhitespaces' => { |
39 |
isa => 'Koha::Exceptions::Password', |
40 |
description => 'Password contains trailing whitespace(s)' |
41 |
} |
42 |
); |
43 |
|
44 |
=head1 NAME |
45 |
|
46 |
Koha::Exceptions::Password - Base class for password exceptions |
47 |
|
48 |
=head1 Exceptions |
49 |
|
50 |
=head2 Koha::Exceptions::Password |
51 |
|
52 |
Generic password exception |
53 |
|
54 |
=head2 Koha::Exceptions::Password::Invalid |
55 |
|
56 |
The supplied password is invalid. |
57 |
|
58 |
=head2 Koha::Exceptions::Password::TooShort |
59 |
|
60 |
Password is too short. |
61 |
|
62 |
=head2 Koha::Exceptions::Password::TooWeak |
63 |
|
64 |
Password is too weak. |
65 |
|
66 |
=head2 Koha::Exceptions::Password::TrailingWhitespaces |
67 |
|
68 |
Password contains trailing spaces, which is forbidden. |
69 |
|
70 |
=cut |
71 |
|
72 |
1; |