diff options
author | ivan <ivan> | 2004-05-11 00:46:59 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-05-11 00:46:59 +0000 |
commit | 699ce04c670c2da6b1b3821c960467b1c427d249 (patch) | |
tree | 4d1fedf26a0c126ca9f94a10ea681de030f18caf | |
parent | 2c68c62e2f9187c534e2f2291f83b789ba9075fb (diff) |
vary basic virtual host browse
-rw-r--r-- | httemplate/index.html | 2 | ||||
-rwxr-xr-x | httemplate/search/svc_www.cgi | 42 |
2 files changed, 43 insertions, 1 deletions
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 @@ <BR><FORM ACTION="search/svc_acct.cgi" METHOD="POST">Username <INPUT TYPE="text" NAME="username"><SELECT NAME="username_type"><OPTION VALUE="All">(all)</OPTION><OPTION>Fuzzy</OPTION><OPTION>Substring</OPTION><OPTION SELECTED>Exact</OPTION></SELECT><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/svc_acct.cgi?username">all accounts by username</A> or <A HREF="search/svc_acct.cgi?uid">uid</A></FORM> <BR><FORM ACTION="search/svc_domain.cgi" METHOD="POST">Domain <INPUT TYPE="text" NAME="domain"><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/svc_domain.cgi?domain">all domains</A></FORM> <BR><A HREF="search/svc_forward.cgi?svcnum">all mail forwards by svcnum</A><BR> - + <BR><A HREF="search/svc_www?svcnum">all virtual hosts by svcnum</A><BR> <BR> </TD></TR> </TABLE> 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, + ], + ) +%> |