From 08d09b71ae58c29e6fd765a371ae0cc86ba96770 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 20 Apr 2012 13:34:52 +0000 Subject: [PATCH] don't show ldap error when empty form is submitted git-svn-id: http://www.observium.org/svn/observer/trunk@3067 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/authentication/ldap.inc.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/html/includes/authentication/ldap.inc.php b/html/includes/authentication/ldap.inc.php index 1783fb8ee2..ea71d4a15f 100644 --- a/html/includes/authentication/ldap.inc.php +++ b/html/includes/authentication/ldap.inc.php @@ -2,19 +2,21 @@ $ds = @ldap_connect($config['auth_ldap_server'],$config['auth_ldap_port']); -if ($config['auth_ldap_starttls'] && ($config['auth_ldap_starttls'] == 'optional' || $config['auth_ldap_starttls'] == 'require')) { - $tls = ldap_start_tls($ds); - if ($config['auth_ldap_starttls'] == 'require' && $tls == FALSE) { - echo("

Fatal error: LDAP TLS required but not successfully negotiated:" . ldap_error($ds) . "

"); - exit; - } +if ($config['auth_ldap_starttls'] && ($config['auth_ldap_starttls'] == 'optional' || $config['auth_ldap_starttls'] == 'require')) +{ + $tls = ldap_start_tls($ds); + if ($config['auth_ldap_starttls'] == 'require' && $tls == FALSE) + { + echo("

Fatal error: LDAP TLS required but not successfully negotiated:" . ldap_error($ds) . "

"); + exit; + } } function authenticate($username,$password) { global $config, $ds; - if ($ds) + if ($username && $ds) { if ($config['auth_ldap_version']) {