[dw-free] Allow userpic quota overrides
[commit: http://hg.dwscoalition.org/dw-free/rev/ec2e387048b2]
Allow userpic quota overrides
This will let people import all of their userpics regardless of their
current account quota. Up to the limit configured by this new override.
Patch by
mark.
Files modified:
Allow userpic quota overrides
This will let people import all of their userpics regardless of their
current account quota. Up to the limit configured by this new override.
Patch by
Files modified:
- cgi-bin/DW/Worker/ContentImporter/Local/Userpics.pm
- doc/config-local.pl.txt
--------------------------------------------------------------------------------
diff -r 81e8dfa8d97c -r ec2e387048b2 cgi-bin/DW/Worker/ContentImporter/Local/Userpics.pm
--- a/cgi-bin/DW/Worker/ContentImporter/Local/Userpics.pm Sun Jan 01 22:31:49 2012 +0800
+++ b/cgi-bin/DW/Worker/ContentImporter/Local/Userpics.pm Sun Jan 01 23:12:24 2012 +0000
@@ -46,7 +46,7 @@
$log ||= sub { undef };
my $count = $u->get_userpic_count;
- my $max = $u->userpic_quota;
+ my $max = $LJ::IMPORT_OVERRIDE_USERPICS || $u->userpic_quota;
my $left = $max - $count;
my $pending = scalar( @{$upics || [] } );
@@ -151,7 +151,7 @@
$ret = 1;
my $count = $u->get_userpic_count;
- my $max = $u->userpic_quota;
+ my $max = $LJ::IMPORT_OVERRIDE_USERPICS || $u->userpic_quota;
if ( $count >= $max ) {
push @$errors, "Icon '$identifier': You are at your limit of $max " . ($max == 1 ? "userpic" : "userpics") .
diff -r 81e8dfa8d97c -r ec2e387048b2 doc/config-local.pl.txt
--- a/doc/config-local.pl.txt Sun Jan 01 22:31:49 2012 +0800
+++ b/doc/config-local.pl.txt Sun Jan 01 23:12:24 2012 +0000
@@ -121,6 +121,10 @@
$COMMENT_IMPORT_MAX = undef;
$COMMENT_IMPORT_ERROR = "Importing more than 10,000 comments is currently disabled.";
+ # Uncomment and set this value if you want to allow anybody to import as many userpics
+ # as they can. Otherwise, we obey the quota their account type has.
+ #$IMPORT_OVERRIDE_USERPICS = 500;
+
}
1;
--------------------------------------------------------------------------------

no subject