summaryrefslogtreecommitdiff
path: root/FS/FS/Password_Mixin.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-02-08 16:09:28 -0800
committerMark Wells <mark@freeside.biz>2016-02-08 16:12:28 -0800
commit9d0796956b83a47a3258e1d388289f6b59f7444d (patch)
treecef512da8a675a2c80995890c2685922ddcdbec7 /FS/FS/Password_Mixin.pm
parent4d7a5f06cbab1f4f9614d9915641557f4edad1cf (diff)
make password-insecure option work when adding a new svc_acct, #40236
Diffstat (limited to 'FS/FS/Password_Mixin.pm')
-rw-r--r--FS/FS/Password_Mixin.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/FS/FS/Password_Mixin.pm b/FS/FS/Password_Mixin.pm
index 3fb787c..47290b5 100644
--- a/FS/FS/Password_Mixin.pm
+++ b/FS/FS/Password_Mixin.pm
@@ -43,6 +43,16 @@ sub is_password_allowed {
my $self = shift;
my $password = shift;
+ my $cust_main = $self->cust_main;
+
+ # workaround for non-inserted services
+ if ( !$cust_main and $self->get('pkgnum') ) {
+ my $cust_pkg = FS::cust_pkg->by_key($self->get('pkgnum'));
+ $cust_main = $cust_pkg->cust_main if $cust_pkg;
+ }
+ warn "is_password_allowed: no customer could be identified" if !$cust_main;
+ return '' if $cust_main && $conf->config_bool('password-insecure', $cust_main->agentnum);
+
# basic checks using Data::Password;
# options for Data::Password
$DICTIONARY = 4; # minimum length of disallowed words