Hiding admin profile Hiding admin profile
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Hiding admin profile

Started by EllieG, August 11, 2010, 11:53:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

EllieG

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

Αndré

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();

EllieG

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.

Αndré

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.