fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-03-11 05:56 am

[dw-free] Customizable sysban notes for Spam Reports (open)

[commit: http://hg.dwscoalition.org/dw-free/rev/c53761b35d31]

http://bugs.dwscoalition.org/show_bug.cgi?id=3082

Add sysban notes for banning IP addresses.

Patch by [personal profile] exor674.

Files modified:
  • htdocs/admin/spamreports.bml
--------------------------------------------------------------------------------
diff -r c6ff7859a2b7 -r c53761b35d31 htdocs/admin/spamreports.bml
--- a/htdocs/admin/spamreports.bml	Fri Mar 11 11:42:18 2011 +0800
+++ b/htdocs/admin/spamreports.bml	Fri Mar 11 13:55:58 2011 +0800
@@ -227,8 +227,12 @@ _c?>
         # add quick sysban links for ease
         my $extra = "";
         if ($by eq "ip") {
-            if (LJ::sysban_check("talk_ip_test", $what)) {
+            my $reason = LJ::sysban_populate_full_by_value( $what, 'talk_ip_test' );
+            if ( $reason && $reason->{talk_ip_test} ) {
                 $extra = "<strong>Already talk_ip_test banned</strong>";
+                if ( $remote->has_priv( 'sysban' ) ) {
+                    $extra .= "<br/><textarea name='sysban_note' rows='3' cols='60' readonly='1'>" . ( $reason->{talk_ip_test}->{note} || "(no note)" ) . "</textarea>";
+                }
             } else {
                 $extra = LJ::html_check({name => "sysban_ip", value => $what, label => "Also Sysban IP?"});
                 $extra .= "<br/><textarea name='sysban_note' rows='3' cols='60'> ~" . $remote->username . " @ " . LJ::mysql_time() . "</textarea>";
--------------------------------------------------------------------------------