summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2006-09-26 18:55:59 +0000
committerivan <ivan>2006-09-26 18:55:59 +0000
commit0ce3ddd40bf1f9142e3fdb4f3b3da15ac268c720 (patch)
tree376e42ae8491d03b45e15d0a8511190057616bed /httemplate/search
parent8c8c4eb5558e353543b9f3bd4a96ad982faa67b7 (diff)
fix username@domain search
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/svc_Smart.html51
-rwxr-xr-xhttemplate/search/svc_acct.cgi12
2 files changed, 37 insertions, 26 deletions
diff --git a/httemplate/search/svc_Smart.html b/httemplate/search/svc_Smart.html
index 4d8f3e20e..706471ba0 100644
--- a/httemplate/search/svc_Smart.html
+++ b/httemplate/search/svc_Smart.html
@@ -1,29 +1,28 @@
+% 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') %>
-%
-%
-%}
-%
-%
+% }
diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi
index d293e2455..2a1414bea 100755
--- a/httemplate/search/svc_acct.cgi
+++ b/httemplate/search/svc_acct.cgi
@@ -11,6 +11,18 @@
% 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' ) {