Пример #1
0
    def changeUserPassword(self, lastlogintext, newlogintext):

        if self.isAuthenticated() is False : 
            return None

        params = {}
        user = User(self)
        user.lastlogintext = base64.b64encode(lastlogintext)
        user.logintext = base64.b64encode(newlogintext)
        data = ElementTree.tostring(user.buildElements())
        return self.get_status( 'user/%s/%s/' % ('logintext', self.authentication.id), 
                                data=data, method='POST')
Пример #2
0
    def changeUserPassword(self, lastlogintext, newlogintext):

        if self.isAuthenticated() is False:
            return None

        params = {}
        user = User(self)
        user.lastlogintext = base64.b64encode(lastlogintext)
        user.logintext = base64.b64encode(newlogintext)
        data = ElementTree.tostring(user.buildElements())
        return self.get_status('user/%s/%s/' %
                               ('logintext', self.authentication.id),
                               data=data,
                               method='POST')
Пример #3
0
    def createUser(self,
                   login,
                   logintext,
                   usertype='localuser',
                   firstname='',
                   lastname='',
                   email='',
                   role='Administrator',
                   MFA='false'):

        if self.isAuthenticated() is False:
            return None

        user = User(self)
        user.loginname = login
        user.logintext = base64.b64encode(logintext)
        user.usertype = usertype
        user.firstName = firstname
        user.lastName = lastname
        user.email = email
        user.name = role
        user.MFAStatus = MFA
        user.setRole(role, MFA)
        data = ElementTree.tostring(user.buildElements())
        return self.get_object('%s/' % (self.REST_USER),
                               User,
                               data=data,
                               method='POST')
Пример #4
0
    def createUser(self, login, logintext, usertype='localuser', 
                   firstname='', lastname='', email='', 
                   role='Administrator', MFA='false'):

        if self.isAuthenticated() is False : 
            return None

        user = User(self)
        user.loginname = login
        user.logintext = base64.b64encode(logintext)
        user.usertype = usertype
        user.firstName = firstname
        user.lastName = lastname
        user.email = email
        user.name = role
        user.MFAStatus = MFA
        user.setRole(role, MFA)
        data = ElementTree.tostring(user.buildElements())
        return self.get_object( '%s/' % (self.REST_USER), 
                                User, data=data, method='POST')