Skip to content

Instantly share code, notes, and snippets.

@janmayer
Created February 1, 2018 15:21
Show Gist options
  • Save janmayer/6b19a877bc4a833dae33fafe5d6f4086 to your computer and use it in GitHub Desktop.
Save janmayer/6b19a877bc4a833dae33fafe5d6f4086 to your computer and use it in GitHub Desktop.
For typo3 ig_ldap_sso_auth, add the primary usergroup from gidnumber to memberOf ldapgroups
--- a/Classes/Library/Authentication.php
+++ b/Classes/Library/Authentication.php
@@ -456,6 +456,9 @@
!(bool)static::$config['GroupsNotSynchronize'],
$ldapInstance
);
+ $primaryGroup = $ldapInstance->search(static::$config['groups']['basedn'], '(&(gidnumber='.$ldapUser['gidnumber'][0].')(objectClass=posixGroup))', $ldapGroupAttributes);
+ $ldapGroups[] = $primaryGroup[0];
+ $ldapGroups['count']++;
}
} else {
// Get LDAP groups from DN of user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment