Advanced search  

News:

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

Pages: 1 2 3 [4] 5 6 7   Go Down

Author Topic: Download complete album als ZIP  (Read 62175 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #60 on: May 29, 2012, 11:22:26 AM »

I'm attaching a patch (administrators --- could you apply this, please?).
Committed in SVN revision 8431.


i checked $aid and whatever album i try, its value is always 1
Please post a link to your gallery.
Logged

Cainte

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 41
Re: Download complete album als ZIP
« Reply #61 on: June 05, 2012, 04:38:28 PM »

Hello,

I really tried to understand how to "install" this helpful plugin, but somehow I'm afraid to crash my gallery. I downloaded the files from your link André and I don't know where to place all the files, or which files just include the changes to make... sorry.

I'd be very grateful for some help...

Cainte
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #62 on: June 05, 2012, 05:02:26 PM »

Create a new directory albumdownload inside the plugins directory in your Coppermine directory with your FTP client and download all files to that new directory. Then, install the plugin as described in the docs.
Logged

Cainte

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 41
Re: Download complete album als ZIP
« Reply #63 on: June 05, 2012, 05:09:08 PM »

Thank you Andre. :-)
Logged

Cainte

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 41
Re: Download complete album als ZIP
« Reply #64 on: June 05, 2012, 08:06:24 PM »

now I installed it succesfully and it works. Thx again Andre.

A new problem now is that no matter in which album I push the ZIP Button it's always the same Album that gets downloaded with the same filename. It's the album with id 1

When I go over the ZIP Button the link is wrong it shows  .../index.php?file=albumdownload/albumZip&aid=1
But the album id of this album is 22

cpg version is 1.5.20
« Last Edit: June 05, 2012, 08:43:24 PM by Cainte »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #65 on: June 06, 2012, 08:31:24 AM »

Please try the latest codebase.php file from the SVN repository (revision 8445).
Logged

Cainte

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 41
Re: Download complete album als ZIP
« Reply #66 on: June 06, 2012, 12:19:27 PM »

Thx Andre. Now everything works fine!!
Logged

tuxyso

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Download complete album als ZIP
« Reply #67 on: June 08, 2012, 11:24:42 AM »

Great plugin, congratualations! It is exactly the plugin I have looking for a long time. But I think in the current implementation it breaks the access control policies of coppermine. At the moment there are basically 3 access levels:
  • public access without password
  • direct link to album and access with password
  • access only after login with username and password

I expected that albumZip.php sticks to these levels. Independently which access for an album is configured, the direct url
 
Code: [Select]
http://<mybaseurl>/index.php?file=albumdownload/albumZip&aid=<albumnr>
leads to a download of the complete album. Is there a future plan to prevent such an access? If not, albumZip is a serious security hole, because the album ids are predictable, starting with id 1 with an increment of 1.

At the current state one workaround might be an Apache .htaccess based on a special RegexMatch pattern. A special username and password is given to users who want to download complete zip files. For coppermine random album ids (e.g. hash values) could improve the situation. The best way, of course, would the consideration of security levels by the album download plugin.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #68 on: June 08, 2012, 12:03:34 PM »

Open albumZip.php, find
Code: [Select]
$query = "SELECT filepath, filename FROM {$CONFIG['TABLE_PICTURES']} AS pictures , (SELECT keyword FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '" . $aid . "' ) AS keyword WHERE pictures.aid = '" . $aid . "' OR ( keyword.keyword <> '' AND CONCAT(';', keywords, ';') LIKE CONCAT('%;', keyword.keyword, ';%'))";and replace with
Code: [Select]
get_meta_album_set(0);
$query = "SELECT filepath, filename FROM {$CONFIG['TABLE_PICTURES']} AS pictures , (SELECT keyword FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '" . $aid . "' ) AS keyword, {$CONFIG['TABLE_ALBUMS']} AS r $RESTRICTEDWHERE AND r.aid = pictures.aid AND (pictures.aid = '" . $aid . "' OR ( keyword.keyword <> '' AND CONCAT(';', keywords, ';') LIKE CONCAT('%;', keyword.keyword, ';%')))";

This will currently offer an empty zip file for albums with restricted access or invalid album IDs, which could of course be optimized. Please report if the code change works as expected for you.
Logged

tuxyso

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Download complete album als ZIP
« Reply #69 on: June 08, 2012, 12:11:46 PM »

The code works for me in all cases:
  • public album: regular zip file
  • album with restricted access: empty zip file

Thanks for your fast reply.



Logged

hiddenvalley390

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 8
Re: Download complete album als ZIP
« Reply #70 on: October 09, 2012, 10:36:45 PM »

Thanks for the great plugin.

The plugin works fine when I download an album with not many pics in it but when I try to download an album with a large amount of files (100+) it just lists the filenames of the picutes.  I dont get any error and the zip isn't created.

Do you have any ideas on how to try and get this working for albums with a large amount of pics?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #71 on: October 10, 2012, 09:56:25 AM »

when I try to download an album with a large amount of files (100+) it just lists the filenames of the picutes.
I guess that's some kind of timeout issue. The display of the filenames seems to be a debugging leftover. Please try the latest revision of albumZip.php from our SVN repository, it probably won't fix your issue but will give us some information at which step the script stops.


the zip isn't created.
Have you checked that manually by looking at the albums/edit/ directory?
Logged

hiddenvalley390

  • Contributor
  • Coppermine newbie
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 8
Re: Download complete album als ZIP
« Reply #72 on: October 10, 2012, 03:20:26 PM »

Have you checked that manually by looking at the albums/edit/ directory?

I have checked and there is no zip file located in albums/edit.

One of the albums takes a while but it then downloads a zip of 0 bytes. I have also got a few connection reset errors in chrome this morning when trying it. I have also gotten a no data received error once.
Logged

Macelskie

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Download complete album als ZIP
« Reply #73 on: December 03, 2012, 09:51:29 PM »

Hello,
I love this Plug-In, it works very well.
But is there an option that the Zip file will be deleted after downloading it?
Because after many downloads my webspace will be full.

Thank you.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #74 on: December 04, 2012, 11:48:00 AM »

Please check the latest SVN revision. I just added some code that will delete zip files that are older than 48 hours on each new zip file creation in revision 8517.
Logged

Macelskie

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Download complete album als ZIP
« Reply #75 on: December 04, 2012, 11:51:59 AM »

Thanks.
Is it possible to change a value that this files will be deleted after about 15 minutes?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #76 on: December 04, 2012, 01:11:30 PM »

Sure. Replace
Code: [Select]
2 * CPG_DAYwith
Code: [Select]
900but IMHO 15 minutes may be too short for slow connections.
Logged

Rainakthx

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Download complete album als ZIP
« Reply #77 on: January 31, 2013, 06:24:39 PM »

Hi,

First I wanted to say THANK YOU for this plugin. It is amazing and exactly what I needed. I run a really large gallery where people are always wanting Zip downloads of the files we add and as I live in Australia my upload speed is almost in the minuses and it takes hours to upload one zip file to Mediafire.

I was able to get it working fine on one Gallery, however it the name it gives the zip is pictures-510a....etc. It would be great if the name given to the Zip file was the album name. Is there any chance you could tell me how to do this?

Thanks again!!

Raina
Logged

Rainakthx

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Download complete album as ZIP
« Reply #78 on: January 31, 2013, 07:36:47 PM »

Sorry to double post - can't seem to edit my previous one. Is there a way to check how many times something has been downloaded? Some kind of log? Thanks!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Download complete album als ZIP
« Reply #79 on: February 01, 2013, 01:18:02 PM »

the name it gives the zip is pictures-510a....etc. It would be great if the name given to the Zip file was the album name. Is there any chance you could tell me how to do this?

Open zip.php, find
Code: [Select]
$filename = 'edit/pictures-' . uniqid(null) . '.zip';and replace it with something like
Code: [Select]
require_once('include/transliteration.inc.php');
$filename = 'edit/' . preg_replace('/[^0-9a-zA-Z]/', '_', transliteration_process(mysql_result(cpg_db_query("SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = $aid"), 0))) . '.zip';

This will of course break:
code that will delete zip files that are older than 48 hours
as the file names doesn't match
Code: [Select]
/^pictures-[0-9a-f]+.zip$/
This could be fixed if you decide to add a static prefix like
Code: [Select]
pictures-to each file.
Logged
Pages: 1 2 3 [4] 5 6 7   Go Up
 

Page created in 0.082 seconds with 21 queries.