projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8c8c4eb
)
fix username@domain search
author
ivan
<ivan>
Tue, 26 Sep 2006 18:55:59 +0000
(18:55 +0000)
committer
ivan
<ivan>
Tue, 26 Sep 2006 18:55:59 +0000
(18:55 +0000)
httemplate/search/svc_Smart.html
patch
|
blob
|
history
httemplate/search/svc_acct.cgi
patch
|
blob
|
history
diff --git
a/httemplate/search/svc_Smart.html
b/httemplate/search/svc_Smart.html
index
4d8f3e2
..
706471b
100644
(file)
--- 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') %>
<% include('/elements/footer.html') %>
-%
-%
-%}
-%
-%
+% }
diff --git
a/httemplate/search/svc_acct.cgi
b/httemplate/search/svc_acct.cgi
index
d293e24
..
2a1414b
100755
(executable)
--- a/
httemplate/search/svc_acct.cgi
+++ b/
httemplate/search/svc_acct.cgi
@@
-11,6
+11,18
@@
% push @extra_sql, 'pkgnum IS NULL';
%}
%
% 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' ) {
%if ( $query eq 'svcnum' ) {
% #$orderby = "ORDER BY svcnum";
%} elsif ( $query eq 'username' ) {