X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAuth%2FLDAP.pm;h=18c395e65ecd9087e7a0ffe617e3edaa7c429921;hb=2ef19c818a05b2baa2552ae5b4edbcc16bcfc986;hp=70e963d47896ff45cb12d3eb8c03c271694d07eb;hpb=7b5835061e81d1af578e1572e435d6f3e61d2989;p=kivitendo-erp.git diff --git a/SL/Auth/LDAP.pm b/SL/Auth/LDAP.pm index 70e963d47..18c395e65 100644 --- a/SL/Auth/LDAP.pm +++ b/SL/Auth/LDAP.pm @@ -27,6 +27,12 @@ sub new { return $self; } +sub reset { + my ($self) = @_; + $self->{ldap} = undef; + $self->{dn_cache} = { }; +} + sub _connect { $main::lxdebug->enter_sub(); @@ -43,20 +49,20 @@ sub _connect { $self->{ldap} = Net::LDAP->new($cfg->{host}, 'port' => $port); if (!$self->{ldap}) { - $main::form->error($main::locale->text('The LDAP server "#1:#2" is unreachable. Please check config/lx_office.conf.', $cfg->{host}, $port)); + $main::form->error($main::locale->text('The LDAP server "#1:#2" is unreachable. Please check config/kivitendo.conf.', $cfg->{host}, $port)); } if ($cfg->{tls}) { my $mesg = $self->{ldap}->start_tls('verify' => 'none'); if ($mesg->is_error()) { - $main::form->error($main::locale->text('The connection to the LDAP server cannot be encrypted (SSL/TLS startup failure). Please check config/lx_office.conf.')); + $main::form->error($main::locale->text('The connection to the LDAP server cannot be encrypted (SSL/TLS startup failure). Please check config/kivitendo.conf.')); } } if ($cfg->{bind_dn}) { my $mesg = $self->{ldap}->bind($cfg->{bind_dn}, 'password' => $cfg->{bind_password}); if ($mesg->is_error()) { - $main::form->error($main::locale->text('Binding to the LDAP server as "#1" failed. Please check config/lx_office.conf.', $cfg->{bind_dn})); + $main::form->error($main::locale->text('Binding to the LDAP server as "#1" failed. Please check config/kivitendo.conf.', $cfg->{bind_dn})); } } @@ -180,6 +186,10 @@ sub can_change_password { return 0; } +sub requires_cleartext_password { + return 1; +} + sub change_password { return ERR_BACKEND; } @@ -194,11 +204,11 @@ sub verify_config { my $cfg = $self->{auth}->{LDAP_config}; if (!$cfg) { - $form->error($locale->text('config/lx_office.conf: Key "authentication/ldap" is missing.')); + $form->error($locale->text('config/kivitendo.conf: Key "authentication/ldap" is missing.')); } if (!$cfg->{host} || !$cfg->{attribute} || !$cfg->{base_dn}) { - $form->error($locale->text('config/lx_office.conf: Missing parameters in "authentication/ldap". Required parameters are "host", "attribute" and "base_dn".')); + $form->error($locale->text('config/kivitendo.conf: Missing parameters in "authentication/ldap". Required parameters are "host", "attribute" and "base_dn".')); } $main::lxdebug->leave_sub();