projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
FS
/
FS
/
ClientAPI
/
passwd.pm
diff --git
a/FS/FS/ClientAPI/passwd.pm
b/FS/FS/ClientAPI/passwd.pm
index
cb839ec
..
8001e4f
100644
(file)
--- 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::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;
sub passwd {
my $packet = shift;
@@
-30,6
+23,11
@@
sub passwd {
'domsvc' => $svc_domain->svcnum, }
);
return { error => 'User not found.' } unless $svc_acct;
'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);
return { error => 'Incorrect password.' }
unless $svc_acct->check_password($old_password);