directorytree/ldaprecord-browser

Browse your LDAP server in your Laravel application.

v0.1.1 2022-04-11 13:49 UTC

This package is auto-updated.

Last update: 2024-04-22 16:50:28 UTC


README

68747470733a2f2f6c6461707265636f72642e636f6d2f6c6f676f2e737667

An LDAP browser for your Laravel application or development workflow.

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275696c745f666f722d4c61726176656c2d677265656e2e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6469726563746f7279747265652f6c6461707265636f72642d62726f777365722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6469726563746f7279747265652f6c6461707265636f72642d62726f777365722e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6469726563746f7279747265652f6c6461707265636f72642d62726f777365722e7376673f7374796c653d666c61742d737175617265

Requirements

  • Laravel >= 8.0
  • LdapRecord-Laravel >= 2.0

Installation

Before installing LdapRecord-Browser, configure your LDAP connections.

After configuring your connections, install LdapRecord-Browser via composer:

composer require directorytree/ldaprecord-browser

Then, inside of your routes/web.php file, register Browser's routes via:

// routes/web.php

Route::prefix('/ldap')->group(function () {
    \LdapRecord\Browser\Browser::routes();
});

Since Browser has an index route (/), it's recommended to wrap it inside of a group with a prefix so it does not collide with your applications root index page.

Usage

After you've registered Browser's routes, you're ready to start navigating your directory.

Visit your application at (if running php artisan serve) http://127.0.0.1:8000/ldap.

You will see a list of connections you have configured:

connections.png

Click one of the connections and you will be taken to a view of your entire directory, where you may search and view all objects visible by your configured user account:

browser.png

Configuration

LdapRecord-Browser is configured out of the box for use with Active Directory LDAP servers.

If you're connecting to a different LDAP server, such as OpenLDAP, you may alter the LdapRecord model references Browser utilizes.

To update these references, call LdapRecord\Browser\Browser::models() inside of your AppServiceProvider::boot() method:

use LdapRecord\Browser\Browser;
use LdapRecord\Browser\ModelType;

public function boot()
{
    Browser::models([
        ModelType::USER => \LdapRecord\Models\OpenLDAP\User::class,
        ModelType::GROUP => \LdapRecord\Models\OpenLDAP\Group::class,
        ModelType::DEFAULT => \LdapRecord\Models\OpenLDAP\Entry::class,
        ModelType::UNKNOWN => \LdapRecord\Models\OpenLDAP\Entry::class,
        ModelType::COMPUTER => \LdapRecord\Models\OpenLDAP\Entry::class,
        ModelType::CONTAINER => \LdapRecord\Models\OpenLDAP\OrganizationalUnit::class,
    ]);
}

Note: If you've created your own LdapRecord models, feel free to update these references to those instead.