Fixed double if check

This commit is contained in:
Ben Tyger 2021-05-22 10:53:34 -04:00
parent 7c915032c5
commit 3e53b56aec

View file

@ -54,12 +54,10 @@ abstract class AuthController extends Controller
// Upgrade to StartTLS
$useStartTLS = @is_bool($this->config['ldap']['useStartTLS']) ? $this->config['ldap']['useStartTLS'] : false;
if ( $useStartTLS === true) {
if (ldap_start_tls($server) === false) {
$this->logger-debug(ldap_error($server));
$this->logger->error("Failed to establish secure LDAP swith StartTLS");
return false;
}
if (($useStartTLS === true) && (ldap_start_tls($server) === false)) {
$this->logger-debug(ldap_error($server));
$this->logger->error("Failed to establish secure LDAP swith StartTLS");
return false;
}
// Authenticating LDAP service account (if configured)
@ -71,9 +69,7 @@ abstract class AuthController extends Controller
$this->logger->error("Bind with service account ($serviceAccountFQDN) failed.");
return false;
}
}
return $server;
}