XSLTools

Change of examples/Common/VerySimpleWithOpenID/__init__.py

655:9a1e349e5701
examples/Common/VerySimpleWithOpenID/__init__.py
     1.1 --- a/examples/Common/VerySimpleWithOpenID/__init__.py	Sun Feb 03 22:43:55 2008 +0000
     1.2 +++ b/examples/Common/VerySimpleWithOpenID/__init__.py	Sun Feb 03 22:44:31 2008 +0000
     1.3 @@ -131,15 +131,20 @@
     1.4  
     1.5  # Site map initialisation.
     1.6  
     1.7 -def get_site(host, secret_key, use_redirect=1):
     1.8 +def get_site(host, secret_key, use_redirect=1, deployed_at=None):
     1.9  
    1.10      "Return a simple Web site resource."
    1.11  
    1.12 +    # Configure the user home pages below.
    1.13 +
    1.14 +    deployed_at = deployed_at or host
    1.15 +
    1.16      # Authentication objects.
    1.17  
    1.18      credentials = [
    1.19 -        ("badger", "123"),
    1.20 -        ("vole", "abc")
    1.21 +        ((deployed_at + "/badger", "badger"), "abc"),
    1.22 +        ((deployed_at + "/vole", "vole"), "xyz"),
    1.23 +        ((deployed_at + u"/זרו", u"זרו"), u"ֶ״ֵ")
    1.24          ]
    1.25      login_authenticator = Authenticator(credentials)
    1.26      login_redirect_authenticator = OpenIDRedirectAuthenticator(secret_key, host)
    1.27 @@ -159,7 +164,7 @@
    1.28          logout_parameter_name="logout"
    1.29          )
    1.30      initiation_resource = InitiationResource(use_redirect=use_redirect)
    1.31 -    login_resource = LoginResource(login_authenticator, use_redirect)
    1.32 +    login_resource = LoginResource(host, login_authenticator, use_redirect=use_redirect)
    1.33  
    1.34      # Make a simple Web site.
    1.35  
    1.36 @@ -185,7 +190,7 @@
    1.37                      <p>Home page for the OpenID authenticated user, <code>badger</code>.</p>
    1.38                    </body>
    1.39                  </html>
    1.40 -            """ % (host, host), WebStack.Generic.ContentType("text/html")),
    1.41 +            """ % (deployed_at, deployed_at), WebStack.Generic.ContentType("text/html")),
    1.42          u"זרו" :
    1.43              StringResource(u"""
    1.44                  <html>
    1.45 @@ -198,7 +203,7 @@
    1.46                      <p>Home page for the OpenID authenticated user, <code>זרו</code>.</p>
    1.47                    </body>
    1.48                  </html>
    1.49 -            """ % (host, host), WebStack.Generic.ContentType("text/html", "iso-8859-1")),
    1.50 +            """ % (deployed_at, deployed_at), WebStack.Generic.ContentType("text/html", "iso-8859-1")),
    1.51          "vole" :
    1.52              StringResource("""
    1.53                  <html>
    1.54 @@ -211,7 +216,7 @@
    1.55                      <p>Home page for the OpenID authenticated user, <code>vole</code>.</p>
    1.56                    </body>
    1.57                  </html>
    1.58 -            """ % (host, host), WebStack.Generic.ContentType("text/html")),
    1.59 +            """ % (deployed_at, deployed_at), WebStack.Generic.ContentType("text/html")),
    1.60  
    1.61          # Main page and in-page resources:
    1.62          # (Now protected!)