Hide members from the Member List #142

Merged
merged 4 commits into from Feb 5, 2014

Conversation

Projects
None yet
3 participants
@PaulBender
Member

PaulBender commented Oct 11, 2013

From my list posted here; allows administrators to hide the users of a specific usergroup from the member list.

nmalcolm added a commit that referenced this pull request Feb 5, 2014

@nmalcolm nmalcolm merged commit 8cb6d4e into mybb:feature Feb 5, 2014

@ImadJomaa

This comment has been minimized.

Show comment
Hide comment
@ImadJomaa

ImadJomaa Feb 6, 2014

Contributor

Shouldn't this be reversed to ...(!empty($group) && is_array($group))...? If the var is empty it won't continue with the expression whereas in its current state it would process the full expression. Also, as it seems, group's type isn't changed either from where it's defined and where the conditional appears (and doesn't seem to be used anywhere else?). If so, the check for array type is redundant and not needed either.

Contributor

ImadJomaa commented on 97208b0 Feb 6, 2014

Shouldn't this be reversed to ...(!empty($group) && is_array($group))...? If the var is empty it won't continue with the expression whereas in its current state it would process the full expression. Also, as it seems, group's type isn't changed either from where it's defined and where the conditional appears (and doesn't seem to be used anywhere else?). If so, the check for array type is redundant and not needed either.

This comment has been minimized.

Show comment
Hide comment
@nmalcolm

nmalcolm Feb 6, 2014

Contributor

I guess we could drop the is_array(), but we do check if it's an array first throughout MyBB:

    if(is_array($uidin) && !empty($uidin))
    {
        $uids = implode(",", $uidin);
        $db->delete_query("joinrequests", "uid IN ({$uids}) AND gid='{$gid}'");
    }
Contributor

nmalcolm replied Feb 6, 2014

I guess we could drop the is_array(), but we do check if it's an array first throughout MyBB:

    if(is_array($uidin) && !empty($uidin))
    {
        $uids = implode(",", $uidin);
        $db->delete_query("joinrequests", "uid IN ({$uids}) AND gid='{$gid}'");
    }

This comment has been minimized.

Show comment
Hide comment
@ImadJomaa

ImadJomaa Feb 6, 2014

Contributor

Yeah I noticed that when I was browsing through some files last night. I can't think of a good reason for that order. In all cases I found, albeit, probably not throughout the entire codebase, the variable in question is guaranteed to be an array (although I can see why in some cases the check is there).

Contributor

ImadJomaa replied Feb 6, 2014

Yeah I noticed that when I was browsing through some files last night. I can't think of a good reason for that order. In all cases I found, albeit, probably not throughout the entire codebase, the variable in question is guaranteed to be an array (although I can see why in some cases the check is there).

@PaulBender PaulBender deleted the PaulBender:feature-memberlist branch Feb 13, 2014

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