dachcom-digital / pimcore-members

Pimcore Object, Asset and Document Restriction & Frontend Authentication
Other
54 stars 34 forks source link

Do not wipe out UserGroups if no initial groups are set #106

Closed dasraab closed 5 years ago

dasraab commented 5 years ago

I found myself in the situation where i had to preset UserGroups based on some POST Parameters. I´ve used the MembersEvents::REGISTRATION_INITIALIZE Event to hook into the registration and add my groups to the user object.

Sadly, setupNewUser() overwrites my settings with either an empty array OR with the initial groups set in the configuration. with this little Codechange i´m able to set the groups myself if i do need initial groups based on different conditions.

dasraab commented 5 years ago

btw if there is a better way to set initial groups based on form data i´m all open ears!