[Koha-devel] Disabling multiple submission on search form

SUZUKI Arthur arthur.suzuki at univ-lyon3.fr
Mon Feb 15 10:50:31 CET 2016


Hello,
We are facing the following problem on our installation of Koha.
Some impatient users tends to click several times on the "Go" button of the search form on OPAC.
Probably in a desperate hope that this will speed up the whole process.
However the result is quite opposite, as Zebra is then queried multiple times which increases the server cpu load, until it reach 100% and cause Denial of Service (boooh...)

We had the idea of disabling the "searchsubmit" button upon first click.
This is done by adding onclick="this.disabled=true;" after "id=searchsubmit" in masthead.inc.
Here is a SED command to make it easier.

sed -i -e 's/id="searchsubmit"/id="searchsubmit" onclick="this.disabled=true; this.form.submit(); return true;"/' src/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc

Did any of you already faced similar problems?
Any other ideas or implementation are welcome!

Arthur SUZUKI
Service informatique des bibliothèques
bIBLIOTHÈQUES UNIVERSITAIRES
Université Jean Moulin Lyon 3
6 Cours Albert Thomas - B.P. 8242 - 69355 Lyon Cedex 08
ligne directe : +33 (0)4 78 78 79 16 | http://bu.univ-lyon3.fr

L'Université Jean Moulin est membre fondateur de l'Université de Lyon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20160215/f380107e/attachment.html>


More information about the Koha-devel mailing list