CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C Authentication 2.x API

  • Project:
    • Authentication
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 2.x
      • 3.x
      • 2.x

Namespaces

  • Authentication
    • Authenticator
    • Controller
    • Identifier
      • Ldap
      • Resolver
    • Middleware
    • PasswordHasher
    • UrlChecker
    • View

Class ExtensionAdapter

Provides a very thin OOP wrapper around the ldap_* functions.

We don't need and want a huge LDAP lib for our purpose.

But this makes it easier to unit test code that is using LDAP because we can mock it very easy. It also provides some convenience.

Namespace: Authentication\Identifier\Ldap

Property Summary

  • $_connection protected
    resource|null

    LDAP Object

Method Summary

  • __construct() public

    Constructor

  • _setErrorHandler() protected

    Set an error handler to turn LDAP errors into exceptions

  • _unsetErrorHandler() protected

    Restore the error handler

  • bind() public

    Bind to LDAP directory

  • connect() public

    Connect to an LDAP server

  • getConnection() public

    Get the LDAP connection

  • getDiagnosticMessage() public

    Get the diagnostic message

  • getOption() public

    Get the current value for given option

  • setOption() public

    Set the value of the given option

  • unbind() public

    Unbind from LDAP directory

Method Detail

__construct() ¶ public

__construct()

Constructor

Throws
RuntimeException

_setErrorHandler() ¶ protected

_setErrorHandler(): void

Set an error handler to turn LDAP errors into exceptions

Returns
void
Throws
ErrorException

_unsetErrorHandler() ¶ protected

_unsetErrorHandler(): void

Restore the error handler

Returns
void

bind() ¶ public

bind(string $bind, string $password): bool

Bind to LDAP directory

Parameters
string $bind

Bind rdn

string $password

Bind password

Returns
bool

connect() ¶ public

connect(string $host, int $port, array $options): void

Connect to an LDAP server

Parameters
string $host

Hostname

int $port

Port

array $options

Additonal LDAP options

Returns
void

getConnection() ¶ public

getConnection(): resource

Get the LDAP connection

Returns
resource
Throws
RuntimeException
If the connection is empty

getDiagnosticMessage() ¶ public

getDiagnosticMessage(): string|null

Get the diagnostic message

Returns
string|null

getOption() ¶ public

getOption(int $option): mixed

Get the current value for given option

Parameters
int $option

Option to get

Returns
mixed

setOption() ¶ public

setOption(int $option, mixed $value): void

Set the value of the given option

Parameters
int $option

Option to set

mixed $value

The new value for the specified option

Returns
void

unbind() ¶ public

unbind(): void

Unbind from LDAP directory

Returns
void

Property Detail

$_connection ¶ protected

LDAP Object

Type
resource|null
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs