projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
311b0ce
)
fix error return changing password over passwordmax in self-service, RT#24727
author
Ivan Kohler
<ivan@freeside.biz>
Fri, 8 Nov 2013 22:56:07 +0000
(14:56 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Fri, 8 Nov 2013 22:56:07 +0000
(14:56 -0800)
FS/FS/ClientAPI/MyAccount.pm
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
db50d42
..
2aeecc1
100644
(file)
--- a/
FS/FS/ClientAPI/MyAccount.pm
+++ b/
FS/FS/ClientAPI/MyAccount.pm
@@
-2801,13
+2801,16
@@
sub myaccount_passwd {
} )
or return { 'error' => "Service not found" };
} )
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'});
$svc_acct->set_password($p->{'new_password'});
-
my $error
= $svc_acct->replace();
+
$error ||
= $svc_acct->replace();
my($label, $value) = $svc_acct->cust_svc->label;
my($label, $value) = $svc_acct->cust_svc->label;