2017 © Pedro Peláez
 

library yii2-ldap

Ldap

image

factorenergia/yii2-ldap

Ldap

  • Tuesday, May 2, 2017
  • by factorenergia
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1,285 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 24 % Grown

The README.md

Ldap database and ActiveRecord for Yii 2

This extension provides the LDAP integration for the Yii framework 2.0. It includes basic querying/search support and also implements the ActiveRecord pattern that allows you to store active records in Active Directory or OpenLDAP., (*1)

Requirements

To use yii2-ldap, your sever must support:, (*2)

PHP LDAP Extension, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist factorenergia/yii2-ldap

or add, (*6)

"factorenergia/yii2-ldap": "*"

to the require section of your composer.json., (*7)

Configuration

return [
    //....
    'components' => [
        'ldap' => [
            'class' => 'factorenergia\ldap\Connection',
            // Mandatory Configuration Options
            'dc' => [
                '192.168.1.1',
                'ad.com'
            ],
            'baseDn'          => 'dc=ad,dc=com',
            'username'        => 'administrator@ad.com',
            'password'        => 'password',
            // Optional Configuration Options
            'port'            => 389,
            'followReferrals' => false,
            'useTLS'          => true,
            // Change pageSize (e.g. to 1000) if you are getting the following message
            // with large result sets:
            // ldap_search(): Partial search results returned: Sizelimit exceeded
            'pageSize'        => -1,
        ],
    ]
];

Authenticating Users

To authenticate users using your AD server, call the Yii::$app->ldap->auth() method on your provider:, (*8)

try {
    if (Yii::$app->ldap->auth($this->username, $password)) {
        // Credentials were correct.
    } else {
        // Credentials were incorrect.
    }
} catch (Exception $e) {            
    // error
}


The Versions

02/05 2017

dev-master

9999999-dev

Ldap

  Sources   Download

MIT

The Requires

 

The Development Requires

by Factor Energia

extension yii2 ldap active directory openldap

02/05 2017

1.0.0

1.0.0.0

Ldap

  Sources   Download

MIT

The Requires

 

The Development Requires

by Factor Energia

extension yii2 ldap active directory openldap