+ {
+ if ($banlen_w)
+ $duration .= $banlen_w;
+ if ($banlen_d)
+ $duration .= $banlen_d;
+ if ($banlen_h)
+ $duration .= $banlen_h;
+ }
+ $match_type = $_POST['matchtype']; // should default to 'simple'
+ $reason = isset($_POST['ban_reason']) ? $_POST['ban_reason'] : "No reason";
+ $soft = (isset($_POST['soft'])) ? true : false;
+ if ($soft)
+ $bantype = "soft-$bantype";
+ if ($rpc->spamfilter()->add($sf, $match_type, $targ_chars, $bantype, $duration, $reason))
+ Message::Success("Added spamfilter entry \"$sf\" [match type: $match_type] [targets: $targ_chars] [reason: $reason]");
+ else
+ Message::Fail("Could not add spamfilter entry \"$sf\" [match type: $match_type] [targets: $targ_chars] [reason: $reason]: $rpc->error");
+ }