PHPackages                             heimrichhannot/contao-ldap-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. heimrichhannot/contao-ldap-bundle

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

heimrichhannot/contao-ldap-bundle
=================================

This bundle offers functionality concerning LDAP servers for the Contao CMS.

0.1.1(4y ago)030[2 issues](https://github.com/heimrichhannot/contao-ldap-bundle/issues)[1 PRs](https://github.com/heimrichhannot/contao-ldap-bundle/pulls)LGPL-3.0-or-laterPHPPHP ^7.4

Since Jul 9Pushed 3y ago5 watchersCompare

[ Source](https://github.com/heimrichhannot/contao-ldap-bundle)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-ldap-bundle)[ Docs](https://github.com/heimrichhannot/contao-ldap-bundle)[ RSS](/packages/heimrichhannot-contao-ldap-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (12)Versions (4)Used By (0)

Contao LDAP Bundle
==================

[](#contao-ldap-bundle)

This bundle offers functionality concerning LDAP servers for the Contao CMS.

Features
--------

[](#features)

- synchronization for users and their groups from an ldap server (works both for frontend members and backend users)
- synchronize by command and/or on demand (login in frontend and backend -&gt; no custom login module required)

Installation &amp; configuration
--------------------------------

[](#installation--configuration)

1. Run `composer require heimrichhannot/contao-ldap-bundle`.
2. Update the database.
3. **IMPORTANT: Create a backup of your tables `tl_user`, `tl_user_group`, `tl_member` and `tl_member_group` just in case something goes wrong.**
4. Create your configuration as described in the section "Configuration".
5. Clear the cache if your system is not in dev environment.

Configuration
-------------

[](#configuration)

Run `vendor/bin/contao-console config:dump-reference huh_ldap` to see the complete config reference.

A sample configuration for syncing backend users could be as follows (member configuration is nearly identical):

```
huh_ldap:
  user:
    connection: # here you can pass in all options allowed in symfony/ldap connections
      host: localhost
      encryption: ssl
    bind_dn: cn=admin,dc=example,dc=com
    bind_password: some_password
    person_username_ldap_field: uid # this field is used to match the username in contao login forms with the ldap representation
    person: # config for persons
      admin_gid_number: 5002
      base_dn: ou=People,dc=example,dc=com
    group: # config for groups
      base_dn: ou=Groups,dc=example,dc=com
```

Technical details
-----------------

[](#technical-details)

### How does the synchronization work?

[](#how-does-the-synchronization-work)

Basically, by running the command `vendor/bin/contao-console huh_ldap:sync_persons` the users and groups are imported as specified in your `config.yml` configuration. You can do that initially to retrieve all users/members.

In addition, on login (backend and frontend), the data for the given username is retrieved from ldap and synced to the local entity (you can specify the field being used in your `person_username_ldap_field` config).

In most cases, you won't necessarily need to call the command as a cronjob every night, because the data is retrieved on demand on login. Nevertheless, if you need to have up-to-date data, you can call the command as often as you like ;-)

### What if the users/members already exist locally *and* in the ldap directory?

[](#what-if-the-usersmembers-already-exist-locally-and-in-the-ldap-directory)

If – by means of username – a user or member already exists in the local system and in the ldap directory but has not been "migrated", i.e. has a `ldapUidNumber` set in the database, yet?

In this case the match is done by the value of username in contao and in ldap (field is specified by `person_username_ldap_field` in your config). Then the corresponding `ldapUidNumber` is set and the data from the ldap directory is stored to the local user object so that everything is in sync.

In addition, per default, the following fields are synchronized from ldap to the local users/members:

- username
- email
- firstname, lastname (members)
- name (users)

### What if the groups already exist locally *and* in the ldap directory?

[](#what-if-the-groups-already-exist-locally-and-in-the-ldap-directory)

Because groups don't have a unique field like "username" in the case of users, if you'd like to avoid that groups already existing both in ldap and local are added again locally, you need to set the `ldapGidNumber` in the corresponding `tl_member`/`tl_user` database records manually **before importing**.

### Commands

[](#commands)

NameDescriptionOptions`huh_ldap:sync_persons`Synchronize the members/users as specified in your `config.yml``dry-run`: See what the command would do without changing any data.
`mode`: Limit the command to users or members ("user" or "member"). Dismiss the parameter to do both.
`uids`: Limit the command to specific uids by providing a comma-separated list.### Events

[](#events)

NameDescriptionAfterPersonImportRun after a person is initially imported.AfterPersonUpdateRun after a person is updated.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

1771d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28ad3224d8727b622ebd229840eea6b9dbcb83eb0bd609e6ce65b614830ff538?d=identicon)[digitales@heimrich-hannot.de](/maintainers/digitales@heimrich-hannot.de)

---

Tags

usercontaoldapmembergroup

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/heimrichhannot-contao-ldap-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/heimrichhannot-contao-ldap-bundle/health.svg)](https://phpackages.com/packages/heimrichhannot-contao-ldap-bundle)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[madeyourday/contao-rocksolid-custom-elements

Create your own, nestable content elements using a modular system. End the WYSIWYG chaos with your own content elements.

50341.9k12](/packages/madeyourday-contao-rocksolid-custom-elements)[mvo/contao-group-widget

Adds a new group widget that allows repeating a set of DCA fields.

28124.3k31](/packages/mvo-contao-group-widget)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[terminal42/contao-folderpage

Provides a new page type for Contao that allows you to group pages into folders.

18147.9k9](/packages/terminal42-contao-folderpage)[inspiredminds/contao-wowjs

Integrates WOW.js for Contao content elements and form fields.

1813.0k](/packages/inspiredminds-contao-wowjs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
