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
This commit is contained in:
Tom Laermans
2012-04-20 13:34:52 +00:00
parent 0b667ffc93
commit 08d09b71ae

View File

@ -2,9 +2,11 @@
$ds = @ldap_connect($config['auth_ldap_server'],$config['auth_ldap_port']); $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')) { if ($config['auth_ldap_starttls'] && ($config['auth_ldap_starttls'] == 'optional' || $config['auth_ldap_starttls'] == 'require'))
{
$tls = ldap_start_tls($ds); $tls = ldap_start_tls($ds);
if ($config['auth_ldap_starttls'] == 'require' && $tls == FALSE) { if ($config['auth_ldap_starttls'] == 'require' && $tls == FALSE)
{
echo("<h2>Fatal error: LDAP TLS required but not successfully negotiated:" . ldap_error($ds) . "</h2>"); echo("<h2>Fatal error: LDAP TLS required but not successfully negotiated:" . ldap_error($ds) . "</h2>");
exit; exit;
} }
@ -14,7 +16,7 @@ function authenticate($username,$password)
{ {
global $config, $ds; global $config, $ds;
if ($ds) if ($username && $ds)
{ {
if ($config['auth_ldap_version']) if ($config['auth_ldap_version'])
{ {