Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

New member state is pending, should be active when Admin adds user via profile widget #120

Closed
HopeNow opened this issue May 6, 2016 · 2 comments

Comments

@HopeNow
Copy link

HopeNow commented May 6, 2016

The Bug:
When site administrator adds a user to a group (ours are invite only) using the widget on the user's profile page, the user's state is set to pending instead of active.

Context:

  1. Version: og 7.x-2.9
  2. Likely caused by security update of og 2.9 in file "OgBehaviorHandler.class.php" on line 127 located in og/plugins/entityreference/behavior/ possibly because membership state provided by the widget is empty.
  3. What's the best fix for this: Make the widget provide user's state? Or check if actor has administer group permission and set state to active if they do?

Culprit Code:

    // Prepare an array with the membership state, if it was provided in the widget.
        ...
      // Must provide correct state in the event that approval is required.
      if (empty($item['state']) && $entity_type == 'user' && !og_user_access($group_type, $gid, 'subscribe without approval', $entity)) {
        $item['state'] = OG_STATE_PENDING;
      }...

Slow Work around:
Site administrator must add user to groups one by one from each group's add user page so that user's states are correctly set to active.

alex-bukach added a commit to alex-bukach/og that referenced this issue May 22, 2016
@alex-bukach
Copy link

Or check if actor has administer group permission and set state to active if they do?

This options seems more reasonable to me, implemented in #124.

amitaibu added a commit that referenced this issue Jan 28, 2017
Fixed #120: New member state is pending, should be active when added by admin
@zerolab
Copy link
Contributor

zerolab commented Mar 27, 2017

This was fixed in #124 and can be closed

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

No branches or pull requests

4 participants