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: "register" only for fullsize pictures...!?  (Read 10679 times)

0 Members and 1 Guest are viewing this topic.

hardlocke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
"register" only for fullsize pictures...!?
« on: October 12, 2003, 11:39:15 pm »

hi
i found in FAQ "How can I prevent unregistered user from viewing the gallery? "

but how can i prevent only the fullsize popup pictures from viewing by unregistered users? can anybody help me?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
"register" only for fullsize pictures...!?
« Reply #1 on: October 13, 2003, 01:16:15 am »

this will be a possible feature of a future version of coppermine.
At the moment I don't know a hack that'll do that.

GauGau
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
"register" only for fullsize pictures...!?
« Reply #2 on: October 13, 2003, 01:54:37 am »

Try this:

In displayimage.php, replace:
Code: [Select]
if (isset($image_size['reduced'])) {
  $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
  $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
  $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','".uniqid(rand())."','toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
  $pic_html .= "<img src=\"".$picture_url."\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
  $pic_html .= "</a>\n";
} else {
  $pic_html = "<img src=\"".$picture_url."\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
}

with this:
Code: [Select]
if (isset($image_size['reduced'])) {
  $winsizeX = $CURRENT_PIC_DATA['pwidth'] + 16;
  $winsizeY = $CURRENT_PIC_DATA['pheight'] + 16;
  // Added check for popup only if user is registered
  if (USER_ID or USER_IS_ADMIN) {
    $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','".uniqid(rand())."','toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
    $pic_html .= "<img src=\"".$picture_url."\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
    $pic_html .= "</a>\n";
  } else {
    $pic_html = "<img src=\"".$picture_url."\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />";
  }
} else {
  $pic_html = "<img src=\"".$picture_url."\" {$image_size['geom']} class=\"image\" border=\"0\" /><br />\n";
}
Tested with the nuke port, should work the same in the standalone version.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

hardlocke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
"register" only for fullsize pictures...!?
« Reply #3 on: October 13, 2003, 10:17:57 am »

thanks a lot, now it work fine with pnCPG.
but how can i now remove the "login/logoff" link in coppermine?
i would only show the username who is logged in via postnuke

how can i do this?


and another question:
how can i exclude also a user (ie a guest-user) from viewing the full-images?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
"register" only for fullsize pictures...!?
« Reply #4 on: October 13, 2003, 04:08:52 pm »

First, make sure you post your question in the appropriate forum.  This should be in the postNuke board.

Second, the hack I provided allows registered users to see the full size images.  Guest/anonymous users don't get to see the full size pics.

Third, if you want to remove the login/off link, just edit your theme and take it out.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

casNuy

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 671
  • My other hobby
    • Nuy Community
"register" only for fullsize pictures...!?
« Reply #5 on: October 13, 2003, 11:15:56 pm »

With pnCPG it is easy to allow only access for registered users. This will be standard available (is actually a bug in the current version).
In addition one needs to change a few files in Coppermine to have people always routed through pnCPG.

Insert the following code :
Code: [Select]

if (!USER_ID) cpg_die(ERROR, '<a href=../index.php?module=pnCPG&func=main target=_top>Click here to access the Gallery</a>', __FILE__, __LINE__);


into the following files :
index.php, thumbnails.php, search.php, dispaly(image/card).php and showthumb.php

Insert this code just after :
Code: [Select]
require('include/init.inc.php');


I got this tip from CorkieJP who on his turn found this option on..
GauGau.de

So combining pnCPG with this hack will also take care of non-registered users being able to see Full screen pictures.

Cas
Logged

hardlocke

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
"register" only for fullsize pictures...!?
« Reply #6 on: November 08, 2003, 03:52:42 am »

hi cas
can i use this hack also to prevent guests from viewing the medium/fullsize pictures???
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 16 queries.