fix credit cards showing up as PO#s, RT#16291
[freeside.git] / FS / FS / svc_acct.pm
index 3187060..82a5a8a 100644 (file)
@@ -1287,8 +1287,6 @@ sub check {
 
   }
 
-  #  $error = $self->ut_textn('finger');
-  #  return $error if $error;
   if ( $self->getfield('finger') eq '' ) {
     my $cust_pkg = $self->svcnum
       ? $self->cust_svc->cust_pkg
@@ -1298,7 +1296,9 @@ sub check {
       $self->setfield('finger', $cust_main->first.' '.$cust_main->get('last') );
     }
   }
-  $self->getfield('finger') =~ /^([\w \,\.\-\'\&\t\!\@\#\$\%\(\)\+\;\"\?\/\*\<\>]+)$/
+  #  $error = $self->ut_textn('finger');
+  #  return $error if $error;
+  $self->getfield('finger') =~ /^([\w \,\.\-\'\&\t\!\@\#\$\%\(\)\+\;\"\?\/\*\<\>]*)$/
       or return "Illegal finger: ". $self->getfield('finger');
   $self->setfield('finger', $1);
 
@@ -1464,7 +1464,7 @@ sub set_password {
   if ( !$encoding ) {
     # set encoding to system default
     ($encoding, $encryption) =
-      split(/-/, lc($conf->config('default-password-encoding')));
+      split(/-/, lc($conf->config('default-password-encoding') || ''));
     $encoding ||= 'legacy';
     $self->_password_encoding($encoding);
   }
@@ -2848,6 +2848,9 @@ sub search {
     push @where, "svcpart = $1";
   }
 
+  # sector and tower
+  my @where_sector = $class->tower_sector_sql($params);
+  push @where, @where_sector if @where_sector;
 
   # here is the agent virtualization
   #if ($params->{CurrentUser}) {
@@ -2875,6 +2878,9 @@ sub search {
                   ' LEFT JOIN cust_pkg  USING ( pkgnum  ) '.
                   ' LEFT JOIN cust_main USING ( custnum ) ';
 
+  $addl_from .= ' LEFT JOIN tower_sector USING ( sectornum )'
+    if @where_sector;
+
   my $count_query = "SELECT COUNT(*) FROM svc_acct $addl_from $extra_sql";
   #if ( keys %svc_acct ) {
   #  $count_query .= ' WHERE '.