Beispiel #1
0
 /**
  * Creates the initial ldap-object
  *
  * Static function that returns either an error object or the new Net_LDAP object.
  * Something like a factory. Takes a config array with the needed parameters. 
  *
  * @access public
  * @param array Configuration array
  * @return mixed object Net_LDAP_Error or Net_LDAP
  * @see $_config
  */
 function &connect($config = array())
 {
     if (!function_exists('ldap_connect')) {
         return Net_LDAP::raiseError("It seems that you do not have the ldap-extension installed. Please install it before using this package.");
     }
     @($obj =& new Net_LDAP($config));
     $err = $obj->bind();
     if (Net_LDAP::isError($err)) {
         return $err;
     }
     return $obj;
 }