# HG changeset patch # User paulb # Date 1191026942 0 # Node ID 66b6e6dfcc7a775c03ab9053c2e9cab4f217d9aa # Parent 355429a0ae386cbe6a3444b835089544552ee90f [project @ 2007-09-29 00:49:02 by paulb] Added dynamic URL configuration. diff -r 355429a0ae38 -r 66b6e6dfcc7a examples/Zope/SimpleWithLoginProduct/__init__.py --- a/examples/Zope/SimpleWithLoginProduct/__init__.py Sat Sep 29 00:48:37 2007 +0000 +++ b/examples/Zope/SimpleWithLoginProduct/__init__.py Sat Sep 29 00:49:02 2007 +0000 @@ -9,15 +9,21 @@ from WebStack.Adapters.Zope import WebStackAdapterProduct from Globals import InitializeClass +# NOTE: Make sure this URL matches your Zope configuration. + +server_url = "http://localhost:9080" + class SimpleWithLoginProduct(WebStackAdapterProduct): + meta_type = "Simple with login product" - def __init__(self, id): + + def __init__(self, id, parent_url): WebStackAdapterProduct.__init__(self, id, MapResource({ "simple" : LoginRedirectResource( - login_url="http://localhost:9080/tests/login", - app_url="http://localhost:9080", + login_url=parent_url + "/" + id + "/login", + app_url=server_url, resource=SimpleResource(), authenticator=LoginRedirectAuthenticator(secret_key="horses"), anonymous_parameter_name="anonymous", @@ -62,7 +68,7 @@ The function used to add the product. """ - product = SimpleWithLoginProduct(id) + product = SimpleWithLoginProduct(id, self.DestinationURL()) self.Destination()._setObject(id, product) if REQUEST: return self.manage_main(self, REQUEST)