[Zope3-checkins] SVN: ldapauth/trunk/user.py Fixed two issues with
LDAPPrincipal class:
Derrick Hudson
dman at dman13.dyndns.org
Sat Feb 12 17:40:28 EST 2005
Log message for revision 29128:
Fixed two issues with LDAPPrincipal class:
1) getLogin() method is missing
2) self.title is always the empty string
The current solution for #2 is to use the login name as the title. This
should be more configuration, for example to use the 'cn' attribute from
LDAP.
Changed:
U ldapauth/trunk/user.py
-=-
Modified: ldapauth/trunk/user.py
===================================================================
--- ldapauth/trunk/user.py 2005-02-12 22:39:03 UTC (rev 29127)
+++ ldapauth/trunk/user.py 2005-02-12 22:40:27 UTC (rev 29128)
@@ -29,9 +29,9 @@
def __init__(self, login):
self._id = login
self.login = login
- self.title = ''
self.description = ''
+
def _getId(self):
source = self.__parent__
auth = source.__parent__
@@ -41,3 +41,19 @@
self._id = id
id = property(_getId, _setId)
+
+
+ def _getTitle(self):
+ # Hmm, replace with DublinCore adapter!
+ #if hasattr(self, '_title') : return self._title
+ return self.login
+
+ def _setTitle(self, title) :
+ print "LDAPPrincipal %s was asked to set its title to '%s'" % \
+ (self.id, title)
+
+ title = property(_getTitle, _setTitle)
+
+
+ def getLogin(self) : return self.login
+
More information about the Zope3-Checkins
mailing list