1.1 --- a/examples/Zope/SimpleWithLoginProduct/__init__.py Sat Sep 29 00:48:37 2007 +0000
1.2 +++ b/examples/Zope/SimpleWithLoginProduct/__init__.py Sat Sep 29 00:49:02 2007 +0000
1.3 @@ -9,15 +9,21 @@
1.4 from WebStack.Adapters.Zope import WebStackAdapterProduct
1.5 from Globals import InitializeClass
1.6
1.7 +# NOTE: Make sure this URL matches your Zope configuration.
1.8 +
1.9 +server_url = "http://localhost:9080"
1.10 +
1.11 class SimpleWithLoginProduct(WebStackAdapterProduct):
1.12 +
1.13 meta_type = "Simple with login product"
1.14 - def __init__(self, id):
1.15 +
1.16 + def __init__(self, id, parent_url):
1.17 WebStackAdapterProduct.__init__(self, id,
1.18 MapResource({
1.19 "simple" :
1.20 LoginRedirectResource(
1.21 - login_url="http://localhost:9080/tests/login",
1.22 - app_url="http://localhost:9080",
1.23 + login_url=parent_url + "/" + id + "/login",
1.24 + app_url=server_url,
1.25 resource=SimpleResource(),
1.26 authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.27 anonymous_parameter_name="anonymous",
1.28 @@ -62,7 +68,7 @@
1.29 The function used to add the product.
1.30 """
1.31
1.32 - product = SimpleWithLoginProduct(id)
1.33 + product = SimpleWithLoginProduct(id, self.DestinationURL())
1.34 self.Destination()._setObject(id, product)
1.35 if REQUEST:
1.36 return self.manage_main(self, REQUEST)