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: Limit upload plugin for cpg1.6.x  (Read 7350 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Limit upload plugin for cpg1.6.x
« on: November 27, 2018, 04:59:25 pm »

This is the cpg1.6.x and PHP7 compatible version of the Limit upload plugin.

This plugin allows you to limit the number of uploads for your users. You can choose a total number of files, or a certain amount of files for different periods of time.
« Last Edit: November 28, 2018, 11:04:12 am by Αndré »
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Limit upload plugin for cpg1.6.x
« Reply #1 on: November 28, 2018, 01:08:38 am »

Thank you Andre.  I uninstalled the old one, and went to install this new one, unfortunately it gives me this error when I try. 

Critical error

There was an error while processing a database query.


While executing query 'INSERT INTO cpg_config (name, value) VALUES ('limit_upload_upload_limit', '-1')' in plugins/limit_upload/codebase.php on line 96

database error: 1062 : Duplicate entry 'limit_upload_upload_limit' for key 'PRIMARY'

File: /hxxxx/cxxxxxxx/public_html/gallery/include/functions.inc.php - Line: 250 
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Limit upload plugin for cpg1.6.x
« Reply #2 on: November 28, 2018, 09:18:37 am »

I'll fix that soon.
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Re: Limit upload plugin for cpg1.6.x
« Reply #3 on: November 28, 2018, 09:25:10 am »

Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Limit upload plugin for cpg1.6.x
« Reply #4 on: November 28, 2018, 10:48:35 am »

There's nothing to fix in the plugin, as the config values will be deleted when uninstalling the plugin (that function existed since the very first version):
Code: [Select]
$thisplugin->add_action('plugin_uninstall', 'limit_upload_uninstall');

function limit_upload_uninstall () {
    global $CONFIG;
    cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'limit_upload_upload_limit'");
    cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'limit_upload_time_limit'");

    return true;
}

For whatever reason they haven't been deleted in your gallery (maybe missing permissions to use the DELETE command?). To get the plugin installed, either delete the rows "limit_upload_upload_limit" and "limit_upload_time_limit" from your config table with phpMyAdmin, or adjust those lines in codebase.php:
Code: [Select]
    cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES ('limit_upload_upload_limit', '-1')");
    cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES ('limit_upload_time_limit', 'total')");
(either commend them out or replace INSERT with REPLACE).
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Limit upload plugin for cpg1.6.x
« Reply #5 on: November 28, 2018, 08:59:02 pm »

Thanks, I went with the delete table option, and now installed fine.  Not idea why it wouldn't delete those table when I uninstalled the old plugin though, I haven't had this problem with anything else I'm aware of.

One of those little mysteries I guess.  Anyway with your help it's sorted.  ;)
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.