summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-21 11:05:25 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-21 11:05:25 -0700
commitbcbb8c9845809251bf56e2b12aa59b1019219bb4 (patch)
tree9f8e139e76a583928c6b75c300e9a0b66a3205ea /FS/FS/ClientAPI
parent563af91caff09369dc8c042f9e24cc542b010232 (diff)
self-service delete_contact, RT#37375
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r--FS/FS/ClientAPI/MyAccount/contact.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/FS/FS/ClientAPI/MyAccount/contact.pm b/FS/FS/ClientAPI/MyAccount/contact.pm
index 30316c7..099da29 100644
--- a/FS/FS/ClientAPI/MyAccount/contact.pm
+++ b/FS/FS/ClientAPI/MyAccount/contact.pm
@@ -129,7 +129,11 @@ sub delete_contact {
my($context, $session, $custnum) = _custoragent_session_custnum($p);
return { 'error' => $session } if $context eq 'error';
- my $cust_contact = qsearchs('cust_contact', { contactnum=>$p->{contactnum} } )
+ return { 'error' => 'Cannot delete the currently-logged in contact.' }
+ if $p->{contactnum} == $session->{contactnum};
+
+ my $cust_contact = qsearchs('cust_contact', { contactnum => $p->{contactnum},
+ custnum => $custnum, })
or return { 'error' => 'Unknown contactnum' };
my $contact = $cust_contact->contact;