Skip to content

Conversation

@davidcoutadeur
Copy link
Contributor

Fixes #299

@davidcoutadeur davidcoutadeur added this to the 0.8 milestone Jan 2, 2026
@davidcoutadeur davidcoutadeur self-assigned this Jan 2, 2026
@davidcoutadeur davidcoutadeur added the enhancement New feature or request label Jan 2, 2026
@davidcoutadeur
Copy link
Contributor Author

Still missing: add some code samples

@coudot coudot changed the title 299 update dn in create hook Update dn in create hook Jan 5, 2026
@coudot
Copy link
Member

coudot commented Jan 5, 2026

Tested with success. Here is a sample code:

<?php

function addCollectiviteInDN($dn, $attributes) {

        require_once("../conf/config.inc.php");
        error_log("DN $dn");
        error_log("CONFIG $ldap_base");
        $attributes['description'] = array("Test HOOK");
        $attributes["uid"][0] = $attributes["uid"][0] ."@test";
        $new_dn = preg_replace('/uid=([^,]+),(.*)/', 'uid=${1}@test,$2', $dn);
        return array(0, "description added", $new_dn, $attributes);
}

?>

Should be cleaned if used in documentation

@coudot coudot merged commit d2b8498 into master Jan 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create hook not able to update DN

3 participants