Log keyword deletion

This commit is contained in:
Trevor Slocum 2021-04-10 10:25:23 -07:00
parent f80e4d3917
commit 7072ab2060
2 changed files with 15 additions and 10 deletions

View File

@ -793,7 +793,13 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name'])
$text .= manageInfo(__('Keyword added.')); $text .= manageInfo(__('Keyword added.'));
} }
} elseif (isset($_GET['deletekeyword'])) { } elseif (isset($_GET['deletekeyword'])) {
$keyword = keywordByID($_GET['deletekeyword']);
if (empty($keyword)) {
fancyDie(__('That keyword does not exist.'));
}
deleteKeyword($_GET['deletekeyword']); deleteKeyword($_GET['deletekeyword']);
manageLogAction(sprintf(__('Deleted keyword %s'), htmlentities($keyword['text'])));
$text .= manageInfo(__('Keyword deleted.')); $text .= manageInfo(__('Keyword deleted.'));
} }
@ -895,7 +901,7 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name'])
threadUpdated($post['parent']); threadUpdated($post['parent']);
} }
manageLogAction(__('Deleted') . ' >>' . $post['id']); manageLogAction(__('Deleted') . ' >>' . $post['id']);
$text .= manageInfo(sprintf(__('Post No.%d deleted.'), $post['id'])); $text .= manageInfo(sprintf(__('Post No.%d deleted.'), $post['id']));
} else { } else {
fancyDie(__("Sorry, there doesn't appear to be a post with that ID.")); fancyDie(__("Sorry, there doesn't appear to be a post with that ID."));
@ -966,7 +972,7 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name'])
if ($post) { if ($post) {
deleteReportsByPost($post['id']); deleteReportsByPost($post['id']);
manageLogAction(sprintf(__('Cleared reports for post %s'), postLink('>>' . $post['id']))); manageLogAction(sprintf(__('Cleared reports for %s'), postLink('>>' . $post['id'])));
$text .= manageInfo(__('Reports cleared.')); $text .= manageInfo(__('Reports cleared.'));
} else { } else {
fancyDie(__("Sorry, there doesn't appear to be a post with that ID.")); fancyDie(__("Sorry, there doesn't appear to be a post with that ID."));

View File

@ -818,18 +818,17 @@ EOF;
function manageOnLoad($page) { function manageOnLoad($page) {
switch ($page) { switch ($page) {
case 'login':
return ' onload="document.tinyib.username.focus();"';
case 'moderate':
return ' onload="document.tinyib.moderate.focus();"';
case 'keywords':
return ' onload="document.tinyib.text.focus();"';
case 'rawpost':
return ' onload="document.tinyib.message.focus();"';
case 'accounts': case 'accounts':
case 'login':
return ' onload="document.tinyib.username.focus();"'; return ' onload="document.tinyib.username.focus();"';
case 'bans': case 'bans':
return ' onload="document.tinyib.ip.focus();"'; return ' onload="document.tinyib.ip.focus();"';
case 'keywords':
return ' onload="document.tinyib.text.focus();"';
case 'moderate':
return ' onload="document.tinyib.moderate.focus();"';
case 'rawpost':
return ' onload="document.tinyib.message.focus();"';
} }
} }