Changeset 4091 for waeup/branches


Ignore:
Timestamp:
26 Apr 2009, 12:07:25 (16 years ago)
Author:
uli
Message:

Add method to add users via authenticator plugin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/authentication.py

    r4087 r4091  
    141141        usercontainer.addAccount(account)
    142142
     143    def addUser(self, name, password, title=None, description=None):
     144        usercontainer = self.getUserContainer()
     145        if usercontainer is None:
     146            return
     147        usercontainer.addUser(name, password, title, description)
     148       
    143149    def getUserContainer(self):
    144150        site = grok.getSite()
    145         return getAttribute(site, 'users', None)
     151        return getattr(site, 'users', None)
Note: See TracChangeset for help on using the changeset viewer.