Advanced search  

News:

cpg1.5.36 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.34 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: User Galleries- thumbnail appears on password protected Album  (Read 5992 times)

0 Members and 1 Guest are viewing this topic.

wetteddy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
User Galleries- thumbnail appears on password protected Album
« on: December 19, 2012, 12:16:28 AM »

Hi,
 I am allowing users to upload their pictures and password protect their albums. I am having an issue where unlogged users can browse to Home > User galleries and see the thumbnail of the password protected album. This thumbnail is the last picture uploaded by the user in that album. If you click on the users gallery, you then see the lock symbol as you would expect. What setting am I missing?
Thanks
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1325
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #1 on: December 19, 2012, 12:44:47 AM »

When you password protect it, it shouldn't show at all AFAIK. Please post a link.
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

wetteddy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: User Galleries- thumbnail appears on password protected Album
« Reply #2 on: December 19, 2012, 12:59:31 AM »

http://bowlerranch.com/family/index.php?cat=1
The john folder. The blurred thumbnail pic is in the pass protected album
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1325
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #3 on: December 19, 2012, 01:10:07 AM »

I'm receiving a 500 error when trying to access your page.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

wetteddy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: User Galleries- thumbnail appears on password protected Album
« Reply #4 on: December 19, 2012, 01:17:43 AM »

time to call godaddy again. they have been having issues.....
Logged

wetteddy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: User Galleries- thumbnail appears on password protected Album
« Reply #5 on: December 19, 2012, 03:58:07 AM »

Ok, it looks like godaddy fixed their stuff and the site is back up and running.
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1325
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #6 on: December 19, 2012, 04:58:06 AM »

Ok I see what you mean now. AFAIK there is no setting to change which thumb is used for the user catagory. I'm currently not aware of how that is set, I'll have to look though the code.
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

wetteddy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: User Galleries- thumbnail appears on password protected Album
« Reply #7 on: December 19, 2012, 05:25:55 AM »

Thank you for taking the time to look at my issue
Logged

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1325
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #8 on: December 19, 2012, 05:58:46 AM »

ok I did a little digging and since individual pictures don't have permissions a fix will be a little difficult.

The code for selecting a thumb for the individual user category. We can probably just modify it to also select the aid and then check who is allowed to see it. Or we could add a setting to select the thumb like other categories.
Line 654 in Rev 8514
Code: [Select]
        if ($user_pic_count) {
            $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='$user_thumb_pid' AND approved='YES'";
            $result = cpg_db_query($sql);
            if (mysql_num_rows($result)) {
                $picture = mysql_fetch_assoc($result);
                mysql_free_result($result);
                $pic_url = get_pic_url($picture, 'thumb');
                if (!is_image($picture['filename'])) {
                    $image_info = cpg_getimagesize(urldecode($pic_url));
                    $picture['pwidth']  = $image_info[0];
                    $picture['pheight'] = $image_info[1];
                }
                //thumb cropping
                //$image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
                if (array_key_exists('system_icon', $picture) && ($picture['system_icon'] == true)) {
                    $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size'], true, 'cat_thumb');
                } else {
                    $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size'], false, 'cat_thumb');
                }

                $user_thumb = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"\" />";
            }
        }

@Αndré
Should we move this to the bugs board? (for the private photos being displayed)
« Last Edit: December 19, 2012, 06:31:45 AM by Jeff Bailey »
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Jeff Bailey

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1325
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #9 on: December 19, 2012, 06:17:37 AM »

Found the sql for that thumb. max pid or max galleryicon in the pictures table.

If you navigate to an image and then edit the file information you can check "make this my icon" and that will change the image displayed for the user gallery.
« Last Edit: December 19, 2012, 06:32:26 AM by Jeff Bailey »
Logged
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

wetteddy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: User Galleries- thumbnail appears on password protected Album
« Reply #10 on: December 19, 2012, 08:01:15 AM »

That worked!. Thank you very much! and great software BTW.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15083
Re: Re: User Galleries- thumbnail appears on password protected Album
« Reply #11 on: December 19, 2012, 11:55:58 AM »

If I understood the issue correctly a picture from a password protected album has been used as user gallery icon?


Found the sql for that thumb. max pid or max galleryicon in the pictures table.

I assume you mean the 2 queries in bridge/udb_base.inc.php, right? I think we have check the content of $forbidden_with_icon, as it seems to be responsible to hide exclude pictures in password protected albums. Will perform some checks.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15083
Re: User Galleries- thumbnail appears on password protected Album
« Reply #12 on: December 19, 2012, 12:09:01 PM »

As far as I can tell the following check is nonsense:
Code: [Select]
        if (!$cpg_show_private_album && $FORBIDDEN_SET != "") {
            // $forbidden_with_icon = "$FORBIDDEN_SET or p.galleryicon=p.pid";
            $forbidden_with_icon = "$FORBIDDEN_SET";
            $forbidden = "$FORBIDDEN_SET";
        } else {
            $forbidden_with_icon = '';
            $forbidden = '';
        }
as we always need to hide pictures in password protected albums, regardless of the setting if a user can have a personal gallery at all or if the album will be hidden or displayed with the padlock icon.

If I replace all occurrences of $forbidden and $forbidden_with_icon with $FORBIDDEN_SET in list_users_query it seems to work as expected. Can anyone please confirm that there's no error in reasoning (and probably also test it), so I can commit that change? Thank you.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15083
Re: Re: User Galleries- thumbnail appears on password protected Album
« Reply #13 on: January 09, 2013, 10:48:37 AM »

Can anyone please confirm that there's no error in reasoning (and probably also test it), so I can commit that change?

Jeff? Anyone?
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4274
    • Windsurf.me
Re: User Galleries- thumbnail appears on password protected Album
« Reply #14 on: January 09, 2013, 01:31:10 PM »

If I replace all occurrences of $forbidden and $forbidden_with_icon with $FORBIDDEN_SET in list_users_query it seems to work as expected. Can anyone please confirm that there's no error in reasoning (and probably also test it), so I can commit that change? Thank you.

Seems to work as expected for me.
Logged
It is a mistake to think you can solve any major problems just with potatoes.
Pages: [1]   Go Up
 

Page created in 0.08 seconds with 19 queries.