coppermine-gallery.com/forum

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
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
Quote from: EllieG on September 03, 2010, 12:44:30 PM
I'd prefer it if the admin profile didn't show up at all
Open usermgr.php, find
    foreach ($users as $user) {
and replace with
    foreach ($users as $user) {

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



Quote from: EllieG on September 03, 2010, 12:44:30 PM
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
if ($superCage->get->keyExists('uid')) {
    $uid = $superCage->get->getInt('uid');
} else {
    $uid = -1;
}

and replace with
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.