API15

JLDAP/connect

From Joomla! Documentation

< API15:JLDAP
Revision as of 17:14, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Connect to server boolean True if successful public <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JLDAP/connect|Edit Descripto...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Connect to server boolean True if successful public


[Edit Descripton]

Template:Description:JLDAP/connect

Syntax[edit]

connect()


Returns[edit]

boolean True if successful public

Defined in[edit]

libraries/joomla/client/ldap.php

Importing[edit]

jimport( 'joomla.client.ldap' );

Source Body[edit]

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] Template:SeeAlso:JLDAP/connect

Examples[edit]

<CodeExamplesForm />