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: User Galleries- thumbnail appears on password protected Album  (Read 17255 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 18, 2012, 11:16:28 pm »

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: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #1 on: December 18, 2012, 11:44:47 pm »

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 18, 2012, 11:59:31 pm »

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: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #3 on: December 19, 2012, 12: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, 12: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, 02: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: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #6 on: December 19, 2012, 03: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, 04: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: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #8 on: December 19, 2012, 04: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, 05: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: 1322
  • Fishing relaxes me.
    • Bailey Family Co.
Re: User Galleries- thumbnail appears on password protected Album
« Reply #9 on: December 19, 2012, 05: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, 05: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, 07: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: 15764
Re: Re: User Galleries- thumbnail appears on password protected Album
« Reply #11 on: December 19, 2012, 10: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: 15764
Re: User Galleries- thumbnail appears on password protected Album
« Reply #12 on: December 19, 2012, 11:09:01 am »

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: 15764
Re: Re: User Galleries- thumbnail appears on password protected Album
« Reply #13 on: January 09, 2013, 09: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

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: User Galleries- thumbnail appears on password protected Album
« Reply #14 on: January 09, 2013, 12: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.026 seconds with 20 queries.