Пример #1
0
 def service_addUser(self, context, username, method, password, groups):
     username = getUsername(username)
     password = getPassword(password)
     groups = getList(getGroup, groups)
     #method is checked in auth_basemethods.AbstractAuth.hash_password
     if self.auth.addUser(username, method, password, groups):
         self.info(context, "User %s added" % username)
         yield self.modified()
         returnValue(True)
     returnValue(False)
Пример #2
0
 def service_editUser(self, context, username, method, password, groups):
     """
     Edit a user account.
     password is optional
     """
     username = getUsername(username)
     password = getPassword(password, False)
     groups = getList(getGroup, groups)
     #method is checked in auth_basemethods.AbstractAuth.hash_password
     if self.auth.editUser(username, method, password, groups):
         self.info(context, "User %s modified" % username)
         yield self.modified()
         returnValue(True)
     returnValue(False)