Thumbnails only for nongroup members and login on detail page. Thumbnails only for nongroup members and login on detail page.
 

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

Thumbnails only for nongroup members and login on detail page.

Started by hittjw, May 05, 2005, 01:24:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hittjw

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
Build Profitable Business Relationships, http://iunctura.com/newsletter
Successfully Sell and Market Executives, http://hittpublishingdirect.com/

Nibbler

Add into displayimage.php, just after

require('include/init.inc.php');

the code
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

hittjw

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:

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


I placed:

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
Build Profitable Business Relationships, http://iunctura.com/newsletter
Successfully Sell and Market Executives, http://hittpublishingdirect.com/