X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2Fpasswd.pm;h=8001e4f2d85f9b45b5f8f9e5ac01df21ebff00ab;hb=8b8d621a1bb4e9abaa1f0edab5190d302e6a6e99;hp=cb839ecef6fe251dcbccdb59798d6629ecdc4b61;hpb=f1ddcafa4ef383b57357e7e4100b974044f14803;p=freeside.git diff --git a/FS/FS/ClientAPI/passwd.pm b/FS/FS/ClientAPI/passwd.pm index cb839ecef..8001e4f2d 100644 --- a/FS/FS/ClientAPI/passwd.pm +++ b/FS/FS/ClientAPI/passwd.pm @@ -5,13 +5,6 @@ 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, -); - 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);