Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

juserplugin can't handle usergroups correctly #1281

Closed
trob opened this issue Jul 25, 2014 · 5 comments
Closed

juserplugin can't handle usergroups correctly #1281

trob opened this issue Jul 25, 2014 · 5 comments

Comments

@trob trob changed the title juserplugin can't handle multiple usergroups juserplugin can't handle usergroups Jul 25, 2014
@trob trob changed the title juserplugin can't handle usergroups juserplugin can't handle usergroups correctly Jul 25, 2014
@trob
Copy link
Author

trob commented Jul 26, 2014

I think I've found the issue with juser and the usergroups element not correctly populated with J!usergroups, it's just a typo:
if ($groupElementClass !== 'plgFabrik_ElementUsergroup') //must be __P__lgFabrik_ElementUsergroup
{
$gid = array_shift($gid);
}

But:
If not restricted by Fabrik list access settings (e.g. add/edit = public, which doesn't make sense but for testing purpose) everybody is allowed to create a new user and to assign any groups (but superuser), although guests and registered don't have create user access in Joomla user options.

Nobody (but superuser) is allowed to save a record with groups he doesn't belong to, even if he's an admin (who can do this in backend).
So:
juser-plugin should not save anything if

  • the user isn't allowed to create a user
  • the user isn't allowed to edit a user (but allowed to edit the fabrik list to modify additional elements)

@Makulia
Copy link

Makulia commented Jul 28, 2014

It'll also be good to have an option that defines which user groups are available for choice by list editor.

@Makulia
Copy link

Makulia commented Jul 28, 2014

I tried to extend this condition, and now it also works with checkbox plugin:
if ($groupElementClass !== 'PlgFabrik_ElementUsergroup' && $groupElementClass !== 'PlgFabrik_ElementCheckbox')
{
$gid = array_shift($gid);
}
It'll be good to merge this changes with juserplugin in repo or you have a better way of resolving this issue?

@pollen8
Copy link
Member

pollen8 commented Jul 28, 2014

I merged trob's commit (#1284) which I believe contains a fix for this issue

@pollen8 pollen8 closed this as completed Jul 28, 2014
@Makulia
Copy link

Makulia commented Jul 29, 2014

Yep, fix is in the place, but only for the usergroup plugin. How about dropdown, picklist or checkbox plugins? I suggest you to add conditions for them to juserplugin. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants