diff --git a/html/includes/authentication/ldap.inc.php b/html/includes/authentication/ldap.inc.php
index 74213fbbc5..facb62f307 100644
--- a/html/includes/authentication/ldap.inc.php
+++ b/html/includes/authentication/ldap.inc.php
@@ -2,6 +2,14 @@
$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;
+ }
+}
+
function authenticate($username,$password)
{
global $config, $ds;
diff --git a/html/pages/device/routing/bgp.inc.php b/html/pages/device/routing/bgp.inc.php
index 914eb13c12..1f790484e2 100644
--- a/html/pages/device/routing/bgp.inc.php
+++ b/html/pages/device/routing/bgp.inc.php
@@ -94,9 +94,9 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
unset($peerhost);
}
- if ($peerhost)
+ if (is_array($peerhost))
{
- $peername = generate_device_link($peerhost);
+ #$peername = generate_device_link($peerhost);
$peername = generate_device_link($peerhost) ." ". generate_port_link($peerhost);
$peer_url = "device/device=" . $peer['device_id'] . "/tab=routing/proto=bgp/view=updates/";
}