+% if ( $cgi->param('search_svc') =~ /\.[a-z]{2,8}$/i
+% && $cgi->param('search_svc') !~ /\@/
+% )
+% {
+
+% # looks (enough) like a domain
+ <% $cgi->redirect('svc_domain.cgi?domain='. uri_escape( $cgi->param('search_svc') ) ) %>
+
+% } elsif ( $cgi->param('search_svc') =~ /\w/ ) {
%
-%
-%if ( $cgi->param('search_svc') =~ /\.[a-z]{2,8}$/i ) {
-%
-% # looks (enough) like a domain
-%
-%
-<% $cgi->redirect('svc_domain.cgi?domain='. uri_escape( $cgi->param('search_svc') ) ) %>
-%
-%
-%} elsif ( $cgi->param('search_svc') =~ /\w/ ) {
-%
-% #looks (enough) like a username
-%
-%
-<% $cgi->redirect('svc_acct.cgi?username_type=Exact;username='. uri_escape( $cgi->param('search_svc') ) ) %>
-%
-%
-%} else {
-%
-%
-<% include('/elements/header.html', 'Unrecognized service string') %>
+% if ( $cgi->param('search_svc') =~ /^(.+)\@(.+)$/ ) {
+
+% #looks (enough) like a username@domain
+ <% $cgi->redirect('svc_acct.cgi?username_type=Exact;username='. uri_escape($1). ';domain='. uri_escape($2) ) %>
+
+% } else {
+
+% #looks (enough) like a username
+ <% $cgi->redirect('svc_acct.cgi?username_type=Exact;username='. uri_escape( $cgi->param('search_svc') ) ) %>
+
+% }
+
+% } else {
+
+ <% include('/elements/header.html', 'Unrecognized service string') %>
<% include('/elements/footer.html') %>
-%
-%
-%}
-%
-%
+% }
% push @extra_sql, 'pkgnum IS NULL';
%}
%
+% if ( $cgi->param('domain') ) {
+% my $svc_domain =
+% qsearchs('svc_domain', { 'domain' => $cgi->param('domain') } );
+% unless ( $svc_domain ) {
+% #it would be nice if this looked more like the other "not found"
+% #errors, but this will do for now.
+% eidiot "Domain ". $cgi->param('domain'). " not found at all";
+% } else {
+% push @extra_sql, 'domsvc = '. $svc_domain->svcnum;
+% }
+% }
+%
%if ( $query eq 'svcnum' ) {
% #$orderby = "ORDER BY svcnum";
%} elsif ( $query eq 'username' ) {