PDA

View Full Version : Hide an admin in showgroups.php


chefy
02-20-2013, 01:37 PM
Hi,

I have some people on my Administrators usergroup and they all are being shown at showgroups.php. I'd like to prevent one of them from being displayed on that list without changing his usergroup. I have been searching for a solution and found this: https://vborg.vbsupport.ru/showthread.php?t=135503

But I can't figure out how to apply that to my 3.8.5 showgroups.php

Thanks!

--------------- Added 1361372230 at 1361372230 ---------------

I got it but it doesn't look good.

In showgroups.php find:

return $user;

And replace with:

if ($user['userid'] != X) {
return $user;
}

Issue here is that it still shows the row corresponding to that admin so people will know that there is a hidden admin out there: http://oi46.tinypic.com/2vmzwgx.jpg

Please help.

kh99
02-20-2013, 02:58 PM
You could do this: find this section around line 97 and add the part in red:

// get usergroups who should be displayed on showgroups
// Scans too many rows. Usergroup Rows * User Rows
$users = $db->query_read_slave("
SELECT user.*,
usergroup.usergroupid, usergroup.title,
user.options, usertextfield.buddylist,
" . ($show['locationfield'] ? 'userfield.field2,' : '') . "
IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON(usergroup.usergroupid = user.usergroupid OR FIND_IN_SET(usergroup.usergroupid, user.membergroupids))
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
WHERE (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['showgroup'] . ")
AND user.userid NOT IN (X)
");



That's just for the admin section - if you want to delete someone from the moderator section you'd need to add another line to the other query.