mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2010-01-05 10:44 pm

[dw-free] single IP query for spam sysbans

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

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

Add ability to query a single value for sysban status.

Patch by [personal profile] afuna.

Files modified:
  • htdocs/admin/sysban.bml
--------------------------------------------------------------------------------
diff -r a287fe71fadf -r a4e4f69edca5 htdocs/admin/sysban.bml
--- a/htdocs/admin/sysban.bml	Tue Jan 05 22:38:23 2010 +0000
+++ b/htdocs/admin/sysban.bml	Tue Jan 05 22:44:53 2010 +0000
@@ -56,6 +56,7 @@ body<=
 
     my $action;
     if    ( $POST{'query'} )  { $action = 'query'; }
+    elsif ( $POST{queryone} ) { $action = 'queryone'; }
     elsif ( $POST{'addnew'} ) { $action = 'addnew'; }
     elsif ( $POST{'add'} )    { $action = 'add'; }
     elsif ( $POST{'modify'} ) { $action = 'modify'; }
@@ -73,7 +74,8 @@ body<=
 </select>
 <input type='submit' name='addnew' value='Add New'>
 <input type='submit' name='query' value='Query'>
-
+<br /><br />
+<input type='text' name='queryvalue' /> <input type='submit' name='queryone' value='Query This Value' />
 </form>
 FORM
 
@@ -130,6 +132,17 @@ QUERYFORM
         }
         $ret .= "</table>";
 
+    }
+
+    elsif ( $action eq "queryone" ) {
+        return $err->("Requires post") unless LJ::did_post();
+        return $err->("Invalid form") unless LJ::check_form_auth();
+
+        my $bantype = $POST{bantype};
+        my $banquery = $POST{queryvalue};
+
+        $ret .= "<br />" . LJ::ehtml( $bantype ) . ": " .  LJ::ehtml( $banquery );
+        $ret .= LJ::sysban_check( $bantype, $banquery ) ?  " is sysbanned."  : " is not sysbanned.";
     }
 
     # this action comes from the query section
--------------------------------------------------------------------------------