Bug in list_albums: No control buttons +FIX Bug in list_albums: No control buttons +FIX
 

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

Bug in list_albums: No control buttons +FIX

Started by jjulian_97, December 10, 2003, 08:49:55 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jjulian_97

I think this may be the same problem as the administrator can't belong to other groups, but here it is anyway.

As the administrator, I created three albums in my user gallery. One of them, I set to allow access to a custom group, one to the registered group, and one to the general public. When list_albums builds $alb_list, the info for the albums in all but the public group album had no control buttons (delete, properties, edit pics). The link for the thumbnail was also incorrect as it pointed to "thumbnails.php?album=" for the non-public albums.

I tracked it down to the $visibility check under the "//Prepair Everything" remark. Seems to be checking against only one group rather than all the groups that the user belongs to. Here's the diff that fixed it for me.

** index.php.old2003-12-09 23:03:06.000000000 -0800
--- index.php2003-12-09 23:02:48.000000000 -0800
***************
*** 357,363 ****
              $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/nopic.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
          }
          // Prepare everything
!         if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || $visibility == $USER_DATA['group_id']) {
              $last_upload_date = $count ? localised_date($alb_stat['last_upload'], $lastup_date_fmt) : '';
              $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
              $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
--- 357,363 ----
              $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/nopic.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
          }
          // Prepare everything
!         if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || strstr(USER_GROUP_SET, $visibility)) {
              $last_upload_date = $count ? localised_date($alb_stat['last_upload'], $lastup_date_fmt) : '';
              $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
              $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];

rayne

How did you set the album to allow access to a custom group?
Thanks.
--Rayne