changeset 5666:f8e67522e80e

Fix auth.cas and userprefs.oidserv request object usage (untested, details see below) auth.cas ======== request.getBaseURL() is deprecated, replaced it with request.url_root. Even better would be to replace it with request.abs_href(), if possible. request.getPathinfo() is gone, replaced it with request.path. Needs testing, esp. whether quote_plus and encode is still correct. In general: auth.cas needs an active maintainer! userprefs.oidserv ================= request.getPathinfo() is gone, replaced it with request.path. Needs testing also (but should work, is done the same way at other places). In general: openid stuff needs an active maintainer!
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 06 May 2010 15:36:56 +0200
parents a5046071a4fc
children f7f9d35f9d23
files MoinMoin/auth/cas.py MoinMoin/userprefs/oidserv.py
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/cas.py	Tue May 04 00:36:22 2010 +0200
+++ b/MoinMoin/auth/cas.py	Thu May 06 15:36:56 2010 +0200
@@ -77,7 +77,7 @@
         ticket = request.args.get('ticket')
         action = request.args.get("action", [])
         logoutRequest = request.args.get('logoutRequest', [])
-        url = request.getBaseURL() + urllib.quote_plus(request.getPathinfo().encode('utf-8'))
+        url = request.url_root + urllib.quote_plus(request.path.encode('utf-8'))
 
         # # handle logout request from CAS
         # if logoutRequest:
@@ -112,7 +112,7 @@
 
     def logout(self, request, user_obj, **kw):
         if self.name and user_obj and user_obj.auth_method == self.name:
-            url = request.getBaseURL() + urllib.quote_plus(request.getPathinfo().encode('utf-8'))
+            url = request.url_root + urllib.quote_plus(request.path.encode('utf-8'))
             request.http_redirect(self.cas.logout_url(url))
 
             user_obj.valid = False
--- a/MoinMoin/userprefs/oidserv.py	Tue May 04 00:36:22 2010 +0200
+++ b/MoinMoin/userprefs/oidserv.py	Thu May 06 15:36:56 2010 +0200
@@ -61,9 +61,7 @@
             return self._handle_remove()
 
     def _make_form(self):
-        sn = self.request.script_root
-        pi = self.request.getPathinfo()
-        action = u"%s%s" % (sn, pi)
+        action = "%s%s" % (self.request.script_root, self.request.path)
         _form = html.FORM(action=action)
         _form.append(html.INPUT(type="hidden", name="action", value="userprefs"))
         _form.append(html.INPUT(type="hidden", name="handler", value="oidserv"))