Actions

API15

JLDAP/connect

From Joomla! Documentation

< API15:JLDAP
Revision as of 17:14, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Connect to server boolean True if successful public


[Edit Descripton]

Description:JLDAP/connect

Syntax

connect()


Returns

boolean True if successful public

Defined in

libraries/joomla/client/ldap.php

Importing

jimport( 'joomla.client.ldap' );

Source Body

function connect()
{
        if ($this->host == '') {
                return false;
        }
        $this->_resource = @ ldap_connect($this->host, $this->port);
        if ($this->_resource)
        {
                if ($this->use_ldapV3) {
                        if (!@ldap_set_option($this->_resource, LDAP_OPT_PROTOCOL_VERSION, 3)) {
                                return false;
                        }
                }
                if (!@ldap_set_option($this->_resource, LDAP_OPT_REFERRALS, intval($this->no_referrals))) {
                        return false;
                }
                if ($this->negotiate_tls) {
                        if (!@ldap_start_tls($this->_resource)) {
                                return false;
                        }
                }
                return true;
        } else {
                return false;
        }
}

[Edit See Also] SeeAlso:JLDAP/connect

Examples

<CodeExamplesForm />