# 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'});
};
my $error = $svc->is_password_allowed($packet->{_password});
+ $error = '' if $conf->config_bool('password-insecure', $agentnum);
return { error => $error } if $error;
my @acct_snarf;
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);
var fieldid = this.id+'_result';
var resultfield = document.getElementById(fieldid);
var svcnum = '';
+ var agentnum = '';
var svcfield = document.getElementById(this.id+'_svcnum');
if (svcfield) {
svcnum = svcfield.options[svcfield.selectedIndex].value;
+ } else {
+ var agentfield = document.getElementsByName('agentnum');
+ if (agentfield[0]) {
+ agentnum = agentfield[0].value;
+ }
}
if (this.value) {
resultfield.innerHTML = '<SPAN STYLE="color: blue;">Validating password...</SPAN>';
var action = nologin ? 'validate_password_nologin' : 'validate_password';
send_xmlhttp('selfservice.cgi',
- ['action',action,'fieldid',fieldid,'svcnum',svcnum,'check_password',this.value],
+ ['action',action,'fieldid',fieldid,'svcnum',svcnum,'check_password',this.value,'agentnum',agentnum],
function (result) {
result = JSON.parse(result);
var resultfield = document.getElementById(result.fieldid);