Compare commits

...
Sign in to create a new pull request.

23 commits

Author SHA1 Message Date
d485b728e7 Use Request object 2025-04-30 09:30:35 +02:00
8772504b76
release v5.0.3 2025-04-30 08:41:10 +02:00
75bea4be38 Merge pull request 'Update lib/AppInfo/Application.php' (#421) from Monica-Wood/side_menu:http_user_agent_check_patch into develop
Reviewed-on: deblan/side_menu#421
Reviewed-by: Simon Vieille <contact@deblan.fr>
2025-04-30 08:37:15 +02:00
8787918547 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.
2025-04-30 07:31:13 +02:00
1fcbd89d19
release v5.0.2 2025-04-29 19:26:07 +02:00
f177340b13
update changelog 2025-04-29 19:24:04 +02:00
aaa7afac51 Merge pull request 'fix #418: allow non admin user to access their settings' (#419) from bugfix/issue418-userconfigaccess into develop
Reviewed-on: deblan/side_menu#419
2025-04-29 19:23:27 +02:00
fd4628d209
update changelog 2025-04-29 19:22:25 +02:00
f9aa59ca04
fix #418: allow non admin user to access their settings 2025-04-29 19:21:17 +02:00
95e4ef136e Merge pull request 'fix #413: add user-agent check for memories mobile app' (#414) from bugfix/issues413-memories into develop
Reviewed-on: deblan/side_menu#414
2025-04-18 10:36:15 +02:00
c0eb65547d
fix #413: add user-agent check for memories mobile app 2025-04-17 15:15:03 +02:00
29d061c379
update readme 2025-04-17 08:48:14 +02:00
8e22d9ea62 Merge pull request 'bugfix/standard-menu-mobile' (#411) from bugfix/standard-menu-mobile into develop
Reviewed-on: deblan/side_menu#411
2025-04-17 00:04:48 +02:00
8957f1ae78
update app info 2025-04-17 00:03:04 +02:00
7b4b447754
fix(StandardMenu): appLimit must return a value > 0 2025-04-17 00:02:47 +02:00
e297a27f83
fix(build): remove css directory 2025-04-16 20:09:45 +02:00
3f6ce2df34
fix(build): remove css directory 2025-04-16 20:03:21 +02:00
15cc6a129b Merge pull request 'migration from vue2 to vue3' (#405) from feature/vue3 into develop
Reviewed-on: deblan/side_menu#405
2025-04-16 19:56:02 +02:00
174c80e654
update changelog 2025-04-16 19:55:07 +02:00
17f1d91851
upgrade app version 2025-04-16 19:46:51 +02:00
cdad60ca7a
update changelog 2025-04-16 19:46:40 +02:00
94efc26cd5
update screenshots 2025-04-16 19:39:51 +02:00
a47a8d6c63
remove route unused route 2025-04-16 19:37:28 +02:00
11 changed files with 57 additions and 36 deletions

View file

@ -32,7 +32,7 @@ steps:
- echo "$APP_CERTIFICATE" > "/tmp/side_menu.key" - echo "$APP_CERTIFICATE" > "/tmp/side_menu.key"
- echo "$APP_PUBLIC_CERTIFICATE" > "/tmp/side_menu.crt" - echo "$APP_PUBLIC_CERTIFICATE" > "/tmp/side_menu.crt"
- mkdir /tmp/app - mkdir /tmp/app
- cp -r README.md CHANGELOG.md appinfo css lib img l10n js src templates screenshots vendor /tmp/app - cp -r README.md CHANGELOG.md appinfo lib img l10n js src templates screenshots vendor /tmp/app
- /usr/src/nextcloud/occ integrity:sign-app - /usr/src/nextcloud/occ integrity:sign-app
--privateKey=/tmp/side_menu.key --privateKey=/tmp/side_menu.key
--certificate=/tmp/side_menu.crt --certificate=/tmp/side_menu.crt

View file

@ -1,5 +1,36 @@
## [Unreleased] ## [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
* fix #418: allow non admin user to access their settings
## 5.0.1
### Fixed
* fix(StandardMenu): appLimit must return a value > 0
## 5.0.0
### Fixed
* fix apps's order in the standard menu
### Added
* add new translations
* add route `/apps/side_menu/user/config`
* add new UI for admin and personals settings
### Changed
* migrate to Vue 3 and so add/update or remove dependencies
* replace CSS with SCSS
* remove route `/apps/side_menu/js/script`
* remove generated Javascript using PHP
* rewrite the standard menu of Nextcloud
### Security
* fix CVE-2023-44270
* fix CVE-2024-9506
* fix CVE-2024-6783
## 4.1.1 ## 4.1.1
### Fixed ### Fixed
* fix(CssController): add missing NoCSRFRequired import (#397) * fix(CssController): add missing NoCSRFRequired import (#397)

View file

@ -20,7 +20,7 @@ release:
test -d $$RELEASE_DIRECTORY/$$VERSION && rm -fr $$RELEASE_DIRECTORY/$$VERSION test -d $$RELEASE_DIRECTORY/$$VERSION && rm -fr $$RELEASE_DIRECTORY/$$VERSION
mkdir -p $$RELEASE_DIRECTORY/$$VERSION/side_menu mkdir -p $$RELEASE_DIRECTORY/$$VERSION/side_menu
cp -r README.md CHANGELOG.md appinfo css lib img l10n js src templates screenshots vendor $$RELEASE_DIRECTORY/$$VERSION/side_menu cp -r README.md CHANGELOG.md appinfo lib img l10n js src templates screenshots vendor $$RELEASE_DIRECTORY/$$VERSION/side_menu
cd $$RELEASE_DIRECTORY/$$VERSION cd $$RELEASE_DIRECTORY/$$VERSION
zip -r side_menu_v$$VERSION.zip side_menu zip -r side_menu_v$$VERSION.zip side_menu
tar cvzf side_menu_v$$VERSION.tar.gz side_menu tar cvzf side_menu_v$$VERSION.tar.gz side_menu

View file

@ -24,8 +24,7 @@ You like this app and you want to support me? ☕ [Buy me a coffee](https://www.
Requirements Requirements
------------ ------------
* PHP >= 8.0 * PHP >= 8.1
* App `theming` enabled
Installation and upgrade 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 $ 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. Administrators can edit many settings using the administration page.

View file

@ -10,14 +10,13 @@ This application is rather suitable for instances that activate a lot of applica
Use the shortcut `Ctrl`+`o` to open and to hide the side menu. Use `tab` to navigate. Use the shortcut `Ctrl`+`o` to open and to hide the side menu. Use `tab` to navigate.
You can customize colors depending of the theme (Dark theme and Breeze Dark). You can customize colors depending of the theme.
You can report a bug or request a feature by opening an issue. To report a bug or request a feature, please open an issue.
Requirements: Requirements:
* PHP >= 8.1 * PHP >= 8.1
* App `theming` enabled
If you like this application and if you want to support the development: If you like this application and if you want to support the development:
@ -31,7 +30,7 @@ Notice
Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. 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/). In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/).
]]></description> ]]></description>
<version>4.1.1</version> <version>5.0.3</version>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author> <author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
<namespace>SideMenu</namespace> <namespace>SideMenu</namespace>
@ -54,7 +53,7 @@ In case of downtime, you can download **Custom Menu** from [here](https://kim.de
<screenshot><![CDATA[https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_default_menu.png]]></screenshot> <screenshot><![CDATA[https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_default_menu.png]]></screenshot>
<dependencies> <dependencies>
<php min-version="8.1" max-version="8.4" /> <php min-version="8.1" max-version="8.4" />
<nextcloud min-version="30" max-version="32"/> <nextcloud min-version="31" max-version="32"/>
</dependencies> </dependencies>
<settings> <settings>
<admin>OCA\SideMenu\Settings\Admin</admin> <admin>OCA\SideMenu\Settings\Admin</admin>

View file

@ -49,6 +49,11 @@ class Application extends App implements IBootstrap
*/ */
protected $user; protected $user;
/**
* @var Request
*/
protected $request;
public function __construct(array $urlParams = []) public function __construct(array $urlParams = [])
{ {
parent::__construct(self::APP_ID, $urlParams); parent::__construct(self::APP_ID, $urlParams);
@ -96,6 +101,7 @@ class Application extends App implements IBootstrap
$this->config = \OC::$server->getConfig(); $this->config = \OC::$server->getConfig();
$this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager(); $this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager();
$this->user = \OC::$server[IUserSession::class]->getUser(); $this->user = \OC::$server[IUserSession::class]->getUser();
$this->request = \OC::$server->getRequest();
if (!$this->isEnabled()) { if (!$this->isEnabled()) {
return; return;
@ -106,6 +112,10 @@ class Application extends App implements IBootstrap
protected function isEnabled(): bool protected function isEnabled(): bool
{ {
if (isset($this->request->server['HTTP_USER_AGENT']) && preg_match('/MemoriesNative/', $this->request->server['HTTP_USER_AGENT'])) {
return false;
}
$enabled = true; $enabled = true;
$isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0'); $isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0');
@ -128,7 +138,6 @@ class Application extends App implements IBootstrap
protected function addAssets() protected function addAssets()
{ {
Util::addScript(self::APP_ID, 'side_menu-menu'); Util::addScript(self::APP_ID, 'side_menu-menu');
// Util::addStyle(self::APP_ID, 'sideMenu');
$assets = [ $assets = [
'stylesheet' => [ 'stylesheet' => [
@ -139,14 +148,6 @@ class Application extends App implements IBootstrap
'rel' => 'stylesheet', 'rel' => 'stylesheet',
], ],
], ],
// 'script' => [
// 'route' => 'side_menu.Js.script',
// 'type' => 'script',
// 'route_attr' => 'src',
// 'attr' => [
// 'nonce' => $this->cspnm->getNonce(),
// ],
// ],
]; ];
$cache = $this->config->getAppValue(self::APP_ID, 'cache', '0'); $cache = $this->config->getAppValue(self::APP_ID, 'cache', '0');

View file

@ -54,18 +54,6 @@ class JsController extends Controller
$this->l10nFactory = $l10nFactory; $this->l10nFactory = $l10nFactory;
} }
#[NoCSRFRequired]
#[NoAdminRequired]
#[PublicPage]
#[FrontpageRoute(verb: 'GET', url: '/js/script')]
public function script(): TemplateResponse
{
$response = new TemplateResponse(Application::APP_ID, 'js/script', $this->getConfig(), 'blank');
$response->addHeader('Content-Type', 'text/javascript');
return $response;
}
#[NoCSRFRequired] #[NoCSRFRequired]
#[NoAdminRequired] #[NoAdminRequired]
#[PublicPage] #[PublicPage]

View file

@ -98,6 +98,7 @@ class PersonalSettingController extends Controller
} }
#[NoCSRFRequired] #[NoCSRFRequired]
#[NoAdminRequired]
#[FrontpageRoute(verb: 'GET', url: '/user/config')] #[FrontpageRoute(verb: 'GET', url: '/user/config')]
public function configuration(): JSONResponse public function configuration(): JSONResponse
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 KiB

After

Width:  |  Height:  |  Size: 223 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 246 KiB

Before After
Before After

View file

@ -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) => { const makeStyle = (app) => {
@ -158,6 +158,11 @@ const computeLists = () => {
popoverAppList.value = appList.value.slice(appLimit()).sort((a, b) => a.order - b.order) 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 () => { onMounted(async () => {
const config = await configStore.getConfig() const config = await configStore.getConfig()
@ -169,10 +174,7 @@ onMounted(async () => {
setApps(await navStore.getCoreApps()) setApps(await navStore.getCoreApps())
window.addEventListener('resize', () => { window.addEventListener('resize', reComputeLists)
window.clearTimeout(resizeTimeout)
resizeTimeout = window.setTimeout(computeLists, 100)
})
}) })
</script> </script>