summaryrefslogtreecommitdiff
path: root/inc/filters.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-07-28 04:09:01 +0200
committerczaks <marcin@6irc.net>2014-07-28 04:09:01 +0200
commit50091e28a978d8244520156272fdb2ef4b792e70 (patch)
treece298bc321d33557e8d49400b2dcc5cddb29f136 /inc/filters.php
parenta940ee9abb572aaa5118f3d0256ec7b3379de176 (diff)
allow the previous not only for ban action, but also for reject action, or a nul one
Diffstat (limited to 'inc/filters.php')
-rw-r--r--inc/filters.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/inc/filters.php b/inc/filters.php
index fd442fd9..0117853f 100644
--- a/inc/filters.php
+++ b/inc/filters.php
@@ -117,6 +117,16 @@ class Filter {
public function action() {
global $board;
+
+ $this->add_note = isset($this->add_note) ? $this->add_note : false;
+ if ($this->add_note) {
+ $query = prepare('INSERT INTO ``ip_notes`` VALUES (NULL, :ip, :mod, :time, :body)');
+ $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
+ $query->bindValue(':mod', -1);
+ $query->bindValue(':time', time());
+ $query->bindValue(':body', "Autoban message: ".$this->post['body']);
+ $query->execute() or error(db_error($query));
+ }
switch($this->action) {
case 'reject':
@@ -128,19 +138,9 @@ class Filter {
$this->expires = isset($this->expires) ? $this->expires : false;
$this->reject = isset($this->reject) ? $this->reject : true;
$this->all_boards = isset($this->all_boards) ? $this->all_boards : false;
- $this->add_note = isset($this->add_note) ? $this->add_note : false;
Bans::new_ban($_SERVER['REMOTE_ADDR'], $this->reason, $this->expires, $this->all_boards ? false : $board['uri'], -1);
- if ($this->add_note) {
- $query = prepare('INSERT INTO ``ip_notes`` VALUES (NULL, :ip, :mod, :time, :body)');
- $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
- $query->bindValue(':mod', -1);
- $query->bindValue(':time', time());
- $query->bindValue(':body', "Autoban message: ".$this->post['body']);
- $query->execute() or error(db_error($query));
- }
-
if ($this->reject) {
if (isset($this->message))
error($message);