MyBB Community Forums

Full Version: Plug-in to hide administrator/s from Member List
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Recently I've found the need/want to remove the administrators from the Member List for security reasons. My reasoning lies with the inability to see what the admin user names are might help prevent a potential vulnerability. While this is a small addition, I think any addition in security is all about stacking the cards in our favor. My personal choice as admin has been to only use this account for the Admin CP and nothing else. There is really no reason to have the user name visible on this list, at least in my case.

I know that the admin can make themselves invisible while logged in, and I also see that there is a plug-in to remove the admin from the "Forum Team" section, but the admin showing up on the Member List renders this plug-in basically useless. I have no programming knowledge, but enough observational keenness to assume that this plug-in would be an easy one. Smile Anyone want to take a shot?

Matt
Agreed Smile Maybe even get to select which members can be hidden :O
Agreed, This would be a good idea.
Wow. I can't believe that this isn't a larger topic of interest. We even have a support team member in favor of this! Smile

Well, can someone at least point me in the right direction where I might take a stab at it? Where would I start?
Open memberlist.php and find;

        $plugins->run_hooks("memberlist_user"); 

Add the following code just underneath the above code;

        if($user['usergroup'] == 4 && $mybb->user['uid'] != 1)
        {
            continue;
        } 

This will hide all admins from the memberlist, but First admin (who has the first uid) will be able to see the admins in the memberlist.
Oh wow - I just went out to check on this thread and add to it since I hadn't heard anything, and I had no idea someone had responded with a solution! Thanks Yaldaram!

The addition of this code works as I wished. However just to let you know, the username I have setup as the first user still cannot see the admin which is completely fine. I don't need to see myself when I'm logged in Smile

Thank you!
Thanks.
(2010-12-11, 05:57 AM)Yaldaram Wrote: [ -> ]
        if($user['usergroup'] == 4 && $mybb->user['uid'] != 1)
        {
            continue;
        } 

How do I edit this code to include banned members?

Hide admins and banned members...

Thanks!
http://mybbsource.com/thread-1373.html
Should work with 1.6 (compatibility has been changed already)
(2011-08-25, 06:57 PM)x-Treme Wrote: [ -> ]http://mybbsource.com/thread-1373.html
Should work with 1.6 (compatibility has been changed already)

Not seeing a free plugin download there...

Would rather simply edit the code above.

Thanks anyways!


if($user['usergroup'] == 7 || $user['uid'] == "1" && $mybb->user['uid'] != 1)
        {
            continue;
        } 

This code does what I wanted it to do...

Hides banned members and super admin from the members list. I do not have any banned members yet so I can't verify that it actually hides banned members. I'm assuming it does.

It works but can someone verify that I edited this code correctly?

I also understand that I will need to re-apply this when mybb gets updated.

Thanks!
Pages: 1 2