def createUser(): try: rInfo=Registion.popRegistQueue() if rInfo==None: return True #{"username":username,"password":password,"info":info} cellphone = rInfo["username"] objectId=User.createUser(cellphone, rInfo["password"], rInfo["info"]) code = SecurityModule.Registion.generateCode(cellphone) sms.send(cellphone, "[C.M.O]动态六位编码 %s"%code) except: print sys.exc_info() return True
def getUserInfo(self): userInfo = User.getUserInfo("test") self.assertTrue(True, userInfo)
def createUser(self): objectid= User.createUser("13524157392", "123456") print objectid self.assertTrue(True, objectid) pass
def main(): objid = User.createUser("admin", "admin") Security.set_right(objid, [security.Role("admin",1)])
def create_domains(): objid = User.add_root_domain(domain="<root>") Settings.accounts["root_domain_id"] = str(objid) Settings.save()