Reverse the effect of the checkbox; logic was wrong.

        Patch by kareila. 

diffs (29 lines):

diff -r 8b4914e597b4 -r 690e8610d403 cgi-bin/DW/Setting/AllowVgiftsFrom.pm
--- a/cgi-bin/DW/Setting/AllowVgiftsFrom.pm     Fri Oct 29 19:36:06 2010 +0800
+++ b/cgi-bin/DW/Setting/AllowVgiftsFrom.pm     Sat Oct 30 11:45:56 2010 +0800
@@ -38,7 +38,7 @@ sub option {
     my $allowed = $class->get_arg( $args, "allowvgiftsfrom" )
                || $u->prop( 'opt_allowvgiftsfrom' ) || 'all';
     my $anonopt = $class->get_arg( $args, "anonvgift_optout" )
-               || $u->prop( 'opt_anonvgift_optout' ) || 0;
+               || ! $u->prop( 'opt_anonvgift_optout' );
 
     my %menu_items = (
         all         => [ qw( all a ) ],
@@ -79,7 +79,6 @@ sub option {
 
     $ret .= "<br />\n";
     # anonymous optout
-    $ret .= '&nbsp;';
     $ret .= LJ::html_check( { name => "${key}anonvgift_optout",
                               id   => "${key}anonvgift_optout",
                               label => $class->ml( 
'setting.allowvgiftsfrom.anon' ),
@@ -105,7 +104,7 @@ sub save {
     my $anonopt = $class->get_arg( $args, "anonvgift_optout" );
 
     $u->set_prop( 'opt_allowvgiftsfrom' => $allowed ) if $allowed;
-    $u->set_prop( 'opt_anonvgift_optout' => $anonopt ? 1 : 0 );
+    $u->set_prop( 'opt_anonvgift_optout' => $anonopt ? 0 : 1 );
 
     return 1;
 }
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to