require the Net::LDAP module for all installs

This commit is contained in:
Oliver Gorwits
2014-02-22 12:10:30 +00:00
parent 2ed22d5d08
commit 8f5ee82cf7
4 changed files with 4 additions and 5 deletions

View File

@@ -129,8 +129,7 @@ to Netdisco in the C<X-REMOTE_USER> HTTP Header. For example with Apache:
Value: Settings Tree. Default: None.
If set, and a user has the C<ldap> flag also set on their account, then LDAP
authentication will be used for their login. You I<must> install the
L<Net::LDAP> Perl module in order to use this feature. For example:
authentication will be used for their login.
ldap:
servers:

View File

@@ -12,6 +12,7 @@ use Dancer ':syntax';
use Dancer::Plugin::DBIC;
use Dancer::Plugin::Passphrase;
use Digest::MD5;
use Net::LDAP;
sub authenticate_user {
my ($self, $username, $password) = @_;
@@ -99,9 +100,6 @@ sub match_with_local_pass {
sub match_with_ldap {
my($self, $pass, $user) = @_;
eval 'require Net::LDAP';
if ($@) {error $@; return}
return unless setting('ldap') and ref {} eq ref setting('ldap');
my $conf = setting('ldap');