From de597fcec0c31fd9ff5e65a80428e772950b9dc7 Mon Sep 17 00:00:00 2001 From: PT-ATA No One Date: Wed, 22 May 2024 12:05:23 +0200 Subject: [PATCH] Remove scan option ScanOnlyNewFiles --- lib/Settings/VaasAdmin.php | 2 +- src/admin-settings.js | 20 -------------------- templates/admin.php | 7 ------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/lib/Settings/VaasAdmin.php b/lib/Settings/VaasAdmin.php index 9aff3a47..82221288 100644 --- a/lib/Settings/VaasAdmin.php +++ b/lib/Settings/VaasAdmin.php @@ -29,7 +29,7 @@ public function getForm(): TemplateResponse 'vaasUrl' => $this->config->getAppValue(self::APP_ID, 'vaasUrl', 'wss://gateway.staging.vaas.gdatasecurity.de'), 'quarantineFolder' => $this->config->getAppValue(self::APP_ID, 'quarantineFolder', 'Quarantine'), 'autoScanFiles' => $this->config->getAppValue(self::APP_ID, 'autoScanFiles', false), - 'scanOnlyNewFiles' => $this->config->getAppValue(self::APP_ID, 'scanOnlyNewFiles', false), + 'scanOnlyNewFiles' => $this->config->getAppValue(self::APP_ID, 'scanOnlyNewFiles', true), 'prefixMalicious' => $this->config->getAppValue(self::APP_ID, 'prefixMalicious', true), 'disableUnscannedTag' => $this->config->getAppValue(self::APP_ID, 'disableUnscannedTag', false), 'allowlist' => $this->config->getAppValue(self::APP_ID, 'allowlist'), diff --git a/src/admin-settings.js b/src/admin-settings.js index 8b1c8dae..d5eec5f0 100644 --- a/src/admin-settings.js +++ b/src/admin-settings.js @@ -27,7 +27,6 @@ document.addEventListener('DOMContentLoaded', async () => { const authSubmitAdvanced = document.querySelector('#auth_submit_advanced'); const resetAllTags = document.querySelector('#reset'); const autoScanFiles = document.querySelector('#auto_scan_files'); - const scanOnlyNew = document.querySelector('#scan_only_new'); const prefixMalicious = document.querySelector('#prefixMalicious'); const authMethod = document.querySelector('#authMethod'); const disableUnscannedTag = document.querySelector('#disable_tag_unscanned'); @@ -94,10 +93,6 @@ document.addEventListener('DOMContentLoaded', async () => { await toggleAutoScan(autoScanFiles.checked); }); - scanOnlyNew.addEventListener('click', async () => { - await toggleScanOnlyNew(scanOnlyNew.checked); - }); - prefixMalicious.addEventListener('click', async () => { await postData(OC.generateUrl('apps/gdatavaas/setPrefixMalicious'), {prefixMalicious: prefixMalicious.checked}); }); @@ -106,21 +101,10 @@ document.addEventListener('DOMContentLoaded', async () => { await postData(OC.generateUrl('apps/gdatavaas/setDisableUnscannedTag'), {disableUnscannedTag: disableUnscannedTag.checked}); }); - // Activate or deactivate scanning only for new files - const toggleScanOnlyNew = async (enable) => { - scanOnlyNew.checked = enable; - scanOnlyNew.disabled = !autoScanFiles.checked; - const response = await postData(OC.generateUrl('apps/gdatavaas/setScanOnlyNewFiles'), {scanOnlyNewFiles: enable}); - if (response.status !== "success") { - OC.Notification.showTemporary(`An Error occurred when ${enable ? 'activating' : 'deactivating'} scanning only for new files.`); - } - }; - // Activate or deactivate automatic file scanning const toggleAutoScan = async (enable) => { autoScanFiles.checked = enable; const response = await postData(OC.generateUrl('apps/gdatavaas/setAutoScan'), {autoScanFiles: enable}); - await toggleScanOnlyNew(enable); if (response.status !== "success") { OC.Notification.showTemporary(`An Error occurred when ${enable ? 'activating' : 'deactivating'} automatic file scanning.`); } @@ -130,12 +114,8 @@ document.addEventListener('DOMContentLoaded', async () => { const autoScanResponse = await getData(OC.generateUrl('apps/gdatavaas/getAutoScan')); if (autoScanResponse.status) { autoScanFiles.checked = true; - scanOnlyNew.disabled = false; - const scanOnlyNewResponse = await getData(OC.generateUrl('apps/gdatavaas/getScanOnlyNewFiles')); - scanOnlyNew.checked = scanOnlyNewResponse.status; } else { autoScanFiles.checked = false; - await toggleScanOnlyNew(false); } prefixMalicious.checked = (await getData(OC.generateUrl('apps/gdatavaas/getPrefixMalicious'))).status; disableUnscannedTag.checked = (await getData(OC.generateUrl('apps/gdatavaas/getDisableUnscannedTag'))).status; diff --git a/templates/admin.php b/templates/admin.php index 7b2144f7..83e3bd9a 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -92,13 +92,6 @@ - - - - - -
-