[freeside-commits] branch FREESIDE_3_BRANCH updated. 6d4ba594dc521500f3ea254df110a111472a1750
Ivan
ivan at 420.am
Fri Nov 8 14:56:14 PST 2013
The branch, FREESIDE_3_BRANCH has been updated
via 6d4ba594dc521500f3ea254df110a111472a1750 (commit)
from 17d4ef635337a5ac7f5755fac01b19668c56f992 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6d4ba594dc521500f3ea254df110a111472a1750
Author: Ivan Kohler <ivan at freeside.biz>
Date: Fri Nov 8 14:56:11 2013 -0800
fix error return changing password over passwordmax in self-service, RT#24727
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 09b041d..c5a8316 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -2814,13 +2814,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;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/ClientAPI/MyAccount.pm | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list