kohabug 2458 Disallowing non-SELECT SQL in reports module
authorChris Nighswonger <chris.nighswonger@liblime.com>
Fri, 8 Aug 2008 13:22:49 +0000 (08:22 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 8 Aug 2008 15:52:34 +0000 (10:52 -0500)
commit860f1f70e50a247cd12d60762db51a2e05dfd86b
tree9f0600cd017510be93cf68d572b866c554eeb53d
parent482a87eaf9946d704c8d242afd56749633ded366
kohabug 2458 Disallowing non-SELECT SQL in reports module

This patch enforces SELECT-only SQL in the reports module.
It introduces code to check SQL in two places. The first is
when a save is attempted on a user constructed SQL statement.
If a non-SELECT SQL statement is entered, the user will be
presented with an error message and a button giving the
option of editing the SQL. The second is when any SQL is
executed. If execution of a non-SELECT SQL statement is
attempted, the user is presented with an error message and
instructed to delete that report as the SQL is invalid.

The second check is intended as a safety net as no non-SELECT
SQL should ever be saved.

It may be well to document the proper usage of the direct SQL
entry type report.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Reports.pm
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl
reports/guided_reports.pl