Stupid mistake. Works now.
authorthalakan <thalakan>
Wed, 10 Oct 2001 05:59:36 +0000 (05:59 +0000)
committerthalakan <thalakan>
Wed, 10 Oct 2001 05:59:36 +0000 (05:59 +0000)
httemplate/search/cust_main.cgi

index 0744744..0794ad0 100755 (executable)
@@ -1,5 +1,5 @@
 <%
 <%
-#<!-- $Id: cust_main.cgi,v 1.8 2001-10-10 05:42:19 ivan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.9 2001-10-10 05:59:36 thalakan Exp $ -->
 
 use strict;
 #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby );
 
 use strict;
 #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby );
@@ -250,9 +250,11 @@ sub lastsearch {
     $last_type{$_}++;
   }
 
     $last_type{$_}++;
   }
 
-  $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/
-    or eidiot "Illegal last name";
-  my($last)=$1;
+  my $cust_obj = new FS::cust_main;
+  $cust_obj->setfield('last', $cgi->param('last_text'));
+  my $error = $cust_obj->ut_name('last');
+  eidiot "Illegal last name" if $error;
+  my($last) = $cust_obj->getfield('last');
 
   if ( $last_type{'Exact'}
        && ! $last_type{'Fuzzy'} 
 
   if ( $last_type{'Exact'}
        && ! $last_type{'Fuzzy'}