Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Solved]: Onlinestats only for admins  (Read 6399 times)

0 Members and 1 Guest are viewing this topic.

paquets

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
[Solved]: Onlinestats only for admins
« on: May 17, 2010, 04:11:53 pm »

Hi,

I was wondering if it is possible to have the Onlinestats black only visible to admins. I managed to do it on CPG 1.4.x but for some reason in CPG 1.5 it leaves registered users and guests with an empty block with the mention "No image to display"

Code changed in CPG 1.5:

From:

Code: [Select]
function online_mainpage()
{
        global $CONFIG, $cpg_udb, $matches, $lang_plugin_php, $lang_date, $LINEBREAK;
        if($matches[1] != 'onlinestats') {
          return $matches;
        }

To:
Code: [Select]
function online_mainpage()
{
        global $CONFIG, $cpg_udb, $matches, $lang_plugin_php, $lang_date, $LINEBREAK;
        if($matches[1] != 'onlinestats' || !GALLERY_ADMIN_MODE) {
          return $matches;
        }

URL for my testbed: adpharm.net/cpg15

Thank you and great job with 1.5!
« Last Edit: May 18, 2010, 07:16:24 am by Joachim Müller »
Logged

paquets

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Onlinestats only for admins
« Reply #1 on: May 17, 2010, 04:14:14 pm »

Forgot to mention that the code changed is in the file codebase.php
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Onlinestats only for admins
« Reply #2 on: May 17, 2010, 08:35:51 pm »

Works for me as expected. Can you please perform an svn checkout of Coppermine's core files and try again? I assume it's related to that issue.
Logged

paquets

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 59
Re: Onlinestats only for admins
« Reply #3 on: May 17, 2010, 09:01:49 pm »

It worked. Just has to download the latest functions.inc.php.
Thanks André!
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.