View | Details | Raw Unified | Return to bug 20624
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-4 / +6 lines)
Lines 60-69 Link Here
60
                    <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% patron.borrowernumber %]">Discharge</a></li>
60
                    <li><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% patron.borrowernumber %]">Discharge</a></li>
61
                [% END %]
61
                [% END %]
62
62
63
                [% IF CAN_user_borrowers_edit_borrowers %]
63
                [% IF Koha.Preference('RESTOAuth2ClientCredentials') %]
64
                    <li><a id="apikeys" href="/cgi-bin/koha/members/apikeys.pl?patron_id=[% patron.borrowernumber %]">Manage API keys</a></li>
64
                    [% IF CAN_user_borrowers_edit_borrowers %]
65
                [% ELSE %]
65
                        <li><a id="apikeys" href="/cgi-bin/koha/members/apikeys.pl?patron_id=[% patron.borrowernumber %]">Manage API keys</a></li>
66
                    <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to manage API keys" id="apikeys" href="#">Manage API keys</a></li>
66
                    [% ELSE %]
67
                        <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to manage API keys" id="apikeys" href="#">Manage API keys</a></li>
68
                    [% END %]
67
                [% END %]
69
                [% END %]
68
70
69
                [% IF ( CAN_user_borrowers ) %]
71
                [% IF ( CAN_user_borrowers ) %]
(-)a/members/apikeys.pl (-2 / +2 lines)
Lines 45-51 my $api_key = $cgi->param('key') // ''; Link Here
45
45
46
$patron = Koha::Patrons->find($patron_id) if $patron_id;
46
$patron = Koha::Patrons->find($patron_id) if $patron_id;
47
47
48
if ( not defined $patron ) {
48
if ( not defined $patron or
49
     not C4::Context->preference('RESTOAuth2ClientCredentials') ) {
49
50
50
    # patron_id invalid -> exit
51
    # patron_id invalid -> exit
51
    print $cgi->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
52
    print $cgi->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
52
- 

Return to bug 20624