Logo Search packages:      
Sourcecode: dacode version File versions  Download package

Ldap::connect ( binddn,
bindpw,
hostname 
)

Conects to the LDAP server Calss echo if fails.

Parameters:
string distinguished name for the bind
string bind password
string hostname of LDAP server
Returns:
integer a bind ID on success, an error code on failure. private

Definition at line 422 of file ldap.php3.

Referenced by cat(), Ldap(), ls(), and search().

      {
            $e = error_reporting(0);
            if (! $this->cid)
            {
                  if ($this->cid=ldap_connect($hostname)) {
                        $this->error = lecho("No Error");
                        if ($this->bid = ldap_bind($this->cid, $binddn, $bindpw)) {
                              $this->error = lecho("Success");
                              error_reporting($e);
                              return($this->bid);
                        } else {
                              $this->error = lecho("Could not bind to ") . $binddn;
                              error_reporting($e);
                              return($this->bid);
                        }
                  } else {
                        $this->error = lecho("Could not connect to LDAP server");
                        error_reporting($e);
                        return($this->cid);
                  }
            } else {
                  error_reporting($e);
                  return($this->cid);
            }
      }


Generated by  Doxygen 1.6.0   Back to index