[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] Cypht plugin: initially render the home page instead of a 404 screen and...
"Merci Jacob \(@mercihabam\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <698c7f18c44c9_3b367e7d049960@gitlab-sidekiq-low-urgency-cpu-bound-v2-67b895b796-q6gsh.mail> |
Merci Jacob pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki Commits: 868b5164 by Merci Jacob at 2026-02-11T13:07:29+00:00 [FIX] Cypht plugin: initially render the home page instead of a 404 screen and avoid entire session clearing when server info has changed --- * fix linter * cache cleaning should be done per server * [FIX] Cypht plugin: initially render the home page instead of a 404 screen and avoid entire session clearing when server info has changed See merge request tikiwiki/tiki!9133 (cherry picked from commit d331a616541a44a3c95b633f60ae3d36d0c7edbc) 21f6c1f4 [FIX] Cypht plugin: initially render the home page instead of a 404 screen and... 9e04f79f cache cleaning should be done per server 6e9e702a fix linter Co-authored-by: Merci Jacob <[email protected]> - - - - - 3 changed files: - + lib/cypht/integration/Tiki_Hm_Dispatch.php - lib/cypht/integration/classes.php - lib/wiki-plugins/wikiplugin_cypht.php Changes: ===================================== lib/cypht/integration/Tiki_Hm_Dispatch.php ===================================== @@ -0,0 +1,24 @@ +<?php + +// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project +// +// All Rights Reserved. See copyright.txt for details and a complete list of authors. +// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. +class Tiki_Hm_Dispatch extends Hm_Dispatch +{ + private bool $renderHomePage; + + public function __construct($config, $renderHomePage) + { + $this->renderHomePage = $renderHomePage; + parent::__construct($config); + } + + public function get_page($filters, $request) + { + if ($this->renderHomePage) { + $request->get['page'] = 'home'; + } + return parent::get_page($filters, $request); + } +} ===================================== lib/cypht/integration/classes.php ===================================== @@ -33,6 +33,7 @@ require_once __DIR__ . '/Tiki_Hm_User_Config.php'; require_once __DIR__ . '/Tiki_Hm_Sieve_Custom_Client.php'; require_once __DIR__ . '/Tiki_Hm_Sieve_Client_Factory.php'; require_once __DIR__ . '/Tiki_Hm_Functions.php'; +require_once __DIR__ . '/Tiki_Hm_Dispatch.php'; putenv('WORKER_CUSTOM_IMPORTS=' . __DIR__ . '/Tiki_Hm_User_Config.php,' . realpath(__DIR__ . '/../../cache/cachelib.php') . ',' . __DIR__ . '/Tiki_Hm_Tiki_Cache.php,' . __DIR__ . '/Tiki_Hm_Custom_Cache.php'); ===================================== lib/wiki-plugins/wikiplugin_cypht.php ===================================== @@ -378,14 +378,15 @@ function wikiplugin_cypht($data, $params) $_SESSION[$session_prefix]['user_data']['imap_servers'] = []; } $found = false; + $updated = false; foreach ($_SESSION[$session_prefix]['user_data']['imap_servers'] as $id => $server) { if ($server['server'] == $attributes['server'] && $server['tls'] == $attributes['tls'] && $server['port'] == $attributes['port'] && $server['user'] == $attributes['user']) { $found = true; if (array_diff($server, $attributes)) { TikiLib::lib('cache')->invalidate('imap_folders_imap_' . $id . '_'); - $headerlib->add_js("sessionStorage.clear();"); $_SESSION[$session_prefix]['user_data']['imap_servers'][$id] = array_merge($server, $attributes); + $updated = true; } break; @@ -397,6 +398,10 @@ function wikiplugin_cypht($data, $params) } while (isset($_SESSION[$session_prefix]['user_data']['imap_servers'][$id])); $_SESSION[$session_prefix]['user_data']['imap_servers'][$id] = $attributes; } + + if ($updated) { + $headerlib->add_js("Hm_Folders.update_folder_list(true);"); + } } if (! empty($params['smtp_server']) && ! empty($params['smtp_username']) && ! empty($params['smtp_password'])) { @@ -431,7 +436,7 @@ function wikiplugin_cypht($data, $params) } /* process the request */ - $dispatcher = new Hm_Dispatch($config); + $dispatcher = new Tiki_Hm_Dispatch($config, $_GET['page'] == $page); if (! empty($_SESSION[$session_prefix]['user_data']['debug_mode_setting'])) { $msgs = Hm_Debug::get(); View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/868b5164335246175f2996dd416de5132ed2679e -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/868b5164335246175f2996dd416de5132ed2679e You're receiving this email because of your account on gitlab.com. _______________________________________________ TikiWiki-cvs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs