2017 © Pedro Peláez
 

library phpldap

some basic methods about ldap's management by php

image

bambooboo/phpldap

some basic methods about ldap's management by php

  • Thursday, June 14, 2018
  • by banbooboo
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

phpldap

A basic Ldap wrapper for PHP (see http://php.net/manual/zh/book.ldap.php for more information about the libcurl extension for PHP), (*1)

Installation

Click the download link above or git clone https://github.com/banbooboo/phpldap.git, (*2)

and you can see the project:, (*3)

CHANGELOG.md   CONTRIBUTING.md  README.md  tests
composer.json  LICENSE          src        

run composer install,and will find new files vendor, (*4)

CHANGELOG.md   CONTRIBUTING.md  README.md  tests
composer.json  LICENSE          src        vendor

Usage

Initialization

imply require and initialize the ldap class like so:, (*5)

require '../vendor/autoload.php';

//create phpLdap object
$ldapObj=new Bambooboo\PHPLdap\Ldap();

just like tests/LdapTest.php, (*6)

Examples:

//Connect to an LDAP server and Bind to LDAP directory
$ldap_res=$ldapObj->LdapInit($ldap_manager,$ldap_password,$url,$port);

//Get all result entries
$info=$ldapObj->LdapGetEntries($ldap_res,$dn,$filter,$justthese=null);

//Get the DN of a result entry
$ldapObj->LapGetDN($ldap_res,$dn,$filter);

//Get the DN of a result entry
$ldapObj->LapGetDN($ldap_res,$dn,$filter);

//Add entries to LDAP directory
$ldapObj->LdapAdd($ldap_res,$dn);

//Delete an entry from a directory
$ldapObj->LdapDel($ldap_res,$dn);

//Delete attribute values from current attributes
$ldapObj->LdapModDel($ldap_res,$dn,$entry);

//Replace attribute values with new ones
$ldapObj->LdapModReplace($ldap_res,$dn,$entry);

//Add attribute values to current attributes
$ldapObj->LdapModAdd($ldap_res,$dn,$entry);

Returns a complete result information in a multi-dimensional array on success and FALSE on error., (*7)

Which would display something like, (*8)

Array
(
    [count] => 1
)

Testing

Refine the file's ldap information which tests/LdapTest.php, and then run php tests/LdapTest.php, (*9)

Contact

Problems, comments, and suggestions all welcome: 1798736436@qq.com, (*10)

The Versions

14/06 2018

dev-master

9999999-dev

some basic methods about ldap's management by php

  Sources   Download

MIT