X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2Fpasswd.pm;h=8001e4f2d85f9b45b5f8f9e5ac01df21ebff00ab;hb=09589754a8926ef064ea1d3d474a0fc3a8590101;hp=96110ef3a7b5b95e0cf7004d934193d064a9b4dd;hpb=72a65ceaa28155e8c1c3c1328dd76587b35e089a;p=freeside.git diff --git a/FS/FS/ClientAPI/passwd.pm b/FS/FS/ClientAPI/passwd.pm index 96110ef3a..8001e4f2d 100644 --- a/FS/FS/ClientAPI/passwd.pm +++ b/FS/FS/ClientAPI/passwd.pm @@ -3,14 +3,7 @@ package FS::ClientAPI::passwd; use strict; use FS::Record qw(qsearchs); use FS::svc_acct; -#use FS::svc_domain; - -use FS::ClientAPI; #hmm -FS::ClientAPI->register_handlers( - 'passwd/passwd' => \&passwd, - 'passwd/chfn' => \&chfn, - 'passwd/chsh' => \&chsh, -); +use FS::svc_domain; sub passwd { my $packet = shift; @@ -30,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);