X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=2aeecc1b2b16ff7f9645fff5a01a093f55bd44f9;hb=9c533839580e7914f6e64170ffe7aa76fc945275;hp=77a4683e593188ddbfca747a54d7873737a014ef;hpb=3564f619654c5cbf22fc2acbe7eff0c08308e859;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 77a4683e5..2aeecc1b2 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1011,7 +1011,7 @@ sub validate_payment { { 'cust_main' => $cust_main, #XXX or just custnum?? - 'amount' => $amount, + 'amount' => sprintf('%.2f', $amount), 'payby' => $payby, 'payinfo' => $payinfo, 'paymask' => $cust_main->mask_payinfo( $payby, $payinfo ), @@ -2801,13 +2801,16 @@ sub myaccount_passwd { } ) or return { 'error' => "Service not found" }; - if ( exists($p->{'old_password'}) ) { - return { 'error' => "Incorrect password." } - unless $svc_acct->check_password($p->{'old_password'}); - } + my $error = ''; + + my $conf = new FS::Conf; + $error = 'Password too short.' + if length($p->{'new_password'}) < ($conf->config('passwordmin') || 6); + $error = 'Password too long.' + if length($p->{'new_password'}) > ($conf->config('passwordmax') || 8); $svc_acct->set_password($p->{'new_password'}); - my $error = $svc_acct->replace(); + $error ||= $svc_acct->replace(); my($label, $value) = $svc_acct->cust_svc->label;