Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 4f7bae9

Browse files
committed
2 parents 93a6ba6 + 36eb652 commit 4f7bae9

File tree

6 files changed

+35
-44
lines changed

6 files changed

+35
-44
lines changed

docs/auth.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -470,22 +470,8 @@ namespace App\Rules;
470470

471471
use Adldap\Laravel\Validation\Rules\Rule;
472472

473-
class OnlyManagersAndAccountingRule extends Rule
473+
class OnlyManagersAndAccounting extends Rule
474474
{
475-
/**
476-
* The LDAP user.
477-
*
478-
* @var User
479-
*/
480-
protected $user;
481-
482-
/**
483-
* The Eloquent model.
484-
*
485-
* @var Model|null
486-
*/
487-
protected $model;
488-
489475
/**
490476
* Determines if the user is allowed to authenticate.
491477
*
@@ -510,7 +496,7 @@ To implement your new rule, you just need to insert it into your `config/adldap_
510496
```php
511497
'rules' => [
512498

513-
App\Rules\OnlyManagersAndAccountingRule::class,
499+
App\Rules\OnlyManagersAndAccounting::class,
514500

515501
],
516502
```
@@ -530,22 +516,8 @@ namespace App\Rules;
530516
use Adldap\Models\User as LdapUser;
531517
use Adldap\Laravel\Validation\Rules\Rule;
532518

533-
class AccountingRule extends Rule
519+
class IsAccountant extends Rule
534520
{
535-
/**
536-
* The LDAP user.
537-
*
538-
* @var User
539-
*/
540-
protected $user;
541-
542-
/**
543-
* The Eloquent model.
544-
*
545-
* @var Model|null
546-
*/
547-
protected $model;
548-
549521
/**
550522
* Determines if the user is allowed to authenticate.
551523
*

readme.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
[![Latest Stable Version](https://img.shields.io/packagist/v/adldap2/adldap2-laravel.svg?style=flat-square)](https://packagist.org/packages/adldap2/adldap2-laravel)
88
[![License](https://img.shields.io/packagist/l/adldap2/adldap2-laravel.svg?style=flat-square)](https://packagist.org/packages/adldap2/adldap2-laravel)
99

10-
Adldap2 - Laravel allows easy configuration, access, management and authentication to LDAP connections utilizing the root
11-
[Adldap2 Repository](http://www.github.com/Adldap2/Adldap2).
10+
Easy configuration, access, management and authentication to LDAP servers utilizing the root
11+
[Adldap2](http://www.github.com/Adldap2/Adldap2) repository.
1212

1313
## Requirements
1414

@@ -74,30 +74,38 @@ Now you're all set!
7474

7575
First, configure your LDAP connection in the `config/adldap.php` file.
7676

77-
Then, you can perform all methods on your Adldap connection through its facade like so:
77+
Then, you can perform methods on your default connection through the `Adldap` facade like so:
7878

7979
```php
8080
use Adldap\Laravel\Facades\Adldap;
8181

82-
// Finding a user.
82+
// Finding a user:
8383
$user = Adldap::search()->users()->find('john doe');
8484

85-
// Searching for a user.
85+
// Searching for a user:
8686
$search = Adldap::search()->where('cn', '=', 'John Doe')->get();
8787

8888
// Running an operation under a different connection:
8989
$users = Adldap::getProvider('other-connection')->search()->users()->get();
9090

91-
// Creating a user.
91+
// Creating a user:
9292
$user = Adldap::make()->user([
9393
'cn' => 'John Doe',
9494
]);
9595

96+
// Saving a user:
9697
$user->save();
9798
```
9899

99-
Or you can inject the Adldap interface into your controllers, which gives
100-
you access to all of your LDAP connections and resources.
100+
If you do not specify an alternate connection using `getProvider()`, your
101+
`default` connection will be utilized for all methods.
102+
103+
Upon performing operations without specifying a connection, your default
104+
connection will be connected to and bound automatically
105+
using your configured username and password.
106+
107+
If you would prefer, you can also inject the Adldap interface into your controllers,
108+
which gives you access to all of your LDAP connections and resources as the facade.
101109

102110
```php
103111
use Adldap\AdldapInterface;
@@ -130,7 +138,19 @@ class UserController extends Controller
130138

131139
return view('users.index', compact('users'));
132140
}
141+
142+
/**
143+
* Displays the specified LDAP user.
144+
*
145+
* @return \Illuminate\View\View
146+
*/
147+
public function show($id)
148+
{
149+
$user = $this->ldap->search()->findByGuid($id);
150+
151+
return view('users.show', compact('user'));
152+
}
133153
}
134154
```
135155

136-
To see more usage in detail, please visit the [Adldap2 Repository](http://github.com/Adldap2/Adldap2).
156+
To see more usage in detail, please visit the [Adldap2](http://github.com/Adldap2/Adldap2) repository.

src/Commands/Import.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public function handle()
6969

7070
Event::fire(new Synchronizing($this->user, $model));
7171

72-
// Synchronize LDAP attributes on the model.
7372
$this->sync($model);
7473

7574
Event::fire(new Synchronized($this->user, $model));

src/Commands/SyncPassword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function applyPassword($password)
7474
/**
7575
* Determines if the current model requires a password update.
7676
*
77-
* This checks if the model does not current have a
77+
* This checks if the model does not currently have a
7878
* password, or if the password fails a hash check.
7979
*
8080
* @param string|null $password

src/Events/AuthenticatedModelTrashed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AuthenticatedModelTrashed
1515
public $user;
1616

1717
/**
18-
* The authenticated LDAP users model.
18+
* The trashed authenticated LDAP users model.
1919
*
2020
* @var Authenticatable
2121
*/

src/Events/Authenticating.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Authenticating
1414
public $user;
1515

1616
/**
17-
* The username that is being authenticated.
17+
* The username being used for authentication.
1818
*
1919
* @var string
2020
*/

0 commit comments

Comments
 (0)