diff options
| author | Felix Pahlow <felix.pahlow@itz.uni-halle.de> | 2023-07-15 17:39:27 +0200 |
|---|---|---|
| committer | Felix Pahlow <felix.pahlow@itz.uni-halle.de> | 2023-07-15 17:39:27 +0200 |
| commit | 095694c3bc0dfbf453119fe9d6a559f1caf2c1a8 (patch) | |
| tree | 0e0dacea073b2e6258fdeee9fe535545a16e7d26 /db | |
| parent | 3dbf5956b10dc6a3a00e945b04530894c0909253 (diff) | |
add unlock log action, closes #2865biest-2865-2
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrations/5.4.13_add_unlock_action.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/db/migrations/5.4.13_add_unlock_action.php b/db/migrations/5.4.13_add_unlock_action.php new file mode 100644 index 0000000..d3834a1 --- /dev/null +++ b/db/migrations/5.4.13_add_unlock_action.php @@ -0,0 +1,33 @@ +<?php + +final class AddUnlockAction extends Migration +{ + public function description() + { + return 'add an unlock action'; + } + + public function up() + { + DBManager::get()->exec(" + INSERT IGNORE INTO `log_actions` + SET `action_id` = MD5('USER_UNLOCK'), + `name` = 'USER_UNLOCK', + `description` = 'Nutzer wird entsperrt', + `info_template` = '%user entsperrt %user(%affected) (%info)', + `active` = '1', + `expires` = '0' + "); + } + + public function down() + { + $actions = ['USER_UNLOCK']; + + DBManager::get()->execute( + "DELETE `log_events` FROM `log_events` JOIN `log_actions` USING (`action_id`) WHERE `name` IN (?)", + [$actions] + ); + DBManager::get()->execute("DELETE FROM `log_actions` WHERE `name` IN (?)", [$actions]); + } +} |
