From 21504bc0b5c11cff593c29fd2b2a09b8e0709106 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 16 Apr 2025 20:02:57 +0000 Subject: [PATCH 01/12] chore(deps): update dependency eslint-plugin-vue to v10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a23693..b94a22b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "css-loader": "^7.1.2", "eslint": "^9.19.0", "eslint-config-prettier": "^10.0.1", - "eslint-plugin-vue": "^9.32.0", + "eslint-plugin-vue": "^10.0.0", "file-loader": "^6.2.0", "mini-css-extract-plugin": "^2.9.1", "postcss-loader": "^8.1.1", From 7b4b447754342e0bcc6415d9b73543cb6a471a12 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 17 Apr 2025 00:02:47 +0200 Subject: [PATCH 02/12] fix(StandardMenu): appLimit must return a value > 0 --- CHANGELOG.md | 4 ++++ src/menus/StandardMenu.vue | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54b00a9..bac4b5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +## 5.0.1 +### Fixed +* fix(StandardMenu): appLimit must return a value > 0 + ## 5.0.0 ### Fixed * fix apps's order in the standard menu diff --git a/src/menus/StandardMenu.vue b/src/menus/StandardMenu.vue index 5e817ee..fb16b59 100644 --- a/src/menus/StandardMenu.vue +++ b/src/menus/StandardMenu.vue @@ -142,7 +142,7 @@ const appLimit = () => { }) } - return Math.floor((body.offsetWidth - size) / 70) + return Math.max(0, Math.floor((body.offsetWidth - size) / 70)) } const makeStyle = (app) => { @@ -158,6 +158,11 @@ const computeLists = () => { popoverAppList.value = appList.value.slice(appLimit()).sort((a, b) => a.order - b.order) } +const reComputeLists = (delay) => { + window.clearTimeout(resizeTimeout) + resizeTimeout = window.setTimeout(computeLists, delay || 100) +} + onMounted(async () => { const config = await configStore.getConfig() @@ -169,10 +174,7 @@ onMounted(async () => { setApps(await navStore.getCoreApps()) - window.addEventListener('resize', () => { - window.clearTimeout(resizeTimeout) - resizeTimeout = window.setTimeout(computeLists, 100) - }) + window.addEventListener('resize', reComputeLists) }) From 8957f1ae780a6420d170fe21223b962105f3b00c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 17 Apr 2025 00:03:04 +0200 Subject: [PATCH 03/12] update app info --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index f98f716..0944305 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -30,7 +30,7 @@ Notice Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). ]]> - 5.0.0 + 5.0.1 agpl Simon Vieille SideMenu From 29d061c37944a9419b5df57dcdd39a0bd0c09c98 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 17 Apr 2025 08:48:14 +0200 Subject: [PATCH 04/12] update readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bf8abbb..48614bf 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,7 @@ You like this app and you want to support me? ☕ [Buy me a coffee](https://www. Requirements ------------ -* PHP >= 8.0 -* App `theming` enabled +* PHP >= 8.1 Installation and upgrade ------------------------ @@ -41,7 +40,7 @@ If you want to install it from source, go to https://gitnet.fr/deblan/side_menu/ ``` $ cd /path/to/nextcloud/apps -$ curl -sS https://gitnet.fr/attachments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | tar xvfz - +$ VERSION=x.y.z; curl -sS https://gitnet.fr/deblan/side_menu/releases/download/v${VERSION}/side_menu_v${VERSION}.tar.gz | tar xvfz - ``` Administrators can edit many settings using the administration page. From c0eb65547d32fe5243b24ab35ac841ff97a097f1 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 17 Apr 2025 15:15:03 +0200 Subject: [PATCH 05/12] fix #413: add user-agent check for memories mobile app --- lib/AppInfo/Application.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 2d4f364..c255ae3 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -106,6 +106,10 @@ class Application extends App implements IBootstrap protected function isEnabled(): bool { + if (preg_match('/MemoriesNative/', $_SERVER['HTTP_USER_AGENT'])) { + return false; + } + $enabled = true; $isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0'); From f9aa59ca041ac42ea1ac3207c82906e3a4ca5567 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 29 Apr 2025 19:21:17 +0200 Subject: [PATCH 06/12] fix #418: allow non admin user to access their settings --- lib/Controller/PersonalSettingController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Controller/PersonalSettingController.php b/lib/Controller/PersonalSettingController.php index 9b63576..285f89c 100644 --- a/lib/Controller/PersonalSettingController.php +++ b/lib/Controller/PersonalSettingController.php @@ -98,6 +98,7 @@ class PersonalSettingController extends Controller } #[NoCSRFRequired] + #[NoAdminRequired] #[FrontpageRoute(verb: 'GET', url: '/user/config')] public function configuration(): JSONResponse { From fd4628d209afb5045e11bf83091818bd172cdac9 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 29 Apr 2025 19:22:25 +0200 Subject: [PATCH 07/12] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bac4b5a..a02c601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## [Unreleased] +### Fixed +* fix #418: allow non admin user to access their settings + ## 5.0.1 ### Fixed * fix(StandardMenu): appLimit must return a value > 0 From f177340b13931c1323c66cbb336eff64911c7772 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 29 Apr 2025 19:24:04 +0200 Subject: [PATCH 08/12] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a02c601..4fa4952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [Unreleased] ### Fixed +* fix #413: add user-agent check for memories mobile app * fix #418: allow non admin user to access their settings ## 5.0.1 From 1fcbd89d19a1f7b8b63c167d4357c8ba9b357602 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 29 Apr 2025 19:26:07 +0200 Subject: [PATCH 09/12] release v5.0.2 --- CHANGELOG.md | 1 + appinfo/info.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fa4952..d49e858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [Unreleased] +## 5.0.2 ### Fixed * fix #413: add user-agent check for memories mobile app * fix #418: allow non admin user to access their settings diff --git a/appinfo/info.xml b/appinfo/info.xml index 0944305..7fd8755 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -30,7 +30,7 @@ Notice Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). ]]> - 5.0.1 + 5.0.2 agpl Simon Vieille SideMenu From 8787918547131ae59e1d7ed4356ba23e307f06bb Mon Sep 17 00:00:00 2001 From: Monica-Wood Date: Wed, 30 Apr 2025 07:31:13 +0200 Subject: [PATCH 10/12] Update lib/AppInfo/Application.php The current change is currently filling the nextcloud logs up with the error: `Undefined array key \"HTTP_USER_AGENT\" at /srv/www/nextcloud/apps/side_menu/lib/AppInfo/Application.php#109` This adds a check to ensure the index exists before read it. --- lib/AppInfo/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index c255ae3..f4fceb0 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -106,7 +106,7 @@ class Application extends App implements IBootstrap protected function isEnabled(): bool { - if (preg_match('/MemoriesNative/', $_SERVER['HTTP_USER_AGENT'])) { + if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match('/MemoriesNative/', $_SERVER['HTTP_USER_AGENT'])) { return false; } From 8772504b766cf785e527d9e3ceec0f8730e1e2cd Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 30 Apr 2025 08:41:10 +0200 Subject: [PATCH 11/12] release v5.0.3 --- CHANGELOG.md | 4 ++++ appinfo/info.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d49e858..9279c3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +## 5.0.3 +### Fixed +* fix #422: undefined array key "HTTP_USER_AGENT" + ## 5.0.2 ### Fixed * fix #413: add user-agent check for memories mobile app diff --git a/appinfo/info.xml b/appinfo/info.xml index 7fd8755..ad353fd 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -30,7 +30,7 @@ Notice Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). ]]> - 5.0.2 + 5.0.3 agpl Simon Vieille SideMenu From d485b728e7978017f1e1f93dfaea7f54437dd517 Mon Sep 17 00:00:00 2001 From: llaumgui Date: Wed, 30 Apr 2025 09:30:35 +0200 Subject: [PATCH 12/12] Use Request object --- lib/AppInfo/Application.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index f4fceb0..21e0421 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -49,6 +49,11 @@ class Application extends App implements IBootstrap */ protected $user; + /** + * @var Request + */ + protected $request; + public function __construct(array $urlParams = []) { parent::__construct(self::APP_ID, $urlParams); @@ -96,6 +101,7 @@ class Application extends App implements IBootstrap $this->config = \OC::$server->getConfig(); $this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager(); $this->user = \OC::$server[IUserSession::class]->getUser(); + $this->request = \OC::$server->getRequest(); if (!$this->isEnabled()) { return; @@ -106,7 +112,7 @@ class Application extends App implements IBootstrap protected function isEnabled(): bool { - if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match('/MemoriesNative/', $_SERVER['HTTP_USER_AGENT'])) { + if (isset($this->request->server['HTTP_USER_AGENT']) && preg_match('/MemoriesNative/', $this->request->server['HTTP_USER_AGENT'])) { return false; }