From a88edd1658812eec333ab174c3206a1c3e0c3d4f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Nov 2019 16:10:53 +0100 Subject: [PATCH] Bug 24018: Remove die "Not logged in" Signed-off-by: Michal Denar --- circ/circulation.pl | 2 +- circ/overdue.pl | 2 +- members/boraccount.pl | 2 +- members/deletemem.pl | 2 +- members/discharge.pl | 2 +- members/discharges.pl | 2 +- members/files.pl | 2 +- members/housebound.pl | 2 +- members/ill-requests.pl | 2 +- members/mancredit.pl | 2 +- members/member-flags.pl | 2 +- members/member-password.pl | 2 +- members/memberentry.pl | 2 +- members/members-update-do.pl | 2 +- members/mod_debarment.pl | 2 +- members/moremember.pl | 2 +- members/notices.pl | 2 +- members/pay.pl | 2 +- members/paycollect.pl | 2 +- members/print_overdues.pl | 2 +- members/printfeercpt.pl | 2 +- members/printinvoice.pl | 2 +- members/printslip.pl | 2 +- members/purchase-suggestions.pl | 2 +- members/readingrec.pl | 2 +- members/routing-lists.pl | 2 +- members/setstatus.pl | 2 +- members/statistics.pl | 2 +- members/summary-print.pl | 2 +- members/update-child.pl | 2 +- tools/modborrowers.pl | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 5bc227d032..90e525cdfe 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -142,7 +142,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( flagsrequired => { circulate => 'circulate_remaining_permissions' }, } ); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $force_allow_issue = $query->param('forceallow') || 0; if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) { diff --git a/circ/overdue.pl b/circ/overdue.pl index 0e558dce1e..f7ef53e718 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -77,7 +77,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -our $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +our $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $dbh = C4::Context->dbh; diff --git a/members/boraccount.pl b/members/boraccount.pl index f5d7256499..8dfe35d92e 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -54,7 +54,7 @@ my $payment_id = $input->param('payment_id'); my $change_given = $input->param('change_given'); my $action = $input->param('action') || ''; -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $library_id = C4::Context->userenv->{'branch'}; my $patron = Koha::Patrons->find( $borrowernumber ); unless ( $patron ) { diff --git a/members/deletemem.pl b/members/deletemem.pl index 5434cdfe53..1ae2c662f1 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -52,7 +52,7 @@ if ( $loggedinuser == $member ) { exit 0; # Exit without error } -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $member ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/discharge.pl b/members/discharge.pl index 9e530bfcc1..f4a70236b4 100755 --- a/members/discharge.pl +++ b/members/discharge.pl @@ -58,7 +58,7 @@ unless ( C4::Context->preference('useDischarge') ) { exit; } -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/discharges.pl b/members/discharges.pl index 665d2732be..de21e498fb 100755 --- a/members/discharges.pl +++ b/members/discharges.pl @@ -44,7 +44,7 @@ my $branchcode = if( $op eq 'allow' ) { my $borrowernumber = $input->param('borrowernumber'); - my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; + my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find($borrowernumber); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); Koha::Patron::Discharge::discharge({ diff --git a/members/files.pl b/members/files.pl index 0bd4f94e65..e35f7e9627 100755 --- a/members/files.pl +++ b/members/files.pl @@ -47,7 +47,7 @@ $template->param( 'borrower_files' => 1 ); my $borrowernumber = $cgi->param('borrowernumber'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find($borrowernumber); output_and_exit_if_error( $cgi, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/housebound.pl b/members/housebound.pl index 4b965d8ede..663bc3c590 100755 --- a/members/housebound.pl +++ b/members/housebound.pl @@ -56,7 +56,7 @@ my $visit_id = $input->param('visit_id') // q{}; # Get patron my $borrowernumber = $input->param('borrowernumber'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find($borrowernumber); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/ill-requests.pl b/members/ill-requests.pl index cb02c73eee..911fc3801b 100755 --- a/members/ill-requests.pl +++ b/members/ill-requests.pl @@ -39,7 +39,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $borrowernumber = $input->param('borrowernumber'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/mancredit.pl b/members/mancredit.pl index b3c560d6d5..670882b0de 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -52,7 +52,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $logged_in_user = Koha::Patrons->find($loggedinuser) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find($loggedinuser); my $borrowernumber = $input->param('borrowernumber'); my $patron = Koha::Patrons->find($borrowernumber); diff --git a/members/member-flags.pl b/members/member-flags.pl index f493a0605c..14bdd5ca63 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -43,7 +43,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({ debug => 1, }); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); my %member2; diff --git a/members/member-password.pl b/members/member-password.pl index c1db3aab23..e9d5f54d9f 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -46,7 +46,7 @@ my $new_user_id = $input->param('newuserid'); my @errors; -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $patron_id ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/memberentry.pl b/members/memberentry.pl index 2471457a45..c2c05fb8bc 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -163,7 +163,7 @@ $template->param( "quickadd" => 1 ) if ( $quickadd ); $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' ); $template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 ); if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) { - my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; + my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); $borrower_data = $patron->unblessed; diff --git a/members/members-update-do.pl b/members/members-update-do.pl index cc29dbe6ad..6f9b370a3e 100755 --- a/members/members-update-do.pl +++ b/members/members-update-do.pl @@ -39,7 +39,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my @params = $query->param; diff --git a/members/mod_debarment.pl b/members/mod_debarment.pl index bc155e54a3..cf129e2072 100755 --- a/members/mod_debarment.pl +++ b/members/mod_debarment.pl @@ -32,7 +32,7 @@ my ( $loggedinuserid, $cookie, $sessionID ) = checkauth( $cgi, 0, { borrowers => my $borrowernumber = $cgi->param('borrowernumber'); my $action = $cgi->param('action'); -my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } ); my $patron = Koha::Patrons->find($borrowernumber); # Ideally we should display a warning on the interface if the patron is not allowed diff --git a/members/moremember.pl b/members/moremember.pl index a2ba396020..f083203d4a 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -79,7 +79,7 @@ my $error = $input->param('error'); $template->param( error => $error ) if ( $error ); my $patron = Koha::Patrons->find( $borrowernumber ); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); my $category_type = $patron->category->category_type; diff --git a/members/notices.pl b/members/notices.pl index 3a7068336a..1d4d2e9afa 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -47,7 +47,7 @@ my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => debug => 1, }); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); # Allow resending of messages in Notices tab diff --git a/members/pay.pl b/members/pay.pl index 5094a5f581..a126bfe7d2 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -67,7 +67,7 @@ my $payment_id = $input->param('payment_id'); our $change_given = $input->param('change_given'); # get borrower details -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); our $patron = Koha::Patrons->find($borrowernumber); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/paycollect.pl b/members/paycollect.pl index 8590765263..a7f0e39108 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -55,7 +55,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( # get borrower details my $borrowernumber = $input->param('borrowernumber'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/print_overdues.pl b/members/print_overdues.pl index 4fd9c389e2..45529905b1 100755 --- a/members/print_overdues.pl +++ b/members/print_overdues.pl @@ -46,7 +46,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $borrowernumber = $input->param('borrowernumber'); my $branchcode = C4::Context->userenv->{'branch'}; -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl index 1d92e19b07..5c56514a96 100755 --- a/members/printfeercpt.pl +++ b/members/printfeercpt.pl @@ -52,7 +52,7 @@ my $action = $input->param('action') || ''; my $accountlines_id = $input->param('accountlines_id'); my $change_given = $input->param('change_given'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/printinvoice.pl b/members/printinvoice.pl index ce16cea217..79b8673f3f 100755 --- a/members/printinvoice.pl +++ b/members/printinvoice.pl @@ -49,7 +49,7 @@ my $borrowernumber = $input->param('borrowernumber'); my $action = $input->param('action') || ''; my $accountlines_id = $input->param('accountlines_id'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/printslip.pl b/members/printslip.pl index a3d2d50031..f27083e18d 100755 --- a/members/printslip.pl +++ b/members/printslip.pl @@ -74,7 +74,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $borrowernumber = $input->param('borrowernumber'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/purchase-suggestions.pl b/members/purchase-suggestions.pl index 67c021e020..d064afdf1d 100755 --- a/members/purchase-suggestions.pl +++ b/members/purchase-suggestions.pl @@ -41,7 +41,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $borrowernumber = $input->param('borrowernumber'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/readingrec.pl b/members/readingrec.pl index 7dd71f8fce..eea8c0896b 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -54,7 +54,7 @@ if ($input->param('borrowernumber')) { $patron = Koha::Patrons->find( $borrowernumber ); } -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); my $order = 'date_due desc'; diff --git a/members/routing-lists.pl b/members/routing-lists.pl index 4885b1405e..392b9e7f00 100755 --- a/members/routing-lists.pl +++ b/members/routing-lists.pl @@ -46,7 +46,7 @@ my $borrowernumber = $query->param('borrowernumber'); my $branch = C4::Context->userenv->{'branch'}; -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/setstatus.pl b/members/setstatus.pl index bb22f3d184..a98d5554c1 100755 --- a/members/setstatus.pl +++ b/members/setstatus.pl @@ -44,7 +44,7 @@ my $reregistration = $input->param('reregistration') || ''; my $dbh = C4::Context->dbh; my $dateexpiry; -my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } ); my $patron = Koha::Patrons->find( $borrowernumber ); # Ideally we should display a warning on the interface if the logged in user is diff --git a/members/statistics.pl b/members/statistics.pl index ba453453c6..5fe2bf6d53 100755 --- a/members/statistics.pl +++ b/members/statistics.pl @@ -47,7 +47,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $borrowernumber = $input->param('borrowernumber'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/summary-print.pl b/members/summary-print.pl index 38127c9061..2611a16fd7 100755 --- a/members/summary-print.pl +++ b/members/summary-print.pl @@ -43,7 +43,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); diff --git a/members/update-child.pl b/members/update-child.pl index 60d239a76c..42cfe27d80 100755 --- a/members/update-child.pl +++ b/members/update-child.pl @@ -56,7 +56,7 @@ my $catcode = $input->param('catcode'); my $cattype = $input->param('cattype'); my $op = $input->param('op'); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); if ( $op eq 'multi' ) { diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index eaa93eaf8f..5843c73d98 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -52,7 +52,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $logged_in_user = Koha::Patrons->find( $loggedinuser ); my %cookies = parse CGI::Cookie($cookie); my $sessionID = $cookies{'CGISESSID'}->value; -- 2.11.0