summaryrefslogtreecommitdiff
path: root/httemplate/search/sql.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search/sql.html')
-rw-r--r--httemplate/search/sql.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/httemplate/search/sql.html b/httemplate/search/sql.html
new file mode 100644
index 0000000..bf54469
--- /dev/null
+++ b/httemplate/search/sql.html
@@ -0,0 +1,15 @@
+<% include( 'elements/search.html',
+ 'title' => 'Query Results',
+ 'name' => 'rows',
+ 'query' => "SELECT $sql",
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Raw SQL');
+
+my $sql = $cgi->param('sql') or errorpage('Empty query');
+$sql =~ s/;+\s*$//; #remove trailing ;
+
+</%init>