From: Ivan Kohler <ivan@freeside.biz>
Date: Thu, 27 Apr 2017 01:00:07 +0000 (-0700)
Subject: fix customer searching with "List customers" right but not "List all customers",... 
X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=7a1434e52b4c726ccb691026e2bf8240fae5b6f7

fix customer searching with "List customers" right but not "List all customers", RT#75012
---

diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index b2c977ad2..a5293f455 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -329,7 +329,8 @@
 my $curuser = $FS::CurrentUser::CurrentUser;
 
 die "access denied"
-  unless $curuser->access_right('List all customers');
+  unless $curuser->access_right('List all customers')
+      || $curuser->access_right('List customers');
 
 my $conf = new FS::Conf;
 my $maxrecords = $conf->config('maxsearchrecordsperpage') || 100;
@@ -586,7 +587,7 @@ sub cardsearch {
 
   my($card)=$cgi->param('card');
   $card =~ s/\D//g;
-  $card =~ /^(\d{13,16}|\d{8,9})$/ or errorpage(emt("Illegal card number"));
+  $card =~ /^(\d{13,19}|\d{8,9})$/ or errorpage(emt("Illegal card number"));
   my($payinfo)=$1;
 
   [ qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'}),