From 8f5ee82cf73782acbe97c202f4c073106394d472 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 22 Feb 2014 12:10:30 +0000 Subject: [PATCH] require the Net::LDAP module for all installs --- Netdisco/Changes | 1 + Netdisco/Makefile.PL | 1 + Netdisco/lib/App/Netdisco/Manual/Configuration.pod | 3 +-- Netdisco/lib/App/Netdisco/Web/Auth/Provider/DBIC.pm | 4 +--- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index c0cc55b9..2dc21ea2 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -14,6 +14,7 @@ * Add a "waiting" message to the netmap whilst the data loads * Add a spinner to all waiting messages * Try to make the Job Queue page a little faster + * Require the Net::LDAP module for all installs [BUG FIXES] diff --git a/Netdisco/Makefile.PL b/Netdisco/Makefile.PL index 39da6863..b03fe665 100644 --- a/Netdisco/Makefile.PL +++ b/Netdisco/Makefile.PL @@ -30,6 +30,7 @@ requires 'Moo' => 1.001000; requires 'MCE' => 1.408; requires 'Net::Domain' => 1.23; requires 'Net::DNS' => 0.72; +requires 'Net::LDAP' => 0; requires 'Net::MAC' => 2.103622; requires 'Net::NBName' => 0.26; requires 'NetAddr::IP' => 4.068; diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index 84a83a01..1d89788f 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -129,8 +129,7 @@ to Netdisco in the C HTTP Header. For example with Apache: Value: Settings Tree. Default: None. If set, and a user has the C flag also set on their account, then LDAP -authentication will be used for their login. You I install the -L Perl module in order to use this feature. For example: +authentication will be used for their login. ldap: servers: diff --git a/Netdisco/lib/App/Netdisco/Web/Auth/Provider/DBIC.pm b/Netdisco/lib/App/Netdisco/Web/Auth/Provider/DBIC.pm index c90719f7..376899bb 100644 --- a/Netdisco/lib/App/Netdisco/Web/Auth/Provider/DBIC.pm +++ b/Netdisco/lib/App/Netdisco/Web/Auth/Provider/DBIC.pm @@ -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');