How to hide administrator from users' list

aside from the admin, there are other roles created by the admin who could also administer and manage users. and because of this, there's a need to hide the admin from being viewed among the list of users and operators. there's a good reason for resorting to this.

in this connection, how do we go about this? what is the best solution for implementing this? please help..

Help pls on hiding admin-user

jet_lee - June 28, 2007 - 04:09

i'm sure someone here has got the answer. could you pls share to us the solution? pls help...

the entire drupal community would be very grateful.

Me too...

ZuluWarrior - July 3, 2007 - 09:08

Yea, I also need an answer to this one.

The only answer I can think of, bearing in mind that there are many many admin screens and virtually every module adds one, is a seperate module that creates, for instance a Moderator role, and then hook calls to admin pages withthe module and do a little sql rewrite or summin...

But that seems awfully complex....

A simpler answer would be most welcome!

ZuluWarrior

same here

Amix - July 14, 2007 - 23:26

same here

Hi there is a few ways to

detectedstealth... - July 16, 2007 - 22:45

Hi there is a few ways to hide the administrator from the users list.

The way I did it was:
[Note: There is also a tutorial that may provide you with a better way of doing this. It is located in the theme developers guide under customizing the user listing page I think.]

// This will stop the root user from showing up in the listing page. This code goes in your profile_listing.tpl.php file.
if($user->uid != '1') {
  // Inside here write your custom theme code.
}

(If your referring to removing the admin from showing up every where on the site, that is a bigger problem and I am still trying to figure that one out)

I need this too. To me this

totaldrupal - August 19, 2007 - 14:52

I need this too. To me this seems so basic, I can't believe that there is not a way to hide admin from the site.

Modify profile.module

vrc3 - September 21, 2007 - 01:39

I know modifying drupal core is supposed to be a no-no, but this is a really easy one. Find the line in profile.module that looks like:
$result = pager_query('SELECT uid, access FROM {users} WHERE uid > 0 AND status != 0 AND access != 0 ORDER BY access DESC', 20, 0, NULL);
It's in the function "profile_browse" and on line 503 in drupal 5.2.

Change it to:
$result = pager_query('SELECT uid, access FROM {users} WHERE uid > 1 AND status != 0 AND access != 0 ORDER BY access DESC', 20, 0, NULL);

Then user 1 doesn't show up on www.example.com/profile

You'll also need to leave all admin user's profile fields blank so they don't show up in the other profile pages, and don't post anything as admin.

This works for me, but of course it won't work if you have more than one admin account. And there's nothing to prevent someone from going to www.example.com/user/1

Valerie
www.beerreviewjournal.com

In drupal 6 profile_browse can be found in profile_page

janvdm - September 30, 2009 - 23:02

If you cant find this line of code...

In drupal 6 profile_browse can be found in profile_pages.inc, instead of profile_module...

 
 

Drupal is a registered trademark of Dries Buytaert.