|
Lines 43-48
use Koha::Patron::HouseboundRole;
Link Here
|
| 43 |
use Koha::Patron::Images; |
43 |
use Koha::Patron::Images; |
| 44 |
use Koha::Patron::Relationships; |
44 |
use Koha::Patron::Relationships; |
| 45 |
use Koha::Patrons; |
45 |
use Koha::Patrons; |
|
|
46 |
use Koha::Plugins; |
| 47 |
use Koha::Plugins::Handler; |
| 46 |
use Koha::Subscription::Routinglists; |
48 |
use Koha::Subscription::Routinglists; |
| 47 |
use Koha::Token; |
49 |
use Koha::Token; |
| 48 |
use Koha::Virtualshelves; |
50 |
use Koha::Virtualshelves; |
|
Lines 223-229
sub store {
Link Here
|
| 223 |
: undef; |
225 |
: undef; |
| 224 |
$self->privacy($default_privacy); |
226 |
$self->privacy($default_privacy); |
| 225 |
|
227 |
|
| 226 |
|
|
|
| 227 |
# Make a copy of the plain text password for later use |
228 |
# Make a copy of the plain text password for later use |
| 228 |
$self->plain_text_password( $self->password ); |
229 |
$self->plain_text_password( $self->password ); |
| 229 |
|
230 |
|
|
Lines 240-245
sub store {
Link Here
|
| 240 |
|
241 |
|
| 241 |
logaction( "MEMBERS", "CREATE", $self->borrowernumber, "" ) |
242 |
logaction( "MEMBERS", "CREATE", $self->borrowernumber, "" ) |
| 242 |
if C4::Context->preference("BorrowersLog"); |
243 |
if C4::Context->preference("BorrowersLog"); |
|
|
244 |
|
| 245 |
if ( C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins") ) { |
| 246 |
# Call any check_password plugins |
| 247 |
my @plugins = Koha::Plugins->new()->GetPlugins({ |
| 248 |
method => 'check_password', |
| 249 |
}); |
| 250 |
foreach my $plugin ( @plugins ) { |
| 251 |
my $ret = Koha::Plugins::Handler->run({ |
| 252 |
class => ref $plugin, |
| 253 |
method => 'check_password', |
| 254 |
params => { |
| 255 |
password => $self->plain_text_password, |
| 256 |
borrowernumber => $self->borrowernumber, |
| 257 |
}, |
| 258 |
}); |
| 259 |
if ( $ret->{'error'} == 1 ) { |
| 260 |
Koha::Exceptions::Password::Plugin->throw(); |
| 261 |
} |
| 262 |
} |
| 263 |
} |
| 264 |
|
| 243 |
} |
265 |
} |
| 244 |
else { #ModMember |
266 |
else { #ModMember |
| 245 |
|
267 |
|
|
Lines 682-687
Exceptions are thrown if the password is not good enough.
Link Here
|
| 682 |
|
704 |
|
| 683 |
=item Koha::Exceptions::Password::TooWeak |
705 |
=item Koha::Exceptions::Password::TooWeak |
| 684 |
|
706 |
|
|
|
707 |
=item Koha::Exceptions::Password::Plugin (if a "check password" plugin is enabled) |
| 708 |
|
| 685 |
=back |
709 |
=back |
| 686 |
|
710 |
|
| 687 |
=cut |
711 |
=cut |
|
Lines 712-717
sub set_password {
Link Here
|
| 712 |
} |
736 |
} |
| 713 |
} |
737 |
} |
| 714 |
|
738 |
|
|
|
739 |
if ( C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins") ) { |
| 740 |
# Call any check_password plugins |
| 741 |
my @plugins = Koha::Plugins->new()->GetPlugins({ |
| 742 |
method => 'check_password', |
| 743 |
}); |
| 744 |
foreach my $plugin ( @plugins ) { |
| 745 |
my $ret = Koha::Plugins::Handler->run({ |
| 746 |
class => ref $plugin, |
| 747 |
method => 'check_password', |
| 748 |
params => { |
| 749 |
password => $password, |
| 750 |
borrowernumber => $self->borrowernumber, |
| 751 |
}, |
| 752 |
}); |
| 753 |
if ( $ret->{'error'} == 1 ) { |
| 754 |
Koha::Exceptions::Password::Plugin->throw(); |
| 755 |
} |
| 756 |
} |
| 757 |
} |
| 758 |
|
| 715 |
my $digest = Koha::AuthUtils::hash_password($password); |
759 |
my $digest = Koha::AuthUtils::hash_password($password); |
| 716 |
$self->update( |
760 |
$self->update( |
| 717 |
{ password => $digest, |
761 |
{ password => $digest, |