From 9d5fd03a455cdadf22adc5021d4da00e96126183 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 5 Jun 2023 18:57:24 +0700 Subject: [PATCH] Revert "Added clear logs option in admin panel (#775)" This reverts commit 88cf205962dbc13827169f239169f3fc1b5a1bd0. --- common.php | 16 ----------- library/ajax/manage_admin.php | 6 ---- library/language/source/main.php | 4 +-- styles/templates/admin/index.tpl | 49 +++++++++++++++----------------- 4 files changed, 24 insertions(+), 51 deletions(-) diff --git a/common.php b/common.php index 6541d8400..66c689206 100644 --- a/common.php +++ b/common.php @@ -211,22 +211,6 @@ function bb_log($msg, $file_name, $return_path = false) return file_write($msg, $path); } -/** - * Remove files recursively by extension - * - * @param string $path - * @param array $findExtension - * @return void - */ -function remove_files_by_extension(string $path, array $findExtension) -{ - foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $file) { - if (in_array(pathinfo($file, PATHINFO_EXTENSION), $findExtension) && is_file($file)) { - unlink($file); - } - } -} - function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replace_content = false) { $bytes_written = false; diff --git a/library/ajax/manage_admin.php b/library/ajax/manage_admin.php index 76e866fd8..486b467a4 100644 --- a/library/ajax/manage_admin.php +++ b/library/ajax/manage_admin.php @@ -16,12 +16,6 @@ global $userdata, $lang, $bb_cfg; $mode = (string)$this->request['mode']; switch ($mode) { - case 'clear_logs': - remove_files_by_extension(LOG_DIR, ['log']); - - $this->response['logs_html'] = '' . $lang['ALL_LOGS_FILE_CLEARED'] . ''; - break; - case 'clear_cache': foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) { if (!in_array('db_sqlite', $cache_val)) { diff --git a/library/language/source/main.php b/library/language/source/main.php index a03f1b20a..e69af09ff 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -101,7 +101,6 @@ $lang['CLICK_RETURN_GROUP'] = 'Click %sHere%s to return to group information'; $lang['ADMIN_PANEL'] = 'Go to Administration Panel'; $lang['ALL_CACHE_CLEARED'] = 'Cache has been cleared'; -$lang['ALL_LOGS_FILE_CLEARED'] = 'Log files has been removed'; $lang['ALL_TEMPLATE_CLEARED'] = 'Template cache has been cleared'; $lang['DATASTORE_CLEARED'] = 'Datastore has been cleared'; $lang['BOARD_DISABLE'] = 'Sorry, this forum is disabled. Try to come back later'; @@ -1646,8 +1645,7 @@ $lang['NOT_AVAILABLE'] = 'Not available'; // Clear Cache $lang['DATASTORE'] = 'Datastore'; -$lang['CLEAR_CACHE'] = 'Cache'; -$lang['CLEAR_LOGS'] = 'Log files'; +$lang['CLEAR_CACHE'] = 'Clear Cache'; $lang['CLEAR_TEMPLATES_CACHE'] = 'Templates cache'; // Update diff --git a/styles/templates/admin/index.tpl b/styles/templates/admin/index.tpl index 932897db4..f62031925 100644 --- a/styles/templates/admin/index.tpl +++ b/styles/templates/admin/index.tpl @@ -65,24 +65,23 @@
@@ -107,14 +106,12 @@ - - + +
{L_CLEAR}: - {L_DATASTORE} · - {L_CLEAR_CACHE} · - {L_CLEAR_TEMPLATES_CACHE} · - {L_CLEAR_LOGS} - {L_CLEAR}: + {L_DATASTORE} · + {L_CLEAR_CACHE} · + {L_CLEAR_TEMPLATES_CACHE} +
{L_UPDATE}: