forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: EllieG on August 11, 2010, 11:53:01 pm

Title: Hiding admin profile
Post by: EllieG on August 11, 2010, 11:53:01 pm
Could anyone tell me how, (if possible) to hide the admin profile from being viewed by anyone, (except admin!).
Thank you.
http://www.coffee-mates.co.uk
Title: Re: Hiding admin profile
Post by: Αndré on September 03, 2010, 11:12:37 am
Please give us more information. What should happen if someone tries to access the profile? How can they access the profile? Of course you can insert something like
Code: [Select]
if (profile_id == admin_profile_id) die();
Title: Re: Hiding admin profile
Post by: EllieG on September 03, 2010, 12:44:30 pm
Thanks for the reply.
The situation is that only logged in users can see the memberlist, which includes the admin profile.

Ideally, I'd prefer it if the admin profile didn't show up at all for those viewing the memberlist. I'm the only one with admin rights, and so only I would be able to see my admin profile. If that were not possible, then if someone tried to view the admin profile, they would get a message saying 'not available to view' or something like that.
The former is preferable however.

The code you suggest: if (profile_id == admin_profile_id) die(); would this achieve any of the above?

Many thanks.
Title: Re: Hiding admin profile
Post by: Αndré on September 03, 2010, 01:23:14 pm
I'd prefer it if the admin profile didn't show up at all
Open usermgr.php, find
Code: [Select]
    foreach ($users as $user) {and replace with
Code: [Select]
    foreach ($users as $user) {

        if ($user['user_id'] == 1 && !GALLERY_ADMIN_MODE) continue;


if someone tried to view the admin profile, they would get a message saying 'not available to view' or something like that.
Open profile.php, find
Code: [Select]
if ($superCage->get->keyExists('uid')) {
    $uid = $superCage->get->getInt('uid');
} else {
    $uid = -1;
}
and replace with
Code: [Select]
if ($superCage->get->keyExists('uid')) {
    $uid = $superCage->get->getInt('uid');
} else {
    $uid = -1;
}

if ($uid == 1 && !GALLERY_ADMIN_MODE) $uid = -1;


I suggest to apply both code changes.