mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Revert "Added clear logs option in admin panel (#775)"
This reverts commit 88cf205962
.
This commit is contained in:
parent
88cf205962
commit
9d5fd03a45
4 changed files with 24 additions and 51 deletions
16
common.php
16
common.php
|
@ -211,22 +211,6 @@ function bb_log($msg, $file_name, $return_path = false)
|
||||||
return file_write($msg, $path);
|
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)
|
function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replace_content = false)
|
||||||
{
|
{
|
||||||
$bytes_written = false;
|
$bytes_written = false;
|
||||||
|
|
|
@ -16,12 +16,6 @@ global $userdata, $lang, $bb_cfg;
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case 'clear_logs':
|
|
||||||
remove_files_by_extension(LOG_DIR, ['log']);
|
|
||||||
|
|
||||||
$this->response['logs_html'] = '<span class="seed bold">' . $lang['ALL_LOGS_FILE_CLEARED'] . '</span>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'clear_cache':
|
case 'clear_cache':
|
||||||
foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) {
|
foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) {
|
||||||
if (!in_array('db_sqlite', $cache_val)) {
|
if (!in_array('db_sqlite', $cache_val)) {
|
||||||
|
|
|
@ -101,7 +101,6 @@ $lang['CLICK_RETURN_GROUP'] = 'Click %sHere%s to return to group information';
|
||||||
|
|
||||||
$lang['ADMIN_PANEL'] = 'Go to Administration Panel';
|
$lang['ADMIN_PANEL'] = 'Go to Administration Panel';
|
||||||
$lang['ALL_CACHE_CLEARED'] = 'Cache has been cleared';
|
$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['ALL_TEMPLATE_CLEARED'] = 'Template cache has been cleared';
|
||||||
$lang['DATASTORE_CLEARED'] = 'Datastore has been cleared';
|
$lang['DATASTORE_CLEARED'] = 'Datastore has been cleared';
|
||||||
$lang['BOARD_DISABLE'] = 'Sorry, this forum is disabled. Try to come back later';
|
$lang['BOARD_DISABLE'] = 'Sorry, this forum is disabled. Try to come back later';
|
||||||
|
@ -1646,8 +1645,7 @@ $lang['NOT_AVAILABLE'] = 'Not available';
|
||||||
|
|
||||||
// Clear Cache
|
// Clear Cache
|
||||||
$lang['DATASTORE'] = 'Datastore';
|
$lang['DATASTORE'] = 'Datastore';
|
||||||
$lang['CLEAR_CACHE'] = 'Cache';
|
$lang['CLEAR_CACHE'] = 'Clear Cache';
|
||||||
$lang['CLEAR_LOGS'] = 'Log files';
|
|
||||||
$lang['CLEAR_TEMPLATES_CACHE'] = 'Templates cache';
|
$lang['CLEAR_TEMPLATES_CACHE'] = 'Templates cache';
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
|
|
|
@ -65,24 +65,23 @@
|
||||||
<!-- IF TPL_ADMIN_MAIN -->
|
<!-- IF TPL_ADMIN_MAIN -->
|
||||||
<!--========================================================================-->
|
<!--========================================================================-->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
ajax.manage_admin = function (mode) {
|
ajax.manage_admin = function (mode) {
|
||||||
ajax.exec({
|
ajax.exec({
|
||||||
action: 'manage_admin',
|
action: 'manage_admin',
|
||||||
mode: mode,
|
mode: mode,
|
||||||
user_id: ''
|
user_id: ''
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ajax.callback.manage_admin = function (data) {
|
ajax.callback.manage_admin = function (data) {
|
||||||
$('#cache').html(data.cache_html);
|
$('#cache').html(data.cache_html);
|
||||||
$('#datastore').html(data.datastore_html);
|
$('#datastore').html(data.datastore_html);
|
||||||
$('#logs').html(data.logs_html);
|
$('#indexer').html(data.indexer_html);
|
||||||
$('#indexer').html(data.indexer_html);
|
$('#template_cache').html(data.template_cache_html);
|
||||||
$('#template_cache').html(data.template_cache_html);
|
$('#update_user_level').html(data.update_user_level_html);
|
||||||
$('#update_user_level').html(data.update_user_level_html);
|
$('#sync_topics').html(data.sync_topics_html);
|
||||||
$('#sync_topics').html(data.sync_topics_html);
|
$('#sync_user_posts').html(data.sync_user_posts_html);
|
||||||
$('#sync_user_posts').html(data.sync_user_posts_html);
|
$('#unlock_cron').html(data.unlock_cron_html);
|
||||||
$('#unlock_cron').html(data.unlock_cron_html);
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -107,14 +106,12 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>{L_CLEAR}:</b></td>
|
<td><b>{L_CLEAR}:</b></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" id="datastore" onclick="ajax.manage_admin('clear_datastore'); return false;">{L_DATASTORE}</a> ·
|
<a href="#" id="datastore" onclick="ajax.manage_admin('clear_datastore'); return false;">{L_DATASTORE}</a> ·
|
||||||
<a href="#" id="cache" onclick="ajax.manage_admin('clear_cache'); return false;">{L_CLEAR_CACHE}</a> ·
|
<a href="#" id="cache" onclick="ajax.manage_admin('clear_cache'); return false;">{L_CLEAR_CACHE}</a> ·
|
||||||
<a href="#" id="template_cache"
|
<a href="#" id="template_cache" onclick="ajax.manage_admin('clear_template_cache'); return false;">{L_CLEAR_TEMPLATES_CACHE}</a>
|
||||||
onclick="ajax.manage_admin('clear_template_cache'); return false;">{L_CLEAR_TEMPLATES_CACHE}</a> ·
|
</td>
|
||||||
<a href="#" id="logs" onclick="ajax.manage_admin('clear_logs'); return false;">{L_CLEAR_LOGS}</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>{L_UPDATE}:</b></td>
|
<td><b>{L_UPDATE}:</b></td>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue