Lines 44-50
use Text::Unaccent qw( unac_string );
Link Here
|
44 |
use Koha::AuthUtils qw(hash_password); |
44 |
use Koha::AuthUtils qw(hash_password); |
45 |
use Koha::Database; |
45 |
use Koha::Database; |
46 |
use Module::Load; |
46 |
use Module::Load; |
47 |
if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
47 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
48 |
load Koha::NorwegianPatronDB, qw( NLUpdateHashedPIN NLEncryptPIN NLSync ); |
48 |
load Koha::NorwegianPatronDB, qw( NLUpdateHashedPIN NLEncryptPIN NLSync ); |
49 |
} |
49 |
} |
50 |
|
50 |
|
Lines 790-796
sub ModMember {
Link Here
|
790 |
if ($data{password} eq '****' or $data{password} eq '') { |
790 |
if ($data{password} eq '****' or $data{password} eq '') { |
791 |
delete $data{password}; |
791 |
delete $data{password}; |
792 |
} else { |
792 |
} else { |
793 |
if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
793 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
794 |
# Update the hashed PIN in borrower_sync.hashed_pin, before Koha hashes it |
794 |
# Update the hashed PIN in borrower_sync.hashed_pin, before Koha hashes it |
795 |
NLUpdateHashedPIN( $data{'borrowernumber'}, $data{password} ); |
795 |
NLUpdateHashedPIN( $data{'borrowernumber'}, $data{password} ); |
796 |
} |
796 |
} |
Lines 816-822
sub ModMember {
Link Here
|
816 |
|
816 |
|
817 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
817 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
818 |
# cronjob will use for syncing with NL |
818 |
# cronjob will use for syncing with NL |
819 |
if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
819 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
820 |
my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({ |
820 |
my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({ |
821 |
'synctype' => 'norwegianpatrondb', |
821 |
'synctype' => 'norwegianpatrondb', |
822 |
'borrowernumber' => $data{'borrowernumber'} |
822 |
'borrowernumber' => $data{'borrowernumber'} |
Lines 884-890
sub AddMember {
Link Here
|
884 |
|
884 |
|
885 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
885 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
886 |
# cronjob will use for syncing with NL |
886 |
# cronjob will use for syncing with NL |
887 |
if ( exists $data{'borrowernumber'} && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
887 |
if ( exists $data{'borrowernumber'} && C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
888 |
Koha::Database->new->schema->resultset('BorrowerSync')->create({ |
888 |
Koha::Database->new->schema->resultset('BorrowerSync')->create({ |
889 |
'borrowernumber' => $data{'borrowernumber'}, |
889 |
'borrowernumber' => $data{'borrowernumber'}, |
890 |
'synctype' => 'norwegianpatrondb', |
890 |
'synctype' => 'norwegianpatrondb', |