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: Thumbnails only for nongroup members and login on detail page.  (Read 3648 times)

0 Members and 1 Guest are viewing this topic.

hittjw

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
    • Hitt Publishing Direct

I've followed some threads on displaying thumbnails only for unregistered users -- in this question I'd like to display thumbnails only for members who are not a part of a certain group, then when a thumbnail is clicked then go straight to the login page.

This would allow visitors to get an idea of content available, but force them to login for details.

Best,

Justin
Logged
Build Profitable Business Relationships, http://iunctura.com/newsletter
Successfully Sell and Market Executives, http://hittpublishingdirect.com/

Nibbler

  • Guest
Re: Thumbnails only for nongroup members and login on detail page.
« Reply #1 on: May 05, 2005, 06:02:47 pm »

Add into displayimage.php, just after

Code: [Select]
require('include/init.inc.php');
the code
Code: [Select]
if (!in_array(2, $USER_DATA['groups']))
 {
header('Location: http://www.yourdomain.com/path/to/login.php');
exit;
}

where 2 is the group you wish to allow acces to
Logged

hittjw

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
    • Hitt Publishing Direct
Re: Thumbnails only for nongroup members and login on detail page.
« Reply #2 on: May 12, 2005, 04:55:43 am »

Nibbler,

Thank you so much!  I tuned up your suggestion so it response the same as clicking the "Login" button.  But I still need someway to let people through to albums set to "Everybody" ... because I'm using categories tied to groups, I put this in "thumbnails.php" ... you can see this in action by visiting http://hittpublishingdirect.com/cpg/

After:

Code: [Select]
require('include/init.inc.php');
if ($CONFIG['enable_smilies']) include("include/smilies.inc.php");

I placed:

Code: [Select]
global $REFERER;
if (in_array(3, $USER_DATA['groups']))
{
$redirect = "http://" . $HTTP_SERVER_VARS['HTTP_HOST'];
if (dirname($HTTP_SERVER_VARS['PHP_SELF']) != "/")
$redirect = $redirect . dirname($HTTP_SERVER_VARS['PHP_SELF']) . "/";
if ($REFERER) {
$redirect = $redirect . "login.php?referer=" . $REFERER;
header("Location: $redirect");
exit;
}
$redirect = $redirect . "login.php";
header("Location: $redirect");
exit;
}

It allows all groups execpt "Guests" to see content, "Guests" are asked to login.

I'm now looking for a variable to check to know if an album is public -- if it's set visable to "Everybody" then I want my "Guests" to see it too.  Any ideas?

Sincerely,

Justin
« Last Edit: May 13, 2005, 12:47:47 am by hittjw »
Logged
Build Profitable Business Relationships, http://iunctura.com/newsletter
Successfully Sell and Market Executives, http://hittpublishingdirect.com/
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.