Revision 4099d0e8
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Auth/PasswordPolicy.pm | ||
---|---|---|
19 | 19 |
); |
20 | 20 |
|
21 | 21 |
sub verify { |
22 |
my ($self, $password) = @_; |
|
22 |
my ($self, $password, $is_admin) = @_;
|
|
23 | 23 |
|
24 | 24 |
my $cfg = $self->config; |
25 | 25 |
return OK() unless $cfg && %{ $cfg }; |
26 |
return OK() if $is_admin && $cfg->{disable_policy_for_admin}; |
|
26 | 27 |
|
27 | 28 |
my $result = OK(); |
28 | 29 |
$result |= TOO_SHORT() if $cfg->{min_length} && (length($password) < $cfg->{min_length}); |
... | ... | |
144 | 145 |
|
145 | 146 |
=over 4 |
146 | 147 |
|
147 |
=item C<verify $password> |
|
148 |
=item C<verify $password, $is_admin>
|
|
148 | 149 |
|
149 | 150 |
Checks whether or not the password matches the policy. Returns C<OK()> |
150 | 151 |
if it does and an error code otherwise (binary or'ed of the error |
151 | 152 |
constants). |
152 | 153 |
|
154 |
If C<$is_admin> is trueish and the configuration specifies that the |
|
155 |
policy checks are disabled for the administrator then C<verify> will |
|
156 |
always return C<OK()>. |
|
157 |
|
|
153 | 158 |
=item C<errors $code> |
154 | 159 |
|
155 | 160 |
Returns an array of human-readable strings describing the issues set |
Auch abrufbar als: Unified diff
Überprüfung der Passwortrichtlinie, wenn die Administratorin eine Benutzerin ändert