Bug 37916: Convert plugin install button to form

This patch takes the usual approach of converting linked buttons to form
with the csrf token included.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-09-13 13:59:08 +01:00 committed by Katrin Fischer
parent 1740a293eb
commit 711c399222
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -102,7 +102,15 @@
<td>[% sr.result.description | html %]</td>
<td>[% sr.repo.name | html %]</td>
<td>[% sr.result.tag_name | html %]</td>
<td><a class="btn btn-default btn-sm btn-install-plugin" href="/cgi-bin/koha/plugins/plugins-upload.pl?op=Upload&uploadfile=[% sr.result.install_name | uri %]&uploadlocation=[% sr.result.install_url | uri %]"><i class="fa fa-download"></i> Install</a></td>
<td>
<form method="post" action="/cgi-bin/koha/plugins/plugins-upload.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-Upload" />
<input type="hidden" name="uploadfile" value="[% sr.result.install_name | html %]" />
<input type="hidden" name="uploadlocation" value="[% sr.result.install_url | url %]" />
<button type="submit" value="Install" class="btn btn-default btn-sm btn-install-plugin"><i class="fa fa-download"></i> Install</button>
</form>
</td>
</tr>
[% END %]
</table>