summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-09-30 05:15:29 +0000
committerivan <ivan>2011-09-30 05:15:29 +0000
commit09f9108ef6909ed453539448bd2e318016acc52a (patch)
treec0753eab2d7c1ff60154491fc901f3fa54ab8631
parent1e98546a5debea61488c48ca9988cfd45a2dd132 (diff)
check old password if supplied, RT#13656
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index a5f47934b..16a631118 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -2148,6 +2148,11 @@ sub myaccount_passwd {
} )
or return { 'error' => "Service not found" };
+ if ( exists($p->{'old_password'}) ) {
+ return "Incorrect password."
+ unless $svc_acct->check_password($p->{'old_password'});
+ }
+
$svc_acct->_password($p->{'new_password'});
my $error = $svc_acct->replace();