Show renamed topic actions in log actions (#860)

This commit is contained in:
Roman Kelesidis 2023-08-22 01:05:39 +07:00 committed by GitHub
commit 597c192cc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 10 deletions

View file

@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
die(basename(__FILE__));
}
global $userdata, $bb_cfg, $lang, $datastore;
global $userdata, $bb_cfg, $lang, $datastore, $log_action;
$mode = (string)$this->request['mode'];
@ -36,8 +36,8 @@ switch ($mode) {
case 'edit_topic_title':
$topic_id = (int)$this->request['topic_id'];
$topic_title = (string)$this->request['topic_title'];
$new_title = clean_title($topic_title);
$old_title = get_topic_title($topic_id);
$new_title = clean_title((string)$this->request['topic_title']);
if (!$topic_id) {
$this->ajax_die($lang['INVALID_TOPIC_ID']);
@ -68,6 +68,14 @@ switch ($mode) {
$datastore->update('network_news');
}
// Log action
$log_action->mod('mod_topic_renamed', array(
'forum_id' => $t_data['forum_id'],
'topic_id' => $topic_id,
'topic_title' => $old_title,
'topic_title_new' => $new_title,
));
$this->response['topic_id'] = $topic_id;
$this->response['topic_title'] = $new_title;
break;