Changeset 4087 for waeup/branches
- Timestamp:
- 26 Apr 2009, 01:58:47 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/authentication.py
r4075 r4087 77 77 78 78 class Account(grok.Model): 79 def __init__(self, name, password ):79 def __init__(self, name, password, title=None, description=None): 80 80 self.name = name 81 if title is None: 82 title = name 83 if description is None: 84 description = title 85 self.title = title 86 self.description = description 81 87 self.setPassword(password) 82 88 … … 121 127 if login == 'grok': 122 128 return Account('grok', 'grok') 123 return 124 #... look up the account object and return it ... 129 130 # ... look up the account object and return it ... 131 usercontainer = self.getUserContainer() 132 if usercontainer is None: 133 return 134 return usercontainer.get(login, None) 135 136 def addAccount(self, account): 137 usercontainer = self.getUserContainer() 138 if usercontainer is None: 139 return 140 # XXX: complain if name already exists... 141 usercontainer.addAccount(account) 142 143 def getUserContainer(self): 144 site = grok.getSite() 145 return getAttribute(site, 'users', None)
Note: See TracChangeset for help on using the changeset viewer.