From c839d528ccba551a42a01e954cccff8c3aadb829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 8 Jun 2013 16:28:40 +0200 Subject: [PATCH] Save time and issuer of suspensions --- file/lib/system/command/commands/BanCommand.class.php | 4 +++- file/lib/system/command/commands/GbanCommand.class.php | 4 +++- file/lib/system/command/commands/GmuteCommand.class.php | 4 +++- file/lib/system/command/commands/MuteCommand.class.php | 4 +++- install.sql | 3 +++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/file/lib/system/command/commands/BanCommand.class.php b/file/lib/system/command/commands/BanCommand.class.php index 8840110..f090dfa 100644 --- a/file/lib/system/command/commands/BanCommand.class.php +++ b/file/lib/system/command/commands/BanCommand.class.php @@ -30,7 +30,9 @@ public function executeAction() { 'userID' => $this->user->userID, 'roomID' => WCF::getUser()->chatRoomID, 'type' => suspension\Suspension::TYPE_BAN, - 'expires' => $this->expires + 'expires' => $this->expires, + 'time' => TIME_NOW, + 'issuer' => WCF::getUser()->userID ) )); $this->suspensionAction->executeAction(); diff --git a/file/lib/system/command/commands/GbanCommand.class.php b/file/lib/system/command/commands/GbanCommand.class.php index 33e2fd1..9cd3593 100644 --- a/file/lib/system/command/commands/GbanCommand.class.php +++ b/file/lib/system/command/commands/GbanCommand.class.php @@ -32,7 +32,9 @@ public function executeAction() { 'userID' => $this->user->userID, 'roomID' => null, 'type' => suspension\Suspension::TYPE_BAN, - 'expires' => $this->expires + 'expires' => $this->expires, + 'time' => TIME_NOW, + 'issuer' => WCF::getUser()->userID ) )); $this->suspensionAction->executeAction(); diff --git a/file/lib/system/command/commands/GmuteCommand.class.php b/file/lib/system/command/commands/GmuteCommand.class.php index d9aa485..e54a768 100644 --- a/file/lib/system/command/commands/GmuteCommand.class.php +++ b/file/lib/system/command/commands/GmuteCommand.class.php @@ -32,7 +32,9 @@ public function executeAction() { 'userID' => $this->user->userID, 'roomID' => null, 'type' => suspension\Suspension::TYPE_MUTE, - 'expires' => $this->expires + 'expires' => $this->expires, + 'time' => TIME_NOW, + 'issuer' => WCF::getUser()->userID ) )); $this->suspensionAction->executeAction(); diff --git a/file/lib/system/command/commands/MuteCommand.class.php b/file/lib/system/command/commands/MuteCommand.class.php index f6df4be..2055fe4 100644 --- a/file/lib/system/command/commands/MuteCommand.class.php +++ b/file/lib/system/command/commands/MuteCommand.class.php @@ -62,7 +62,9 @@ public function executeAction() { 'userID' => $this->user->userID, 'roomID' => WCF::getUser()->chatRoomID, 'type' => suspension\Suspension::TYPE_MUTE, - 'expires' => $this->expires + 'expires' => $this->expires, + 'time' => TIME_NOW, + 'issuer' => WCF::getUser()->userID ) )); $this->suspensionAction->executeAction(); diff --git a/install.sql b/install.sql index 7b05374..21148c7 100644 --- a/install.sql +++ b/install.sql @@ -48,6 +48,8 @@ CREATE TABLE chat1_suspension ( roomID INT(10) DEFAULT NULL, type TINYINT(3) NOT NULL, expires INT(10) NOT NULL, + time INT(10) NOT NULL, + issuer INT(10) DEFAULT NULL, UNIQUE KEY suspension (userID, roomID, type), KEY (roomID), @@ -70,6 +72,7 @@ ALTER TABLE chat1_room ADD FOREIGN KEY (owner) REFERENCES wcf1_user (userID) ON ALTER TABLE chat1_suspension ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE; ALTER TABLE chat1_suspension ADD FOREIGN KEY (roomID) REFERENCES chat1_room (roomID) ON DELETE CASCADE; +ALTER TABLE chat1_suspension ADD FOREIGN KEY (issuer) REFERENCES wcf1_user (userID) ON DELETE SET NULL; ALTER TABLE wcf1_user ADD FOREIGN KEY (chatRoomID) REFERENCES chat1_room (roomID) ON DELETE SET NULL;