You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LDAPService has a createLDAPGroup(Group $group) method, however it's not connected via the LDAPGroupExtension at present.
It would be nice if this were possible, via configuration or default, in a similar way as LDAPMemberExtension uses LDAPService::createLDAPUser to sync members to LDAP when created in SilverStripe.
In a quick discussion with @mateusz he highlighted that it's potentially dangerous and risks an infinite loop between writing SS -> LDAP and syncing back again, but has provided some user code that can be used to do this:
$dn = sprintf('CN=%s,%s', $groupCode, \Config::inst()->get('LDAPService', 'new_groups_dn'));
$data = $this->ldapService->getGroupByDN($dn);
if (!empty($data['objectguid'])) {
if (is_callable($logFn)) {
$logFn(sprintf('* Using existing LDAP group "%s"', $groupCode));
}
$group->GUID = $data['objectguid'];
} else {
if (is_callable($logFn)) {
$logFn(sprintf('* Creating new LDAP group "%s"', $groupCode));
}
$group->Title = $groupCode;
$this->ldapService->createLDAPGroup($group);
}
Will need further thought and discussion before implementation.
The text was updated successfully, but these errors were encountered:
The LDAPService has a
createLDAPGroup(Group $group)
method, however it's not connected via the LDAPGroupExtension at present.It would be nice if this were possible, via configuration or default, in a similar way as LDAPMemberExtension uses
LDAPService::createLDAPUser
to sync members to LDAP when created in SilverStripe.In a quick discussion with @mateusz he highlighted that it's potentially dangerous and risks an infinite loop between writing SS -> LDAP and syncing back again, but has provided some user code that can be used to do this:
Will need further thought and discussion before implementation.
The text was updated successfully, but these errors were encountered: