summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-11-19 21:56:43 -0800
committerIvan Kohler <ivan@freeside.biz>2013-11-19 21:56:43 -0800
commit7d259262bb97c5a911754e485a61a6ff7bed0104 (patch)
treeaac6161a88b63b1f01a25c55b1b75778a064caf1 /FS/FS/ClientAPI
parentbc54a75d31ea0e70e5854e4ddb9122d8feecdd74 (diff)
prohibit self-service changing of suspended services passwords, RT#26140
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r--FS/FS/ClientAPI/passwd.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/passwd.pm b/FS/FS/ClientAPI/passwd.pm
index b22d7617e..8001e4f2d 100644
--- a/FS/FS/ClientAPI/passwd.pm
+++ b/FS/FS/ClientAPI/passwd.pm
@@ -23,6 +23,11 @@ sub passwd {
'domsvc' => $svc_domain->svcnum, }
);
return { error => 'User not found.' } unless $svc_acct;
+
+ my $cust_pkg = $svc_acct->cust_svc->cust_pkg;
+ return { error => "Can't change password for a suspended service" }
+ if $cust_pkg && $cust_pkg->status eq 'suspended';
+
return { error => 'Incorrect password.' }
unless $svc_acct->check_password($old_password);