diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-04-28 17:18:13 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-04-28 17:18:13 -0500 |
commit | 06b3cebdee3d838cf25d51b5bd5668b47fec7a4e (patch) | |
tree | a05152658fb54358ca52bddfc372f0c74c8779d8 /FS | |
parent | f0cf935a32a2e0186dfff6c30513693965a68cf9 (diff) |
RT#42235: Strict password requirments are not disabled for signup portal [respects agent override]
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 7 | ||||
-rw-r--r-- | FS/FS/ClientAPI/Signup.pm | 1 | ||||
-rw-r--r-- | FS/FS/Password_Mixin.pm | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 5b2421b75..9564e9c9f 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -3282,6 +3282,13 @@ sub validate_passwd { # end false laziness } + unless ($svc_acct) { + my $conf = new FS::Conf; + my $agentnum = $p->{'agentnum'}; + return { %result, 'password_valid' => 1 } + if $conf->config_bool('password-insecure', $p->{'agentnum'}); + } + $svc_acct ||= new FS::svc_acct {}; my $error = $svc_acct->is_password_allowed($p->{'check_password'}); diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index a9678b051..7c70a6717 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -700,6 +700,7 @@ sub new_customer { }; my $error = $svc->is_password_allowed($packet->{_password}); + $error = '' if $conf->config_bool('password-insecure', $agentnum); return { error => $error } if $error; my @acct_snarf; diff --git a/FS/FS/Password_Mixin.pm b/FS/FS/Password_Mixin.pm index fc2e03e89..b80708116 100644 --- a/FS/FS/Password_Mixin.pm +++ b/FS/FS/Password_Mixin.pm @@ -54,6 +54,7 @@ sub is_password_allowed { my $cust_pkg = FS::cust_pkg->by_key($self->get('pkgnum')); $cust_main = $cust_pkg->cust_main if $cust_pkg; } + # selfservice signup invokes this without customer, but it checks this conf separately warn "is_password_allowed: no customer could be identified" if !$cust_main; return '' if $cust_main && $conf->config_bool('password-insecure', $cust_main->agentnum); |