Advanced search  

News:

cpg1.5.44 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.42 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: Can No Longer Move Groups of Images to New Album After Upgrade  (Read 13671 times)

0 Members and 1 Guest are viewing this topic.

Gillie

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Can No Longer Move Groups of Images to New Album After Upgrade
« on: October 19, 2012, 06:53:11 AM »

On the site, our gallery is organized into albums by topic, and members upload images into a particular album. While the entire membership shares the albums and all images, only the individual user can edit the images that he/she's uploaded.

Before the upgrade, it was easy to move my images into another album in groups up to 25 images. After I uploaded an image into an album, I could see all my previously uploaded images that were in that album. If I wanted to move some to another album, I just went to the drop-down menu for a particular image and chose another album designation, and clicked "Save changes". It was done.

Now, after the upgrade, there's a problem.  When I upload my images into a particular album, I can only see my images from my most recent upload. If I need to move any of my previously uploaded images that are in that album, I have to track them down individually and edit them one at a time which is time-consuming.

Any suggestions?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #1 on: October 23, 2012, 02:53:17 PM »

When I upload my images into a particular album, I can only see my images from my most recent upload.
That's a new feature related to the flash uploader. It only lists the recently uploaded images.


If I need to move any of my previously uploaded images that are in that album, I have to track them down individually
You don't have to track them down individually. Just use the edit files form and all your images will be displayed as usual.
Logged

Gillie

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #2 on: October 23, 2012, 09:05:46 PM »

There are 2000 members without access to the edit file form.  They've uploaded 40,000 pictures in 28 albums that the memberbase shares. Individuals need the ability to move their pictures which are 100 out of thousands.

How can they search through everybody's pictures to find theirs in a particular album?

Is there a way that each member can see THEIR uploads only in a particular album?
Logged

Gillie

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #3 on: October 23, 2012, 09:32:07 PM »

Let me add that only admins have the edit file form you mention.

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #4 on: October 24, 2012, 09:10:42 AM »

How can they search through everybody's pictures to find theirs in a particular album?

Is there a way that each member can see THEIR uploads only in a particular album?
Both can be accomplished with the lastupby meta album. But I think we should focus on your actual question. Try to enable the config option Allow users to retain control over their pics in public galleries and the edit files form should be displayed to everybody.
Logged

Gillie

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #5 on: October 24, 2012, 08:59:08 PM »

Quote
Αndré wrote:
Try to enable the config option Allow users to retain control over their pics in public galleries and the edit files form should be displayed to everybody.
Thanks, Andre, for your reply.

I have checked everything in my config and all is set to allow members to retain control over their pics in public galleries.  As a member, not as an admin, they can no longer control the editing of their pictures by seeing all their uploads and scrolling down to change all at once and then hitting 'save changes'.  The only option available since the upgrade is to have them click on one image.  Then they have the option of :

crop and rotate
edit file
delete file

They can choose one of those 3 and then they have to leave that picture and then choose another picture to edit.

We used to be able to view up to a certain amount (25 is what we set).  Then we'd see all our uploads from a particular album when we uploaded.  Then we used to be able to scroll down the page and edit titles, drop down arrow to move to other albums, add descriptions and etc, etc.  When we finished, we were able to click 'save changes' on the bottom of our screen and 25 were edited at the same time.

Now, we can only do one.

I've asked my webhost to check and he suggested maybe it's a bug because he didn't see how I could change it.

Can you please try on your end in a gallery and see if you, as a member not as an admin, can edit pictures.

The only thing I can see at one time is all my pictures in a thumbnail mode page by page, which is fine for viewing, but I can't edit from that view.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #6 on: October 25, 2012, 11:19:04 AM »

We used to be able to view up to a certain amount (25 is what we set).  Then we'd see all our uploads from a particular album when we uploaded.  Then we used to be able to scroll down the page and edit titles, drop down arrow to move to other albums, add descriptions and etc, etc.  When we finished, we were able to click 'save changes' on the bottom of our screen and 25 were edited at the same time.
That's exactly what the edit files form still does.


Can you please try on your end in a gallery and see if you, as a member not as an admin, can edit pictures.
Of course I checked that in advance. That's why I asked you to enable the config option. The link to the edit files form is displayed in the category/album list view (not in the thumbnail or intermediate-sized view). Please post a link to your gallery and a test user account, so I can have a look at your gallery myself.


Logged

afrunti

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #7 on: October 25, 2012, 04:02:08 PM »

Thanks for your help Andre.

I'm Alana and an admin on that site too.  Is there a place where I can private message or email you the links and test accounts?
Logged

afrunti

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #8 on: October 25, 2012, 05:12:10 PM »

Andre, 

I've rechecked the config and the groups permissions under "Manage user groups" and all is set correctly and the same settings as we had before the recent upgrade.

I also want to make sure we're talking about the public gallery, the one all members use.  We don't allow personal galleries.

thank you
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #9 on: October 25, 2012, 07:09:34 PM »

afrunti, PM sent.
Logged

afrunti

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #10 on: October 26, 2012, 05:30:00 AM »

Hello

Have you had a chance to view the gallery settings I have?  Hopefully you'll see what I'm doing wrong.

Thanks

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #11 on: October 29, 2012, 04:30:12 PM »

The button to the edit files form is simply not displayed. Please try the following fix and report any unexpected behavior. If it works as expected, it will be added to cpg1.5.22.

Open index.php and replace the whole function album_adm_menu with the following one:
Code: [Select]
function album_adm_menu($aid, $cat, $owner)
{
    global $CONFIG, $USER_DATA, $lang_album_admin_menu;

    static $public_upload_albums = null;
    if ($public_upload_albums === null) {
        $public_upload_albums = array();
        $result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE uploads = 'YES'");
        while ($row = mysql_fetch_assoc($result)) {
            $public_upload_albums[] = $row['aid'];
        }
    }

    //check if user is allowed to edit album
    if (USER_ADMIN_MODE) {
        //check if it is the user's gallery
        if ($cat == USER_ID + FIRST_USER_CAT) {
            return html_albummenu($aid);
        } elseif ($owner == USER_ID) {
            //check if admin allows editing after closing category
            if ($CONFIG['allow_user_edit_after_cat_close'] == 0) {
                //Disallowed -> Check if album is in such a category
                $result = cpg_db_query("SELECT DISTINCT alb.category FROM {$CONFIG['TABLE_ALBUMS']} AS alb INNER JOIN {$CONFIG['TABLE_CATMAP']} AS catm ON alb.category=catm.cid WHERE alb.owner = '" . $USER_DATA['user_id'] . "' AND alb.aid='$aid' AND catm.group_id IN (" . implode(', ', $USER_DATA['groups']) . ")");
                $allowed_albums = cpg_db_fetch_rowset($result);
                if (!$allowed_albums || ($allowed_albums[0]['category'] == '')) {
                    return "<strong>" . $lang_album_admin_menu['cat_locked'] . "</strong>";
                }
            }
            if (!$CONFIG['users_can_edit_pics']) {
                //return menu without edit pics button
                return html_albummenu3($aid);
            } else {
                //return whole menu
                return html_albummenu($aid);
            }
        } elseif (in_array($aid, $public_upload_albums) && mysql_result(mysql_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = $aid AND owner_id = ".USER_ID), 0)) {
            return html_albummenu2($aid);
        } else {
            return '';
        }
    } elseif (GALLERY_ADMIN_MODE) {
        return html_albummenu($aid);
    } elseif (in_array($aid, $USER_DATA['allowed_albums'])) {
   
        //check for moderator rights
        return html_albummenu2($aid);
    } else {
        return '';
    }
} // function album_adm_menu
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #12 on: November 27, 2012, 03:11:26 PM »

afrunti, does it work for you as expected?
Logged

afrunti

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #13 on: December 27, 2012, 07:06:06 PM »

Hello Andre

I know it's been a while, had some problems after a major hurricane where I live.  I've given this to my technical expert and as soon as he is able I will let you know if it works or not.

Thank you very much.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #14 on: January 09, 2013, 06:09:31 PM »

I just noticed that you get a
Quote
You don't have permission to perform this operation.
error message after you follow the edit files button in some cases (I just tested it as a regular user on a password protected album owned by somebody else).

The scripts stops at editpics.php - Line: 113, which is
Code: [Select]
    if ((!user_is_allowed() && !GALLERY_ADMIN_MODE && !MODERATOR_EDIT_MODE)) {
        cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
    }

If we have a look at the function user_is_allowed(), we find something like
Code: [Select]
        $public_albums = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} INNER JOIN {$CONFIG['TABLE_CATEGORIES']} ON cid = category WHERE category < " . FIRST_USER_CAT . " AND ((uploads='YES' AND (visibility = '0' OR visibility IN ".USER_GROUP_SET." OR alb_password != '')) OR (owner=".USER_ID.")) AND aid=$album_id");which differs from my
Code: [Select]
$result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE uploads = 'YES'");as it additionally checks the visibility and album password.


I'll post an updated code suggestion soon.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #15 on: January 09, 2013, 06:30:21 PM »

I just noticed that you get a error message after you follow the edit files button in some cases (I just tested it as a regular user on a password protected album owned by somebody else).
This was a bug I just fixed in SVN revision 8525.

However, we still need to fix the code for private albums, i.e. open index.php and replace the whole function album_adm_menu with the following one:
Code: [Select]
function album_adm_menu($aid, $cat, $owner)
{
    global $CONFIG, $USER_DATA, $lang_album_admin_menu;

    static $public_upload_albums = null;
    if ($public_upload_albums === null) {
        $public_upload_albums = array();
        $result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE uploads = 'YES' AND category < ".FIRST_USER_CAT." AND (visibility = '0' OR visibility IN ".USER_GROUP_SET." OR alb_password != '')");
        while ($row = mysql_fetch_assoc($result)) {
            $public_upload_albums[] = $row['aid'];
        }
    }

    //check if user is allowed to edit album
    if (USER_ADMIN_MODE) {
        //check if it is the user's gallery
        if ($cat == USER_ID + FIRST_USER_CAT) {
            return html_albummenu($aid);
        } elseif ($owner == USER_ID) {
            //check if admin allows editing after closing category
            if ($CONFIG['allow_user_edit_after_cat_close'] == 0) {
                //Disallowed -> Check if album is in such a category
                $result = cpg_db_query("SELECT DISTINCT alb.category FROM {$CONFIG['TABLE_ALBUMS']} AS alb INNER JOIN {$CONFIG['TABLE_CATMAP']} AS catm ON alb.category=catm.cid WHERE alb.owner = '" . $USER_DATA['user_id'] . "' AND alb.aid='$aid' AND catm.group_id IN (" . implode(', ', $USER_DATA['groups']) . ")");
                $allowed_albums = cpg_db_fetch_rowset($result);
                if (!$allowed_albums || ($allowed_albums[0]['category'] == '')) {
                    return "<strong>" . $lang_album_admin_menu['cat_locked'] . "</strong>";
                }
            }
            if (!$CONFIG['users_can_edit_pics']) {
                //return menu without edit pics button
                return html_albummenu3($aid);
            } else {
                //return whole menu
                return html_albummenu($aid);
            }
        } elseif (in_array($aid, $public_upload_albums) && mysql_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = $aid AND owner_id = ".USER_ID), 0)) {
            return html_albummenu2($aid);
        } else {
            return '';
        }
    } elseif (GALLERY_ADMIN_MODE) {
        return html_albummenu($aid);
    } elseif (in_array($aid, $USER_DATA['allowed_albums'])) {

        //check for moderator rights
        return html_albummenu2($aid);
    } else {
        return '';
    }
} // function album_adm_menu[/quote]
« Last Edit: January 09, 2013, 06:37:13 PM by Αndré »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #16 on: January 10, 2013, 12:38:19 PM »

To reduce database query count, here's an optimized version of album_adm_menu:
Code: [Select]
function album_adm_menu($aid, $cat, $owner)
{
    global $CONFIG, $USER_DATA, $lang_album_admin_menu;

    static $public_album_uploads = null;
    if ($public_album_uploads === null) {
        $public_album_uploads = array();
        $result = cpg_db_query("SELECT a.aid FROM {$CONFIG['TABLE_ALBUMS']} AS a INNER JOIN {$CONFIG['TABLE_PICTURES']} as p ON p.aid = a.aid WHERE uploads = 'YES' AND category < ".FIRST_USER_CAT." AND (visibility = '0' OR visibility IN ".USER_GROUP_SET." OR alb_password != '') AND owner_id = ".USER_ID);
        while ($row = mysql_fetch_assoc($result)) {
            $public_album_uploads[] = $row['aid'];
        }
        mysql_free_result($result);
    }

    //check if user is allowed to edit album
    if (USER_ADMIN_MODE) {
        //check if it is the user's gallery
        if ($cat == USER_ID + FIRST_USER_CAT) {
            return html_albummenu($aid);
        } elseif ($owner == USER_ID) {
            //check if admin allows editing after closing category
            if ($CONFIG['allow_user_edit_after_cat_close'] == 0) {
                //Disallowed -> Check if album is in such a category
                $result = cpg_db_query("SELECT DISTINCT alb.category FROM {$CONFIG['TABLE_ALBUMS']} AS alb INNER JOIN {$CONFIG['TABLE_CATMAP']} AS catm ON alb.category=catm.cid WHERE alb.owner = '" . $USER_DATA['user_id'] . "' AND alb.aid='$aid' AND catm.group_id IN (" . implode(', ', $USER_DATA['groups']) . ")");
                $allowed_albums = cpg_db_fetch_rowset($result);
                if (!$allowed_albums || ($allowed_albums[0]['category'] == '')) {
                    return "<strong>" . $lang_album_admin_menu['cat_locked'] . "</strong>";
                }
            }
            if (!$CONFIG['users_can_edit_pics']) {
                //return menu without edit pics button
                return html_albummenu3($aid);
            } else {
                //return whole menu
                return html_albummenu($aid);
            }
        } elseif (in_array($aid, $public_album_uploads)) {
            return html_albummenu2($aid);
        } else {
            return '';
        }
    } elseif (GALLERY_ADMIN_MODE) {
        return html_albummenu($aid);
    } elseif (in_array($aid, $USER_DATA['allowed_albums'])) {

        //check for moderator rights
        return html_albummenu2($aid);
    } else {
        return '';
    }
} // function album_adm_menu

This change has just been committed in SVN revision 8526.
« Last Edit: January 10, 2013, 12:43:50 PM by Αndré »
Logged

afrunti

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #17 on: January 12, 2013, 04:46:03 PM »

thank you so much for your help andre.  I'm still waiting for my tech guy to help me do this since it's a bit over my head. 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15250
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #18 on: January 12, 2013, 08:28:31 PM »

cpg1.5.22 has just been released and already contains the latest version.
Logged

afrunti

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: Can No Longer Move Groups of Images to New Album After Upgrade
« Reply #19 on: February 07, 2013, 02:50:24 AM »

Hi Andre

Should I give my tech guy the details in the 'fix' or would it be easier for him to do a complete upgrade again?

thank you
Logged
Pages: [1] 2   Go Up
 

Page created in 0.081 seconds with 20 queries.