diff options
author | Christopher Burger <burgerc@freeside.biz> | 2017-07-27 12:30:25 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2017-07-27 12:30:25 -0400 |
commit | fed350a1aa758b095ca220a798939733b774dcc5 (patch) | |
tree | b5b51128e814312dcd988bef33ff44994acd437a /FS/FS/ClientAPI | |
parent | eb191b6420d2a77218bdbfece57b92fdcfb5fa33 (diff) |
RT# 74537 - added check for config option selfservice-ACH_info_readonly to deletepayby method
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 2b4d52d..5c86b78 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1748,8 +1748,13 @@ sub delete_payby { }) or return { 'error' => 'unknown custpaybynum '. $p->{'custpaybynum'} }; - return { 'error' => $cust_payby->delete }; - + my $conf = new FS::Conf; + if (($cust_payby->payby eq "DCHK" || $cust_payby->payby eq "CHEK") && $conf->exists('selfservice-ACH_info_readonly')) { + return { 'error' => "Sorry you do not have permission to delete bank information." }; + } + else { + return { 'error' => $cust_payby->delete }; + } } sub cancel { |