2017 © Pedro Peláez
 

library nuldap

image

nusait/nuldap

  • Wednesday, May 11, 2016
  • by nusait
  • Repository
  • 6 Watchers
  • 0 Stars
  • 436 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

NuLdap

This is a LDAP package meant for Northwestern University. (But can be extended for other entities), (*1)

Installation via Composer

composer require nusait/nuldap

Then update composer, (*2)

composer update

New Instance:

$ldap = new Nusait\Nuldap\NuLdap($rdn, $password, $host, $port);

(all parameters are optional); if you do not put $rdn or $password, you can still validate, but cannot searchNetid. After instantiating, you can still set the rdn and password with setRdn and setPassword respectively., (*3)

Validate:

$ldap->validate($netid, $password);

returns a boolean, (*4)

Searching:

You can search by netid, email, emplid, or studentid., (*5)

$ldap->search('netid', $netid);
$ldap->search('email', $email);
$ldap->search('emplid', $emplid);
$ldap->search('studentid', $studentid);

This returns the raw ldap metadata., (*6)

You can also search using the magic methods:, (*7)

$ldap->searchNetid($netid);
$ldap->searchEmail($email);
$ldap->searchEmplid($emplid);
$ldap->searchStudentid($studentid);

Parsing User

$ldap->parseUser($ldapUser [, $transformer ]);

You can parse the raw metadata of a user to create an associative array of the user. You can pass your own transformer into the function. The transformer must implement the TransformerInterface in the Contracts folder., (*8)

The default transforms maps the following keys and value:, (*9)

return [
    'netid'       => $this->getSetValueOrNull($ldapUser, 'uid'),
    'phone'       => $this->getSetValueOrNull($ldapUser, 'telephonenumber'),
    'email'       => $this->getSetValueOrNull($ldapUser, 'mail'),
    'title'       => $this->getSetValueOrNull($ldapUser, 'title'),
    'first_name'  => $this->getSetValueOrNull($ldapUser, 'givenname'),
    'last_name'   => $this->getSetValueOrNull($ldapUser, 'sn'),
    'displayname' => $this->getSetValueOrNull($ldapUser, 'displayname'),
    'emplid'      => (int)$this->getSetValueOrNull($ldapUser, 'employeenumber'),
    'studentid'   => (int)$this->getSetValueOrNull($ldapUser, 'nustudentnumber')
];

The Versions

11/05 2016

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

by Vahid Azam

11/05 2016

2.1.4

2.1.4.0

  Sources   Download

The Requires

  • php >=5.3.0

 

The Development Requires

by Vahid Azam

02/03 2016

2.1.3

2.1.3.0

  Sources   Download

The Requires

  • php >=5.3.0

 

by Vahid Azam

21/02 2016

2.1.2

2.1.2.0

  Sources   Download

The Requires

  • php >=5.3.0

 

by Vahid Azam

10/12 2015

2.1.1

2.1.1.0

  Sources   Download

The Requires

  • php >=5.3.0

 

by Vahid Azam

09/11 2015

2.1.0

2.1.0.0

  Sources   Download

The Requires

  • php >=5.3.0

 

by Vahid Azam

09/11 2015

2.0.0

2.0.0.0

  Sources   Download

The Requires

  • php >=5.3.0

 

by Vahid Azam

19/08 2014

1.0.0

1.0.0.0

  Sources   Download

The Requires

  • php >=5.3.0