From: ivan Date: Tue, 11 May 2004 00:46:59 +0000 (+0000) Subject: vary basic virtual host browse X-Git-Tag: BEFORE_FINAL_MASONIZE~1100 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=699ce04c670c2da6b1b3821c960467b1c427d249 vary basic virtual host browse --- diff --git a/httemplate/index.html b/httemplate/index.html index 2e7fc1c84..b43399db1 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -35,7 +35,7 @@
Username or all accounts by username or uid

Domain or all domains

all mail forwards by svcnum
- +
all virtual hosts by svcnum

diff --git a/httemplate/search/svc_www.cgi b/httemplate/search/svc_www.cgi new file mode 100755 index 000000000..1f05c2377 --- /dev/null +++ b/httemplate/search/svc_www.cgi @@ -0,0 +1,42 @@ +<% + +#my $conf = new FS::Conf; + +my($query)=$cgi->keywords; +$query ||= ''; #to avoid use of unitialized value errors +my(@svc_www, $orderby); +if ( $query eq 'svcnum' ) { + $orderby = 'ORDER BY svcnum'; +} else { + eidiot('unimplemented'); +} + +my $count_query = 'SELECT COUNT(*) FROM svc_www'; +my $sql_query = { + 'table' => 'svc_www', + 'hashref' => {}, + 'extra_sql' => $orderby, +}; + +my $link = [ "${p}view/svc_www.cgi?", 'svcnum', ]; +#my $dlink = [ "${p}view/svc_www.cgi?", 'svcnum', ]; +my $ulink = [ "${p}view/svc_acct.cgi?", 'usersvc', ]; + + +%> +<%= include( 'elements/search.html', + 'title' => 'Virtual Host Search Results', + 'name' => 'virtual hosts', + 'query' => $sql_query, + 'count_query' => $count_query, + 'header' => [ '#', 'Zone', 'User', ], + 'fields' => [ 'svcnum', + sub { $_[0]->domain_record->zone }, + sub { $_[0]->svc_acct->email }, + ], + 'links' => [ $link, + '', + $ulink, + ], + ) +%>