cache foo
[freeside.git] / httemplate / search / cust_main.cgi
index 0794ad0..d8cd0a0 100755 (executable)
@@ -1,5 +1,5 @@
 <%
-#<!-- $Id: cust_main.cgi,v 1.9 2001-10-10 05:59:36 thalakan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.11 2001-10-26 10:24:56 ivan Exp $ -->
 
 use strict;
 #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby );
@@ -59,7 +59,7 @@ if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) {
 } else { 
 
   my($total)=scalar(@cust_main);
-  print $cgi->header( '-expires' => 'now' ), header("Customer Search Results",menubar(
+  print $cgi->header( @FS::CGI::header ), header("Customer Search Results",menubar(
     'Main Menu', popurl(2)
   )), "$total matching customers found ";
   if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me
@@ -250,11 +250,9 @@ sub lastsearch {
     $last_type{$_}++;
   }
 
-  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');
+  $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/
+    or eidiot "Illegal last name";
+  my($last)=$1;
 
   if ( $last_type{'Exact'}
        && ! $last_type{'Fuzzy'}