"register" only for fullsize pictures...!? "register" only for fullsize pictures...!?
 

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]

Main Menu

"register" only for fullsize pictures...!?

Started by hardlocke, October 12, 2003, 11:39:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hardlocke

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?

Joachim Müller

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

kegobeer

Try this:

In displayimage.php, replace:
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: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.
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

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?

kegobeer

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.
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

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 :

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 :
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

hardlocke

hi cas
can i use this hack also to prevent guests from viewing the medium/fullsize pictures???