aboutsummaryrefslogtreecommitdiff
path: root/db/migrations
diff options
context:
space:
mode:
authorDavid Siegfried <david.siegfried@uni-vechta.de>2026-02-27 16:54:19 +0100
committerDavid Siegfried <david.siegfried@uni-vechta.de>2026-02-27 16:54:19 +0100
commitab8c6aee0e3df0565a56fc342c5107904935da2d (patch)
tree40cea85374999b0ecb0c6f6f75b790340c686f5b /db/migrations
parenta4a60be9c7e810d1e0d2ce0b7d4c8bba6ac89afc (diff)
extend file and folder logging, fixes #6251tic-6251
Diffstat (limited to 'db/migrations')
-rw-r--r--db/migrations/6.2.7_extend_file_logging.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/db/migrations/6.2.7_extend_file_logging.php b/db/migrations/6.2.7_extend_file_logging.php
new file mode 100644
index 0000000..a56bee2
--- /dev/null
+++ b/db/migrations/6.2.7_extend_file_logging.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * Description of class.
+ * Second line
+ */
+final class ExtendFileLogging extends Migration
+{
+ public function description()
+ {
+ return 'Extends the logging of files during upload and deletion';
+ }
+
+ public function up()
+ {
+ DBManager::get()->exec("UPDATE `log_actions` SET `info_template` = '%user löscht Datei %info (File-Id: %affected Range-Id: %coaffected)' WHERE `name` = 'FILE_DELETE'");
+ DBManager::get()->exec("UPDATE `log_actions` SET `info_template` = '%user löscht Ordner %info (Folder-Id: %affected Range-Id: %coaffected)' WHERE `name` = 'FOLDER_DELETE'");
+
+ DBManager::get()->exec("
+ INSERT IGNORE INTO `log_actions`
+ SET `action_id` = MD5('FILE_UPLOAD'),
+ `name` = 'FILE_UPLOAD',
+ `description` = 'Nutzer lädt Datei hoch',
+ `info_template` = '%user lädt Datei %info hoch (Folder-Id: %affected Range-Id: %coaffected)',
+ `active` = '1',
+ `expires` = '0'
+ ");
+
+ DBManager::get()->exec("
+ INSERT IGNORE INTO `log_actions`
+ SET `action_id` = MD5('FILE_UPDATE'),
+ `name` = 'FILE_UPDATE',
+ `description` = 'Nutzer ändert Datei',
+ `info_template` = '%user ändert Datei %info (Folder-Id: %affected Range-Id: %coaffected)',
+ `active` = '1',
+ `expires` = '0'
+ ");
+
+ DBManager::get()->exec("
+ INSERT IGNORE INTO `log_actions`
+ SET `action_id` = MD5('FOLDER_CREATE'),
+ `name` = 'FOLDER_CREATE',
+ `description` = 'Nutzer legt Ordner an',
+ `info_template` = '%user legt Ordner %info an (Range-Id: %coaffected)',
+ `active` = '1',
+ `expires` = '0'
+ ");
+ DBManager::get()->exec("
+ INSERT IGNORE INTO `log_actions`
+ SET `action_id` = MD5('FOLDER_UPDATE'),
+ `name` = 'FOLDER_UPDATE',
+ `description` = 'Nutzer aktualisiert Ordner',
+ `info_template` = '%user aktualisiert Ordner %info an (Range-Id: %coaffected)',
+ `active` = '1',
+ `expires` = '0'
+ ");
+ }
+
+ public function down()
+ {
+ DBManager::get()->exec("UPDATE `log_actions` SET `info_template` = '%user löscht Datei %info (File-Id: %affected)' WHERE `name` = 'FILE_DELETE'");
+ DBManager::get()->exec("UPDATE `log_actions` SET `info_template` = ' %user löscht Datei %info (Folder-Id: %affected)' WHERE `name` = 'FOLDER_DELETE'");
+ DBManager::get()->exec("DELETE FROM `log_actions` WHERE `name` = 'FILE_UPLOAD'");
+ DBManager::get()->exec("DELETE FROM `log_actions` WHERE `name` = 'FOLDER_CREATE'");
+ DBManager::get()->exec("DELETE FROM `log_actions` WHERE `name` = 'FILE_UPDATE'");
+ DBManager::get()->exec("DELETE FROM `log_actions` WHERE `name` = 'FOLDER_UPDATE'");
+ }
+}