[% INCLUDE 'members-toolbar.inc' %]
<h1>API keys for [% INCLUDE 'patron-title.inc' %]</h1>
+
+ [% IF fresh_api_key %]
+ [%# A fresh api key was generated, display the secret, only once %]
+ <div class="rows">
+ <span class="alert">Make sure to copy your API secret now. You won’t be able to see it again!</span>
+ <ol>
+ <li>
+ <span class="label">Description: </span>
+ [% fresh_api_key.description | html %]
+ </li>
+ <li>
+ <span class="label">Client ID: </span>
+ [% fresh_api_key.client_id | html %]
+ </li>
+ <li>
+ <span class="label">Secret: </span>
+ [% fresh_api_key.plain_text_secret | html %]
+ </li>
+ </ol>
+ </div>
+ [% END %]
+
<form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
<input type="hidden" name="patron_id" value="[% patron.id | html %]" />
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
<tr>
<th>Description</th>
<th>Client ID</th>
- <th>Secret</th>
<th>Active</th>
<th class="noExport">Actions</th>
</tr>
<tr>
<td>[% key.description | html %]</td>
<td>[% key.client_id | html %]</td>
- <td>[% key.secret | html %]</td>
<td>[% IF key.active %]Yes[% ELSE %]No[% END %]</td>
<td>
<form action="/cgi-bin/koha/members/apikeys.pl" method="post">
}
);
$api_key->store;
- print $cgi->redirect( '/cgi-bin/koha/members/apikeys.pl?patron_id=' . $patron_id );
- exit;
+
+ $template->param(
+ fresh_api_key => $api_key,
+ api_keys => scalar Koha::ApiKeys->search({ patron_id => $patron_id }),
+ );
}
if ( $op eq 'delete' ) {