diff --git a/README.md b/README.md
index 7a0a267..0081a07 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ In addition to Nextcloud core features, the following are made available with th
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal
-**Shipped version:** 28.0.4~ynh2
+**Shipped version:** 28.0.5~ynh1
**Demo:**
diff --git a/README_eu.md b/README_eu.md
index 0676394..4353f35 100644
--- a/README_eu.md
+++ b/README_eu.md
@@ -29,7 +29,7 @@ In addition to Nextcloud core features, the following are made available with th
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal
-**Paketatutako bertsioa:** 28.0.4~ynh2
+**Paketatutako bertsioa:** 28.0.5~ynh1
**Demoa:**
diff --git a/README_fr.md b/README_fr.md
index 91334c2..91de831 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -29,7 +29,7 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv
* Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, Baïkal
-**Version incluse :** 28.0.4~ynh2
+**Version incluse :** 28.0.5~ynh1
**Démo :**
diff --git a/README_gl.md b/README_gl.md
index e0c3070..5078868 100644
--- a/README_gl.md
+++ b/README_gl.md
@@ -29,7 +29,7 @@ In addition to Nextcloud core features, the following are made available with th
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal
-**Versión proporcionada:** 28.0.4~ynh2
+**Versión proporcionada:** 28.0.5~ynh1
**Demo:**
diff --git a/README_zh_Hans.md b/README_zh_Hans.md
index be0c591..21fa41f 100644
--- a/README_zh_Hans.md
+++ b/README_zh_Hans.md
@@ -29,7 +29,7 @@ In addition to Nextcloud core features, the following are made available with th
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal
-**分发版本:** 28.0.4~ynh2
+**分发版本:** 28.0.5~ynh1
**演示:**
diff --git a/manifest.toml b/manifest.toml
index b847a94..7980f07 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -5,7 +5,7 @@ name = "Nextcloud"
description.en = "Online storage, file sharing platform and various other applications"
description.fr = "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications"
-version = "28.0.4~ynh2"
+version = "28.0.5~ynh1"
maintainers = ["kay0u"]
@@ -66,8 +66,8 @@ ram.runtime = "512M"
[resources.sources]
[resources.sources.main]
- url = 'https://download.nextcloud.com/server/releases/nextcloud-28.0.4.tar.bz2'
- sha256 = '9bfecee1e12fba48c49e9a71caa81c4ba10b2884787fab75d64ccfd122a13019'
+ url = 'https://download.nextcloud.com/server/releases/nextcloud-28.0.5.tar.bz2'
+ sha256 = 'dca1100f95b864bade113477723c71ac897193352c317e39cd286d87635706eb'
[resources.sources.27]
url = 'https://download.nextcloud.com/server/releases/nextcloud-27.0.0.tar.bz2'
diff --git a/scripts/install b/scripts/install
index c80a941..9be9341 100755
--- a/scripts/install
+++ b/scripts/install
@@ -155,12 +155,13 @@ fi
#=================================================
# Add dynamic logout URL to the config
+url_base64="$(echo -n "https://$domain$path" | base64)"
exec_occ config:system:get logout_url >/dev/null 2>&1 \
|| echo "
//-YunoHost-
// set logout_url according to main domain
\$main_domain = exec('cat /etc/yunohost/current_host');
-\$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout';
+\$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout&r=${url_base64}';
//-YunoHost-
" >> "$install_dir/config/config.php"
diff --git a/scripts/upgrade b/scripts/upgrade
index a7f4515..9d11edf 100755
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -260,14 +260,19 @@ then
#=================================================
# Add dynamic logout URL to the config
- exec_occ config:system:get logout_url >/dev/null 2>&1 \
- || echo "
+ url_base64="$(echo -n "https://$domain$path" | base64)"
+ old_logout_url="https://$(cat /etc/yunohost/current_host)/yunohost/sso/?action=logout"
+ current_logout_url="$(exec_occ config:system:get logout_url 2> /dev/null)"
+ if [[ "$current_logout_url" == "${old_logout_url}" ]] || [[ "$current_logout_url" == "" ]]
+ then
+ echo "
//-YunoHost-
// set logout_url according to main domain
- \$main_domain = exec('cat /etc/yunohost/current_host');
- \$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout';
+ \$main_domain = file_get_contents('/etc/yunohost/current_host');
+ \$CONFIG['logout_url'] = 'https://'.\$main_domain.'/yunohost/sso/?action=logout&r=${url_base64}';
//-YunoHost-
- " >> "$install_dir/config/config.php"
+ " >> "$install_dir/config/config.php"
+ fi
#=================================================
# CHANGE HOSTNAME FOR ACTIVITY NOTIFICATIONS
diff --git a/sources/patches_last_version/app-00-add-logout_url-conf.patch b/sources/patches_last_version/app-00-add-logout_url-conf.patch
index 2c81a65..03f7fc2 100644
--- a/sources/patches_last_version/app-00-add-logout_url-conf.patch
+++ b/sources/patches_last_version/app-00-add-logout_url-conf.patch
@@ -1,20 +1,31 @@
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
-index 13aef8f67a..55d8dbf9d1 100644
+index aa6617c..eb47b80 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
-@@ -97,11 +97,12 @@ class LoginController extends Controller {
+@@ -111,16 +111,20 @@ class LoginController extends Controller {
+ #[UseSession]
+ public function logout() {
+ $loginToken = $this->request->getCookie('nc_token');
++ $uuidUser = $this->userSession->getUser()->getUID();
++ $isLdapUser = $this->config->getUserValue($uuidUser, 'user_ldap', 'uid');
+ if (!is_null($loginToken)) {
+- $this->config->deleteUserValue($this->userSession->getUser()->getUID(), 'login_token', $loginToken);
++ $this->config->deleteUserValue($uuidUser, 'login_token', $loginToken);
}
$this->userSession->logout();
-
+-
- $response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute(
- 'core.login.showLoginForm',
- ['clear' => true] // this param the code in login.js may be removed when the "Clear-Site-Data" is working in the browsers
-+ $redirectUrl = $this->config->getSystemValue('logout_url',
-+ $this->urlGenerator->linkToRouteAbsolute(
+- ));
+-
++ $redirectUrl = $this->urlGenerator->linkToRouteAbsolute(
+ 'core.login.showLoginForm',
+ ['clear' => true] // this param the code in login.js may be removed when the "Clear-Site-Data" is working in the browsers)
- ));
--
++ );
++ if (!is_null($isLdapUser)) {
++ $redirectUrl = $this->config->getSystemValue('logout_url', $redirectUrl);
++ }
+ $response = new RedirectResponse($redirectUrl);
$this->session->set('clearingExecutionContexts', '1');
$this->session->close();