diff --git a/CHANGES.rst b/CHANGES.rst index 609fd1b031..3b9767a59d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -29,6 +29,9 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst - Support ``Chameleon`` ``structure`` expression type. Fixes `#1077 `_. +- Fix authentication error viewing ZMI with a user defined outside of zope root. + Fixes `#1195 `_. + 5.9 (2023-11-24) ---------------- diff --git a/src/App/dtml/manage_page_header.dtml b/src/App/dtml/manage_page_header.dtml index 2dcb047552..e8b8659e10 100644 --- a/src/App/dtml/manage_page_header.dtml +++ b/src/App/dtml/manage_page_header.dtml @@ -10,24 +10,27 @@ <dtml-if title_or_id><dtml-var title_or_id><dtml-else>Zope</dtml-if> + + - + - + - - - - - - - + + + + + + + + " class="zmi zmi- zmi-"> diff --git a/src/zmi/styles/tests.py b/src/zmi/styles/tests.py index 256edfa74b..36c7b65bec 100644 --- a/src/zmi/styles/tests.py +++ b/src/zmi/styles/tests.py @@ -21,6 +21,8 @@ def setupZCML(): class SubscriberTests(Testing.ZopeTestCase.FunctionalTestCase): """Testing .subscriber.*""" + base_path = f'/{Testing.ZopeTestCase.folder_name}' + def call_manage_main(self): """Call /folder/manage_main and return the HTML text.""" def _call_manage_main(self): @@ -29,7 +31,7 @@ def _call_manage_main(self): # which the WSGI publisher does not expect. endInteraction() response = self.publish( - f'/{Testing.ZopeTestCase.folder_name}/manage_main', + f'{self.base_path}/manage_main', basic=basic_auth) return str(response) return temporaryPlacelessSetUp( @@ -40,11 +42,11 @@ def test_subscriber__css_paths__1(self): from .subscriber import css_paths body = self.call_manage_main() for path in css_paths(None): - self.assertIn(path, body) + self.assertIn(f'href="{self.base_path}{path}"', body) def test_subscriber__js_paths__1(self): """The paths it returns are rendered in the ZMI.""" from .subscriber import js_paths body = self.call_manage_main() for path in js_paths(None): - self.assertIn(path, body) + self.assertIn(f'src="{self.base_path}{path}"', body)