After installing
LdapContrib if you need to login using Ldap password you must enable TWiki::Users::LdapPasswdUser also you must set {Ldap}{Precache} = 1 if not is not possible to login.
I think that all data from LDAP db are prefetched in TWiki cache
Unfortunately seems that this strategy does not correctly handle MISS elements in TWiki cache
Looking inside
LdapContrib code i found that function getDnOfLogin could return no dn string if $loginName is not in TWiki cache
lib/TWiki/Contrib/LdapContrib.pm
sub getDnOfLogin {
my ($this, $loginName, $data) = @_;
return unless $loginName;
$loginName = lc( $loginName ) unless $this->{caseSensitiveLogin};
$data ||= $this->{data};
return TWiki::Sandbox::untaintUnchecked($data->{"U2DN::$loginName"});
}
To solve this problem i had modified getDnOfLogin to solve MISS in TWiki cache
sub getDnOfLogin {
my ($this, $loginName, $data) = @_;
return unless $loginName;
$loginName = lc( $loginName ) unless $this->{caseSensitiveLogin};
$data ||= $this->{data};
my $dn = TWiki::Sandbox::untaintUnchecked($data->{"U2DN::$loginName"});
# Cache single account
if (defined($dn) || $dn eq '') {
# Make sure the user has been retreived from LDAP
$this->checkCacheForLoginName($loginName, $data);
$dn = TWiki::Sandbox::untaintUnchecked($data->{"U2DN::$loginName"});
}
return $dn;
}
--
TWiki:Main/MauroFasolo
- 2013-12-04
Grazie Mauro for reporting this and for supplying a fix! Someone needs to update the
LdapContrib.
--
TWiki:Main.PeterThoeny
- 2013-12-04