ldap tls support

git-svn-id: http://www.observium.org/svn/observer/trunk@2880 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong 2012-02-27 23:36:19 +00:00
parent 3ea756ae1b
commit ee1517e38b
2 changed files with 10 additions and 2 deletions

View File

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

View File

@ -94,9 +94,9 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
unset($peerhost); 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); $peername = generate_device_link($peerhost) ." ". generate_port_link($peerhost);
$peer_url = "device/device=" . $peer['device_id'] . "/tab=routing/proto=bgp/view=updates/"; $peer_url = "device/device=" . $peer['device_id'] . "/tab=routing/proto=bgp/view=updates/";
} }