2017 © Pedro Peláez
 

library ldap

LDAP support for the XP Framework

image

xp-framework/ldap

LDAP support for the XP Framework

  • Monday, July 30, 2018
  • by thekid
  • Repository
  • 2 Watchers
  • 0 Stars
  • 33,322 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 21 Versions
  • 8 % Grown

The README.md

LDAP support for the XP Framework

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.0+ Supports PHP 8.0+ Latest Stable Version, (*1)

The peer.ldap package implements LDAP (Lighweight Directory Access Protocol) access., (*2)

use peer\ldap\LDAPConnection;
use util\cmd\Console;

$l= new LDAPConnection('ldap://ldap.example.com');
$l->connect();

$search= $l->search(
  'ou=People,dc=OpenLDAP,dc=Org', 
  '(objectClass=*)'
);

Console::writeLinef('===> %d entries found', $search->numEntries());
foreach ($search as $result) {
  Console::writeLine('---> ', $result->toString());
}

$l->close();

Example (Modifying an entry)

use peer\ldap\{LDAPConnection, LDAPEntry};

$l= new LDAPConnection('ldap://uid=admin,o=roles,dc=planet-xp,dc=net:password@ldap.example.com');
$l->connect();

with ($entry= $l->read(new LDAPEntry('uid=1549,o=people,dc=planet-xp,dc=net'))); {
  $entry->setAttribute('firstname', 'Timm');

  $l->modify($entry);
}

$l->close();

Example (Adding an entry)

use peer\ldap\{LDAPConnection, LDAPEntry};

$l= new LDAPConnection('ldap://uid=admin,o=roles,dc=planet-xp,dc=net:password@ldap.example.com');
$l->connect();

with ($entry= new LDAPEntry('uid=1549,o=people,dc=planet-xp,dc=net')); {
  $entry->setAttribute('uid', 1549);
  $entry->setAttribute('firstname', 'Timm');
  $entry->setAttribute('lastname', 'Friebe');
  $entry->setAttribute('objectClass', 'xpPerson');

  $l->add($entry);
}

$l->close();

Dynamically creating LDAP queries

If the LDAP queries need to be constructed dynamically the LDAPQuery class provides a printf-style syntax to do so:, (*3)

use peer\ldap\LDAPQuery;

$res= $ldap->searchBy(new LDAPQuery(
  'o=people,dc=planet-xp,dc=net',
  '(&(objectClass=%c)(|(username=%s)(uid=%d)))',
  'xpPerson',
  'friebe'
  1549
));

When using the "%s" token, the value passed is escaped according to rules in LDAP query syntax. The %c token copies as-is, and %d handles the argument as numeric value., (*4)

The Versions

30/07 2018

dev-feature/userland-protocol-impl

dev-feature/userland-protocol-impl http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

30/07 2018

dev-master

9999999-dev http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

30/07 2018

v8.1.1

8.1.1.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

06/06 2018

v8.1.0

8.1.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

02/04 2018

v8.0.1

8.0.1.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

15/06 2017

v8.0.0

8.0.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

02/05 2017

v7.4.3

7.4.3.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

17/09 2016

v7.4.2

7.4.2.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

29/08 2016

v7.4.1

7.4.1.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

28/08 2016

v7.4.0

7.4.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

03/07 2016

v7.3.0

7.3.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

03/07 2016

dev-feature/detect-disconnects

dev-feature/detect-disconnects http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

02/05 2016

v7.2.0

7.2.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

22/04 2016

v7.1.1

7.1.1.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

19/04 2016

v7.1.0

7.1.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

22/02 2016

v7.0.0

7.0.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

23/01 2016

v6.2.0

6.2.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

24/08 2015

v6.1.1

6.1.1.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

23/08 2015

v6.1.0

6.1.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

12/02 2015

v6.0.2

6.0.2.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

10/01 2015

v6.0.0

6.0.0.0 http://xp-framework.net/

LDAP support for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp