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 789-795
sub ModMember {
Link Here
|
789 |
if ($data{password} eq '****' or $data{password} eq '') { |
789 |
if ($data{password} eq '****' or $data{password} eq '') { |
790 |
delete $data{password}; |
790 |
delete $data{password}; |
791 |
} else { |
791 |
} else { |
792 |
if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
792 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
793 |
# Update the hashed PIN in borrower_sync.hashed_pin, before Koha hashes it |
793 |
# Update the hashed PIN in borrower_sync.hashed_pin, before Koha hashes it |
794 |
NLUpdateHashedPIN( $data{'borrowernumber'}, $data{password} ); |
794 |
NLUpdateHashedPIN( $data{'borrowernumber'}, $data{password} ); |
795 |
} |
795 |
} |
Lines 815-821
sub ModMember {
Link Here
|
815 |
|
815 |
|
816 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
816 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
817 |
# cronjob will use for syncing with NL |
817 |
# cronjob will use for syncing with NL |
818 |
if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
818 |
if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
819 |
my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({ |
819 |
my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({ |
820 |
'synctype' => 'norwegianpatrondb', |
820 |
'synctype' => 'norwegianpatrondb', |
821 |
'borrowernumber' => $data{'borrowernumber'} |
821 |
'borrowernumber' => $data{'borrowernumber'} |
Lines 883-889
sub AddMember {
Link Here
|
883 |
|
883 |
|
884 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
884 |
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a |
885 |
# cronjob will use for syncing with NL |
885 |
# cronjob will use for syncing with NL |
886 |
if ( exists $data{'borrowernumber'} && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
886 |
if ( exists $data{'borrowernumber'} && C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) { |
887 |
Koha::Database->new->schema->resultset('BorrowerSync')->create({ |
887 |
Koha::Database->new->schema->resultset('BorrowerSync')->create({ |
888 |
'borrowernumber' => $data{'borrowernumber'}, |
888 |
'borrowernumber' => $data{'borrowernumber'}, |
889 |
'synctype' => 'norwegianpatrondb', |
889 |
'synctype' => 'norwegianpatrondb', |