Advanced search  

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

Pages: [1]   Go Down

Author Topic: Hiding admin profile  (Read 2543 times)

0 Members and 1 Guest are viewing this topic.

EllieG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Hiding admin profile
« 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hiding admin profile
« Reply #1 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();
Logged

EllieG

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Hiding admin profile
« Reply #2 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hiding admin profile
« Reply #3 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.033 seconds with 20 queries.