From 6bdee2560c86313874584c35d6ee95923df775e8 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Sat, 3 Dec 2011 22:37:49 -0600 Subject: [PATCH] x509 lists handling, thanks Michele and Luca Zachetti --- VERSION | 2 +- gluon/contrib/login_methods/x509_auth.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 8da629ee..97449179 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.3 (2011-12-03 01:04:16) dev +Version 1.99.3 (2011-12-03 22:37:30) dev diff --git a/gluon/contrib/login_methods/x509_auth.py b/gluon/contrib/login_methods/x509_auth.py index ae6ee551..ca8623b6 100644 --- a/gluon/contrib/login_methods/x509_auth.py +++ b/gluon/contrib/login_methods/x509_auth.py @@ -86,10 +86,10 @@ class X509Auth(object): p = profile = dict() - username = p['username'] = self.subject.CN or self.subject.commonName - p['first_name'] = self.subject.givenName or username - p['last_name'] = self.subject.surname - p['email'] = self.subject.Email or self.subject.emailAddress + username = p['username'] = reduce(lambda a,b: '%s | %s' % (a,b), self.subject.CN or self.subject.commonName) + p['first_name'] = reduce(lambda a,b: '%s | %s' % (a,b),self.subject.givenName or username) + p['last_name'] = reduce(lambda a,b: '%s | %s' % (a,b),self.subject.surname) + p['email'] = reduce(lambda a,b: '%s | %s' % (a,b),self.subject.Email or self.subject.emailAddress) # IMPORTANT WE USE THE CERT SERIAL AS UNIQUE KEY FOR THE USER p['registration_id'] = self.serial