summaryrefslogtreecommitdiff
path: root/httemplate/search/sql.html
blob: 71aa0067148e5552f8f63b838c92de8f3ba79630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<& 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>