summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-02-05 09:29:14 -0800
committerIvan Kohler <ivan@freeside.biz>2016-02-05 09:29:14 -0800
commitc90a529450dd85902449788fd83940471be50377 (patch)
tree0f77b248dec9b5e5f03fc84c0dbf61362f2c6bb4
parentfc299d99343e617911adc2aaf8de3063cbf4ab2a (diff)
option to disable password checks for an agent, RT#40236
-rw-r--r--FS/FS/Conf.pm8
-rw-r--r--FS/FS/Password_Mixin.pm4
2 files changed, 11 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 0e89008..e9d0ee6 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4270,6 +4270,14 @@ and customer address. Include units.',
},
{
+ 'key' => 'password-insecure',
+ 'section' => 'password',
+ 'description' => 'Disable all password security checks and allow entry of insecure passwords. NOT RECOMMENDED.',
+ 'type' => 'checkbox',
+ 'per_agent' => 1,
+ },
+
+ {
'key' => 'datavolume-forcemegabytes',
'section' => 'UI',
'description' => 'All data volumes are expressed in megabytes',
diff --git a/FS/FS/Password_Mixin.pm b/FS/FS/Password_Mixin.pm
index ee038db..a27dd54 100644
--- a/FS/FS/Password_Mixin.pm
+++ b/FS/FS/Password_Mixin.pm
@@ -45,6 +45,9 @@ sub is_password_allowed {
my $self = shift;
my $password = shift;
+ my $cust_main = $self->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
@@ -70,7 +73,6 @@ sub is_password_allowed {
return '' unless $self->get($self->primary_key); # for validating new passwords pre-insert
#check against customer fields
- my $cust_main = $self->cust_main;
if ($cust_main) {
my @words;
# words from cust_main