From: ivan Date: Fri, 30 Sep 2011 05:15:32 +0000 (+0000) Subject: check old password if supplied, RT#13656 X-Git-Tag: freeside_2_3_1~259 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=3846d4d0394f42c80dd8088c6763962b40bb929b check old password if supplied, RT#13656 --- 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();