diff --git a/admin_apcuinfo.php b/admin_apcuinfo.php index cc6046ea9..aba028071 100644 --- a/admin_apcuinfo.php +++ b/admin_apcuinfo.php @@ -34,6 +34,7 @@ use Froxlor\FroxlorLogger; use Froxlor\UI\Panel\UI; use Froxlor\UI\Response; +use Froxlor\UI\HTML; const AREA = 'admin'; require __DIR__ . '/lib/init.php'; @@ -41,13 +42,23 @@ $horizontal_bar_size = 950; // 1280px window width if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') { - apcu_clear_cache(); - $log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache"); - header('Location: ' . $linker->getLink([ + if ($_POST['send'] == 'send') { + apcu_clear_cache(); + $log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache"); + header('Location: ' . $linker->getLink([ + 'section' => 'apcuinfo', + 'page' => 'showinfo' + ])); + exit(); + } else { + HTML::askYesNo('cache_reallydelete', $filename, [ + 'page' => $page, + 'action' => 'delete', + ], '', [ 'section' => 'apcuinfo', 'page' => 'showinfo' - ])); - exit(); + ]); + } } if (!function_exists('apcu_cache_info') || !function_exists('apcu_sma_info')) { diff --git a/admin_opcacheinfo.php b/admin_opcacheinfo.php index 37d3f5414..5c6608587 100644 --- a/admin_opcacheinfo.php +++ b/admin_opcacheinfo.php @@ -35,15 +35,26 @@ use Froxlor\FroxlorLogger; use Froxlor\UI\Panel\UI; use Froxlor\UI\Response; +use Froxlor\UI\HTML; if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') { - opcache_reset(); - $log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache"); - header('Location: ' . $linker->getLink([ + if ($_POST['send'] == 'send') { + opcache_reset(); + $log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache"); + header('Location: ' . $linker->getLink([ + 'section' => 'opcacheinfo', + 'page' => 'showinfo' + ])); + exit(); + } else { + HTML::askYesNo('cache_reallydelete', $filename, [ + 'page' => $page, + 'action' => 'reset', + ], '', [ 'section' => 'opcacheinfo', 'page' => 'showinfo' - ])); - exit(); + ]); + } } if (!function_exists('opcache_get_configuration')) { diff --git a/lng/de.lng.php b/lng/de.lng.php index 468e1b5c8..56b0dafaa 100644 --- a/lng/de.lng.php +++ b/lng/de.lng.php @@ -1279,6 +1279,7 @@ 'apikey_reallyadd' => 'Einen neuen Api-Key erstellen?', 'dnsentry_reallydelete' => 'Wollen Sie den DNS-Eintrag wirklich löschen?', 'certificate_reallydelete' => 'Wollen Sie diese Zertifikat wirklich löschen?', + 'cache_reallydelete' => 'Wollen Sie den Cache wirklich leeren?', ], 'serversettings' => [ 'session_timeout' => [ diff --git a/lng/en.lng.php b/lng/en.lng.php index 952e6177e..7e3c87a1f 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -1391,6 +1391,7 @@ 'apikey_reallyadd' => 'Do you really want to create a new api-key?', 'dnsentry_reallydelete' => 'Do you really want to delete this zone entry?', 'certificate_reallydelete' => 'Do you really want to delete this certificate?', + 'cache_reallydelete' => 'Do you really want to clear the cache?', ], 'redirect_desc' => [ 'rc_default' => 'default',