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;
'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);