fix csrf for clearing apcu/opcache cache
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
use Froxlor\FroxlorLogger;
|
use Froxlor\FroxlorLogger;
|
||||||
use Froxlor\UI\Panel\UI;
|
use Froxlor\UI\Panel\UI;
|
||||||
use Froxlor\UI\Response;
|
use Froxlor\UI\Response;
|
||||||
|
use Froxlor\UI\HTML;
|
||||||
|
|
||||||
const AREA = 'admin';
|
const AREA = 'admin';
|
||||||
require __DIR__ . '/lib/init.php';
|
require __DIR__ . '/lib/init.php';
|
||||||
@@ -41,6 +42,7 @@ require __DIR__ . '/lib/init.php';
|
|||||||
$horizontal_bar_size = 950; // 1280px window width
|
$horizontal_bar_size = 950; // 1280px window width
|
||||||
|
|
||||||
if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') {
|
if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') {
|
||||||
|
if ($_POST['send'] == 'send') {
|
||||||
apcu_clear_cache();
|
apcu_clear_cache();
|
||||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache");
|
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache");
|
||||||
header('Location: ' . $linker->getLink([
|
header('Location: ' . $linker->getLink([
|
||||||
@@ -48,6 +50,15 @@ if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['cha
|
|||||||
'page' => 'showinfo'
|
'page' => 'showinfo'
|
||||||
]));
|
]));
|
||||||
exit();
|
exit();
|
||||||
|
} else {
|
||||||
|
HTML::askYesNo('cache_reallydelete', $filename, [
|
||||||
|
'page' => $page,
|
||||||
|
'action' => 'delete',
|
||||||
|
], '', [
|
||||||
|
'section' => 'apcuinfo',
|
||||||
|
'page' => 'showinfo'
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('apcu_cache_info') || !function_exists('apcu_sma_info')) {
|
if (!function_exists('apcu_cache_info') || !function_exists('apcu_sma_info')) {
|
||||||
|
|||||||
@@ -35,8 +35,10 @@ require __DIR__ . '/lib/init.php';
|
|||||||
use Froxlor\FroxlorLogger;
|
use Froxlor\FroxlorLogger;
|
||||||
use Froxlor\UI\Panel\UI;
|
use Froxlor\UI\Panel\UI;
|
||||||
use Froxlor\UI\Response;
|
use Froxlor\UI\Response;
|
||||||
|
use Froxlor\UI\HTML;
|
||||||
|
|
||||||
if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') {
|
if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') {
|
||||||
|
if ($_POST['send'] == 'send') {
|
||||||
opcache_reset();
|
opcache_reset();
|
||||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
|
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
|
||||||
header('Location: ' . $linker->getLink([
|
header('Location: ' . $linker->getLink([
|
||||||
@@ -44,6 +46,15 @@ if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_
|
|||||||
'page' => 'showinfo'
|
'page' => 'showinfo'
|
||||||
]));
|
]));
|
||||||
exit();
|
exit();
|
||||||
|
} else {
|
||||||
|
HTML::askYesNo('cache_reallydelete', $filename, [
|
||||||
|
'page' => $page,
|
||||||
|
'action' => 'reset',
|
||||||
|
], '', [
|
||||||
|
'section' => 'opcacheinfo',
|
||||||
|
'page' => 'showinfo'
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('opcache_get_configuration')) {
|
if (!function_exists('opcache_get_configuration')) {
|
||||||
|
|||||||
@@ -1279,6 +1279,7 @@ Vielen Dank, Ihr Administrator',
|
|||||||
'apikey_reallyadd' => 'Einen neuen Api-Key erstellen?',
|
'apikey_reallyadd' => 'Einen neuen Api-Key erstellen?',
|
||||||
'dnsentry_reallydelete' => 'Wollen Sie den DNS-Eintrag wirklich löschen?',
|
'dnsentry_reallydelete' => 'Wollen Sie den DNS-Eintrag wirklich löschen?',
|
||||||
'certificate_reallydelete' => 'Wollen Sie diese Zertifikat wirklich löschen?',
|
'certificate_reallydelete' => 'Wollen Sie diese Zertifikat wirklich löschen?',
|
||||||
|
'cache_reallydelete' => 'Wollen Sie den Cache wirklich leeren?',
|
||||||
],
|
],
|
||||||
'serversettings' => [
|
'serversettings' => [
|
||||||
'session_timeout' => [
|
'session_timeout' => [
|
||||||
|
|||||||
@@ -1391,6 +1391,7 @@ Yours sincerely, your administrator',
|
|||||||
'apikey_reallyadd' => 'Do you really want to create a new api-key?',
|
'apikey_reallyadd' => 'Do you really want to create a new api-key?',
|
||||||
'dnsentry_reallydelete' => 'Do you really want to delete this zone entry?',
|
'dnsentry_reallydelete' => 'Do you really want to delete this zone entry?',
|
||||||
'certificate_reallydelete' => 'Do you really want to delete this certificate?',
|
'certificate_reallydelete' => 'Do you really want to delete this certificate?',
|
||||||
|
'cache_reallydelete' => 'Do you really want to clear the cache?',
|
||||||
],
|
],
|
||||||
'redirect_desc' => [
|
'redirect_desc' => [
|
||||||
'rc_default' => 'default',
|
'rc_default' => 'default',
|
||||||
|
|||||||
Reference in New Issue
Block a user