Revert "drop overrids - LDAP has it on its own"
[mirror/userdir-ldap-cgi.git] / login.cgi
index 6a32547..d820af2 100755 (executable)
--- a/login.cgi
+++ b/login.cgi
@@ -11,7 +11,7 @@ use CGI;
 use Util;
 use URI::Escape;
 use Crypt::Blowfish;
-use Net::LDAP qw(:all);
+use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR);
 
 my %config = &Util::ReadConfigFile;
 
@@ -28,6 +28,7 @@ my $hrkey = unpack("H".($config{blowfishkeylen}*2), $key);
 my $cipher = new Crypt::Blowfish $key;
 
 my $ldap = Net::LDAP->new($config{ldaphost}) || &Util::HTMLError($!);
+&Util::UpgradeConnection($ldap) unless $config{usessl} eq 'False';
 
 my $username = $query->param('username');
 my $password = $query->param('password');