Commit 0f82e599 authored by Tim Steiner's avatar Tim Steiner
Browse files

Check to see that the LDAP extension is enabled before attempting to use it in the Unl_Ldap class.

parent d400c653
......@@ -36,6 +36,10 @@ class Unl_Ldap {
*/
public function __construct($uri)
{
if (!function_exists('ldap_connect')) {
throw new Unl_Ldap_Exception('The PHP LDAP extension is required and is not enabled.');
}
$this->_conn = ldap_connect($uri);
if($this->_conn === FALSE) {
throw new Unl_Ldap_Exception('Could not connect to LDAP Server');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment