diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-05-30 23:13:00 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-05-30 23:13:00 +0200 |
commit | 40218ba5e6597d0ea83fe154259f72ff8d8190c0 (patch) | |
tree | e11c3d0ddd49f7d225a8599f2e73731af9ae2dc4 /phpBB/includes/acp/acp_logs.php | |
parent | be52ea882ad55af8bd8a59814b11488025fb3563 (diff) | |
parent | 4b3bba6693d96fe5ce918a635af8ff5ec7a8c1f0 (diff) | |
download | forums-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/acp/acp_logs.php')
-rw-r--r-- | phpBB/includes/acp/acp_logs.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 4322cd006d..6b7ed1d269 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -54,7 +54,7 @@ class acp_logs { if (confirm_box(true)) { - $where_sql = ''; + $conditions = array(); if ($deletemark && sizeof($marked)) { @@ -63,19 +63,25 @@ class acp_logs { $sql_in[] = $mark; } - $where_sql = ' AND ' . $db->sql_in_set('log_id', $sql_in); + $conditions['log_id'] = $sql_in; unset($sql_in); } - if ($where_sql || $deleteall) + if ($deleteall) { - $sql = 'DELETE FROM ' . LOG_TABLE . " - WHERE log_type = {$this->log_type} - $where_sql"; - $db->sql_query($sql); + if ($sort_days) + { + $conditions['log_time'] = array('>=', time() - ($sort_days * 86400)); + } - add_log('admin', 'LOG_CLEAR_' . strtoupper($mode)); + $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $conditions['keywords'] = $keywords; } + + $conditions['log_type'] = $this->log_type; + + $phpbb_log = $phpbb_container->get('log'); + $phpbb_log->delete($mode, $conditions); } else { |