[Checkins] SVN: z3c.layer.pagelet/branches/icemac_login_support/src/z3c/layer/pagelet/login.txt fixed login-url
Michael Howitz
mh at gocept.com
Mon Mar 9 03:04:30 EDT 2009
Log message for revision 97679:
fixed login-url
Changed:
U z3c.layer.pagelet/branches/icemac_login_support/src/z3c/layer/pagelet/login.txt
-=-
Modified: z3c.layer.pagelet/branches/icemac_login_support/src/z3c/layer/pagelet/login.txt
===================================================================
--- z3c.layer.pagelet/branches/icemac_login_support/src/z3c/layer/pagelet/login.txt 2009-03-09 01:08:14 UTC (rev 97678)
+++ z3c.layer.pagelet/branches/icemac_login_support/src/z3c/layer/pagelet/login.txt 2009-03-09 07:04:30 UTC (rev 97679)
@@ -57,11 +57,11 @@
Selecting the link leads to the login page, as we use basic auth here,
we get an HTTP error 401 (unauthorized):
+ >>> login_url = browser.getLink('Login').url
>>> browser.getLink('Login').click()
Traceback (most recent call last):
httperror_seek_wrapper: HTTP Error 401: Unauthorized
- >>> login_url = browser.url
- >>> login_url
+ >>> browser.url
'http://localhost/++skin++PageletTestSkin/container/@@login.html?nextURL=http%3A//localhost/%2B%2Bskin%2B%2BPageletTestSkin/container/%40%40default.html'
When adding correct credentials we get authorized:
@@ -253,6 +253,7 @@
>>> from zope.app.authentication.principalfolder import InternalPrincipal
>>> principal_folder['1'] = InternalPrincipal('tester', 'tpass', 'Tester')
+
We use a new browser, so the principal is not logged in and the login
link is displayed:
@@ -273,9 +274,9 @@
Selecting the link leads to the login page:
+ >>> login_url = browser.getLink('Login').url
>>> browser.getLink('Login').click()
- >>> login_url = browser.url
- >>> login_url
+ >>> browser.url
'http://localhost/++skin++PageletTestSkin/@@loginForm.html?camefrom=%2F%2B%2Bskin%2B%2BPageletTestSkin%2Fcontainer%2F%40%40login.html%3FnextURL%3Dhttp%253A%2F%2Flocalhost%2F%252B%252Bskin%252B%252BPageletTestSkin%2Fcontainer%2F%2540%2540default.html'
>>> print browser.contents
<!DOCTYPE ...>
@@ -424,9 +425,19 @@
</html>
-Calling the login URL again leads directly to the page referred in
-nextURL:
+Calling the login URL again leads directly to the page referred in nextURL:
>>> browser.open(login_url)
>>> browser.url
'http://localhost/++skin++PageletTestSkin/container/@@default.html'
+ >>> print browser.contents
+ <!DOCTYPE ...>
+ <html ...>
+ <head>
+ <title>PageletTest</title>
+ </head>
+ <body>
+ <a href="http://localhost/++skin++PageletTestSkin/container/@@logout.html?nextURL=http%3A//localhost/%2B%2Bskin%2B%2BPageletTestSkin/container/%40%40default.html">Logout</a>
+ </body>
+ </html>
+
More information about the Checkins
mailing list