PHP code example of nusait / nuldap-laravel

1. Go to this page and download the library: Download nusait/nuldap-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nusait / nuldap-laravel example snippets


Nusait\Nuldap\NuldapServiceProvider::class,

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

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

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

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

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')
];

php artisan vendor:publish --provider="Nusait\Nuldap\NuldapServiceProvider"