aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_logs.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-05-30 23:13:00 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-05-30 23:13:00 +0200
commit40218ba5e6597d0ea83fe154259f72ff8d8190c0 (patch)
treee11c3d0ddd49f7d225a8599f2e73731af9ae2dc4 /phpBB/includes/mcp/mcp_logs.php
parentbe52ea882ad55af8bd8a59814b11488025fb3563 (diff)
parent4b3bba6693d96fe5ce918a635af8ff5ec7a8c1f0 (diff)
downloadforums-40218ba5e6597d0ea83fe154259f72ff8d8190c0.tar
forums-40218ba5e6597d0ea83fe154259f72ff8d8190c0.tar.gz
forums-40218ba5e6597d0ea83fe154259f72ff8d8190c0.tar.bz2
forums-40218ba5e6597d0ea83fe154259f72ff8d8190c0.tar.xz
forums-40218ba5e6597d0ea83fe154259f72ff8d8190c0.zip
Merge pull request #2433 from Nicofuma/ticket/10899
[ticket/10899] Using Delete All in log viewer with keyword search * Nicofuma/ticket/10899: [ticket/10899] Update doc block [ticket/10899] Use isset($field_value['IN']) [ticket/10899] Add event core.delete_log [ticket/10899] Remove trailing ; [ticket/10899] Fix typo in the class name [ticket/10899] Add unit tests [ticket/10899] Get $phpbb_log from the container [ticket/10899] Remove extra ';' [ticket/10899] Typo [ticket/10899] Refactoring in \phpbb\log\log_interface [ticket/10899] Using Delete All in log viewer with keyword search
Diffstat (limited to 'phpBB/includes/mcp/mcp_logs.php')
-rw-r--r--phpBB/includes/mcp/mcp_logs.php34
1 files changed, 21 insertions, 13 deletions
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index c55f56ae0c..a0c1bc02ec 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -36,7 +36,7 @@ class mcp_logs
function main($id, $mode)
{
global $auth, $db, $user, $template;
- global $config, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log;
$user->add_lang('acp/common');
@@ -114,27 +114,35 @@ class mcp_logs
{
if ($deletemark && sizeof($marked))
{
- $sql = 'DELETE FROM ' . LOG_TABLE . '
- WHERE log_type = ' . LOG_MOD . '
- AND ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND ' . $db->sql_in_set('log_id', $marked);
- $db->sql_query($sql);
+ $conditions = array(
+ 'log_type' => LOG_MOD,
+ 'forum_id' => $forum_list,
+ 'log_id' => $marked,
+ );
- add_log('admin', 'LOG_CLEAR_MOD');
+ $phpbb_log->delete('mod', $conditions);
}
else if ($deleteall)
{
- $sql = 'DELETE FROM ' . LOG_TABLE . '
- WHERE log_type = ' . LOG_MOD . '
- AND ' . $db->sql_in_set('forum_id', $forum_list);
+ $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+
+ $conditions = array(
+ 'log_type' => LOG_MOD,
+ 'forum_id' => $forum_list,
+ 'keywords' => $keywords,
+ );
+
+ if ($sort_days)
+ {
+ $conditions['log_time'] = array('>=', time() - ($sort_days * 86400));
+ }
if ($mode == 'topic_logs')
{
- $sql .= ' AND topic_id = ' . $topic_id;
+ $conditions['topic_logs'] = $topic_id;
}
- $db->sql_query($sql);
- add_log('admin', 'LOG_CLEAR_MOD');
+ $phpbb_log->delete('mod', $conditions);
}
}
else