Revert "RT# 39340 - configured the minimal selfservice to get mac address from radius...
[freeside.git] / httemplate / search / sql.html
1 <& elements/search.html,
2                'title' => 'Query Results',
3                'name'  => 'rows',
4                'query' => "SELECT $sql",
5                'count_query' => $count,          
6 &>
7 <%init>
8
9 die "access denied"
10   unless $FS::CurrentUser::CurrentUser->access_right('Raw SQL');
11
12 my $sql = $cgi->param('sql') or errorpage('Empty query');
13 $sql =~ s/;+\s*$//; #remove trailing ;
14
15 my $count = $sql;
16 $count =~ s/.* FROM /SELECT COUNT(*) FROM /i;
17
18 </%init>