[freeside-commits] freeside/httemplate/search svc_acct.cgi, 1.37, 1.38 svc_Smart.html, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Tue Sep 26 11:56:01 PDT 2006


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv16174

Modified Files:
	svc_acct.cgi svc_Smart.html 
Log Message:
fix username at domain search

Index: svc_Smart.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/svc_Smart.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- svc_Smart.html	23 Aug 2006 22:25:38 -0000	1.2
+++ svc_Smart.html	26 Sep 2006 18:55:59 -0000	1.3
@@ -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 at 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') %>
-%
-%
-%} 
-%
-%
 
+% } 

Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/svc_acct.cgi,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- svc_acct.cgi	23 Aug 2006 22:25:38 -0000	1.37
+++ svc_acct.cgi	26 Sep 2006 18:55:59 -0000	1.38
@@ -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' ) {



More information about the freeside-commits mailing list