1.1 --- a/examples/Zope/SimpleWithLoginProduct/__init__.py Thu Sep 27 22:48:48 2007 +0000
1.2 +++ b/examples/Zope/SimpleWithLoginProduct/__init__.py Thu Sep 27 22:49:16 2007 +0000
1.3 @@ -4,6 +4,8 @@
1.4
1.5 from Simple import SimpleResource
1.6 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.7 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.8 +from WebStack.Resources.ResourceMap import MapResource
1.9 from WebStack.Adapters.Zope import WebStackAdapterProduct
1.10 from Globals import InitializeClass
1.11
1.12 @@ -11,15 +13,28 @@
1.13 meta_type = "Simple with login product"
1.14 def __init__(self, id):
1.15 WebStackAdapterProduct.__init__(self, id,
1.16 - LoginRedirectResource(
1.17 - login_url="http://localhost:9080/tests/login",
1.18 - app_url="http://localhost:9080",
1.19 - resource=SimpleResource(),
1.20 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.21 - anonymous_parameter_name="anonymous",
1.22 - logout_parameter_name="logout"
1.23 + MapResource({
1.24 + "simple" :
1.25 + LoginRedirectResource(
1.26 + login_url="http://localhost:9080/tests/login",
1.27 + app_url="http://localhost:9080",
1.28 + resource=SimpleResource(),
1.29 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.30 + anonymous_parameter_name="anonymous",
1.31 + logout_parameter_name="logout"
1.32 + ),
1.33 + "login" :
1.34 + LoginResource(
1.35 + LoginAuthenticator(
1.36 + secret_key="horses",
1.37 + credentials=(
1.38 + ("badger", "abc"),
1.39 + ("vole", "xyz"),
1.40 + )
1.41 + )
1.42 + )
1.43 + })
1.44 )
1.45 - )
1.46
1.47 InitializeClass(SimpleWithLoginProduct)
1.48