Example #1
0
File: ldapapp.py Project: bcgsc/gum
 def add(self, **data):
     users = self.context['users']
     __name__ = data['__name__']
     del data['__name__']
     user = User(__name__, container=users, **data)
     user.principal_id = self.request.principal.id # XXX oh the hackery!!!
     notify( ObjectCreatedEvent(user) )
     user.save()
     self.redirect(self.url(users[__name__]))
Example #2
0
File: ldapapp.py Project: bcgsc/gum
 def create_user(self,
     username,
     email,
     password='****',
     cn='Created with GUM API',
     sn='Created with GUM API',
     givenName='Created with GUM API',
     telephoneNumber='',
     description='',
     o='',):
     "Create a new user account"
     users = self.context['users']
     user = User(
         username,
         container=users,
         cn=cn,
         sn=sn,
         givenName=givenName,
         email=email,
         telephoneNumber=telephoneNumber,
         description=description,
         o=o,
     )
     user.principal_id = self.request.principal.id # XXX oh the hackery!!!
     notify( ObjectCreatedEvent(user) )
     users[username] = user
     user.changePassword(password, password)
     user.save()
     
     return True