Skip to content

Commit

Permalink
Updated README docs and minor changes to User
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmarotta committed Dec 6, 2019
1 parent 97c83bd commit d1f7a95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ In another words, now you can create web applications that to search through LDA
- Windows environtment.
- PHP >= 7.1 64bits
- COM PHP extension enabled
- [Composer](https://getcomposer.org/)

The AdoLDAP only works on Windows, because COM extensions is the way to use ADODB, since ADO is a Windows only.
The AdoLDAP only works on Windows, because COM extensions is the way to use ADODB, since ADO is a Windows only. To install AdoLDAP use the following command

```sh
composer require codecrafting-net/adoldap
```

## Configuration

Expand Down Expand Up @@ -251,7 +256,7 @@ Most of the searchs actually returns one of the `Models`, could beign a `User`,
const COLUMN_MAP = [
'objectclass' => 'objectclass',
'dn' => 'distinguishedname',
'accountname' => 'samaccountname',
'account' => 'samaccountname',
'firtname' => 'givenname',
'name' => 'name',
'workstations' => 'userworkstations',
Expand Down Expand Up @@ -292,7 +297,7 @@ $users = $ad->search()->users()
->whereMemberOf('CN=AWESOME GROUP,DC=MYDOMAIN,DC=COM')->get();

foreach($users as $user) {
echo $user->getAccountName();
echo $user->getAccount();

//EQUALS

Expand All @@ -308,7 +313,7 @@ $users = $ad->search()->users()
->whereMemberOf('CN=AWESOME GROUP,DC=MYDOMAIN,DC=COM')->get();

foreach($users as $user) {
echo $user->getAccountName() . '<br>';
echo $user->getAccount() . '<br>';
echo $user->getName() . '<br>';
echo $user->getHtmlPhoto(['class' => 'profile-picture']) . '<br>';
}
Expand Down Expand Up @@ -416,7 +421,7 @@ The `ResultSetIterator` also provides a `afterFetch` callback, which allows you
$user = $ad->search()->user('jdoe')->afterFetch(function($user) {
return [
'name' => $user->getName(),
'accountName' => $user->getAccountName(),
'accountName' => $user->getAccount(),
'photo' => $user->getPhoto()
];
})->getEntries();
Expand All @@ -432,6 +437,7 @@ You can set multiple afterFetch multiple times, which will transform the data by
- Event support.
- More robust `QueryBuilder`.
- Full and complete documentation site.
- Cache support.

## For Last

Expand Down
2 changes: 1 addition & 1 deletion src/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class User extends Model
const COLUMN_MAP = [
'objectclass' => 'objectclass',
'dn' => 'distinguishedname',
'accountname' => 'samaccountname',
'account' => 'samaccountname',
'firtname' => 'givenname',
'name' => 'name',
'workstations' => 'userworkstations',
Expand Down

0 comments on commit d1f7a95

Please sign in to comment.