refactor code of Lemonldap::NG::Portal::Lib::Net::LDAP
This issue is derived from #2620 (closed)
The main goal is to factorize the ppolicy code present in userBind() into bind()
For example:
# Check for ppolicy error
my $pp_error = $resp->pp_error;
if ( defined $pp_error ) {
$self->{portal}->userLogger->error(
"Password policy error $pp_error for " . $req->user );
return [
PE_PP_PASSWORD_EXPIRED,
PE_PP_ACCOUNT_LOCKED,
PE_PP_CHANGE_AFTER_RESET,
PE_PP_PASSWORD_MOD_NOT_ALLOWED,
PE_PP_MUST_SUPPLY_OLD_PASSWORD,
PE_PP_INSUFFICIENT_PASSWORD_QUALITY,
PE_PP_PASSWORD_TOO_SHORT,
PE_PP_PASSWORD_TOO_YOUNG,
PE_PP_PASSWORD_IN_HISTORY,
]->[$pp_error];
}
elsif ( $mesg->code == 0 ) {
Notice: beware that bind() function is not called only by userBind (see Lemonldap::NG::Portal::Lib::LDAP)