Download & Extend

OGUR adds roles to unapproved members

Project:OG User Roles
Version:6.x-4.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

When a group is set to "Moderated - membership requests must be approved.", OGUR adds assigned roles to unapproved members.

The attached patch fixes this in og_user_roles_grant_roles() by JOINing the og_uid table and checking if is_active is set to 1.

AttachmentSize
ogur_is_active.patch1.04 KB

Comments

#1

Status:active» reviewed & tested by the community

This patch worked for me - thanks.

#2

Status:reviewed & tested by the community» needs work

+++ b/sites/all/modules/og_user_roles/og_user_roles.module Mon Mar 28 10:51:18 2011 +0200
@@ -356,7 +356,14 @@
+      JOIN {og_uid} ogu ON ogu.nid = ogur.gid AND ogu.uid = ogur.uid

Shouldn't this be an INNER JOIN then?

#3

@sun: good question.

The idea was to give unapproved members no OGUR roles at all. The WHERE clause filters the inactive user anyway, so I guess it could be a LEFT JOIN too.

Haven't used OG in a while, so I can't test both queries atm...

nobody click here