changeset 5119:9044bc563305

cas auth: add a coding param (default utf-8) and use it to decode the username
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 02 Sep 2009 13:44:41 +0200
parents 845ff5cd3890
children aa10c2a001f5
files MoinMoin/auth/cas.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/cas.py	Tue Sep 01 12:20:35 2009 +0200
+++ b/MoinMoin/auth/cas.py	Wed Sep 02 13:44:41 2009 +0200
@@ -23,12 +23,13 @@
     """A class for working with a CAS server."""
 
     def __init__(self, server_url, renew=False, login_path='/login', logout_path='/logout',
-                 validate_path='/validate'):
+                 validate_path='/validate', coding='utf-8'):
         self.server_url = server_url
         self.renew = renew
         self.login_path = login_path
         self.logout_path = logout_path
         self.validate_path = validate_path
+        self.coding = coding
 
     def login_url(self, service):
         """Return the login URL for the given service."""
@@ -57,7 +58,7 @@
         valid = f.readline()
         valid = valid.strip() == 'yes'
         user = f.readline().strip()
-
+        user = user.decode(self.coding)
         return valid, user