ldap.class.php (fogproject-1.5.7) | : | ldap.class.php (fogproject-1.5.8) | ||
---|---|---|---|---|
skipping to change at line 137 | skipping to change at line 137 | |||
/** | /** | |||
* Tests if the server is up and available | * Tests if the server is up and available | |||
* | * | |||
* @param int $timeout how long before timeout | * @param int $timeout how long before timeout | |||
* | * | |||
* @return bool|string | * @return bool|string | |||
*/ | */ | |||
private function _ldapUp($timeout = 3) | private function _ldapUp($timeout = 3) | |||
{ | { | |||
$ldap = 'ldap'; | $ldap = 'ldap'; | |||
$ports = array(389, 636); | $ports = array_map( | |||
'trim', | ||||
explode( | ||||
',', | ||||
self::getSetting('LDAP_PORTS') | ||||
) | ||||
); | ||||
$port = $this->get('port'); | $port = $this->get('port'); | |||
$address = $this->get('address'); | $address = $this->get('address'); | |||
if (!in_array($port, $ports)) { | if (!in_array($port, $ports)) { | |||
throw new Exception(_('Port is not valid ldap/ldaps port')); | throw new Exception(_('Port is not valid ldap/ldaps port')); | |||
} | } | |||
$sock = @pfsockopen( | $sock = @pfsockopen( | |||
$address, | $address, | |||
$port, | $port, | |||
$errno, | $errno, | |||
$errstr, | $errstr, | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 7 lines changed or added |