Exemplo n.º 1
0
 def update_user_groups(username, password, groups):
     try:
         api = UserService(settings.OPENFIRE_ADDRESS,
                           settings.OPENFIRE_SECRET_KEY)
         api.update_user(username, password, "", "", groups)
     except exception.HTTPException as e:
         print e
Exemplo n.º 2
0
 def delete_user(username):
     try:
         api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
         api.delete_user(username)
         return True
     except exception.UserNotFoundException:
         return False
Exemplo n.º 3
0
 def update_user_pass(username):
     try:
         password = OpenfireManager.__generate_random_pass()
         api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
         api.update_user(username, password)
         return password
     except exception.UserNotFoundException:
         return ""
Exemplo n.º 4
0
 def delete_user(username):
     try:
         api = UserService(settings.OPENFIRE_ADDRESS,
                           settings.OPENFIRE_SECRET_KEY)
         api.delete_user(username)
         return True
     except exception.UserNotFoundException:
         return False
Exemplo n.º 5
0
 def update_user_pass(username):
     try:
         password = OpenfireManager.__generate_random_pass()
         api = UserService(settings.OPENFIRE_ADDRESS,
                           settings.OPENFIRE_SECRET_KEY)
         api.update_user(username, password)
         return password
     except exception.UserNotFoundException:
         return ""
Exemplo n.º 6
0
    def add_user(username):

        try:
            sanatized_username = OpenfireManager.__santatize_username(username)
            password = OpenfireManager.__generate_random_pass()
            api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
            api.add_user(sanatized_username, password)

        except exception.UserAlreadyExistsException:
            # User exist
            return "", ""

        return sanatized_username, password
Exemplo n.º 7
0
    def add_user(username):

        try:
            sanatized_username = OpenfireManager.__santatize_username(username)
            password = OpenfireManager.__generate_random_pass()
            api = UserService(settings.OPENFIRE_ADDRESS,
                              settings.OPENFIRE_SECRET_KEY)
            api.add_user(sanatized_username, password)

        except exception.UserAlreadyExistsException:
            # User exist
            return "", ""

        return sanatized_username, password
Exemplo n.º 8
0
def add_xmpp_jid(jid):
    #Get xmpp server url from properties.py file
    xmppServer = properties.xmppServerUrl
    #Login to the xmpp server
    api = UserService(xmppServer, "skAljQTm43929-49sdakl")
    try:
        #Add users from the input csv file
        userAddReturnValue = api.add_user(jid, "skAljQTm43929-49sdakl")
        print "User " + jid + " added successfully!!"
        #print userAddReturnValue
    except UserAlreadyExistsException:
        print "User " + jid + " already exists!"
    except UserNotFoundException:
        print "User " + jid + " not found!!"
    except InvalidResponseException:
        print "Invalid request"
    except RequestNotAuthorisedException:
        print "Request is not authorized"
Exemplo n.º 9
0
    def delete_user_groups(username, groups):

        api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
        api.delete_group(username, groups)
Exemplo n.º 10
0
 def update_user_groups(username, password, groups):
     try:
         api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
         api.update_user(username, password, "", "", groups)
     except exception.HTTPException as e:
         print e
Exemplo n.º 11
0
 def unlock_user(username):
     api = UserService(settings.OPENFIRE_ADDRESS, settings.OPENFIRE_SECRET_KEY)
     api.unlock_user(username)
Exemplo n.º 12
0
 def unlock_user(username):
     api = UserService(settings.OPENFIRE_ADDRESS,
                       settings.OPENFIRE_SECRET_KEY)
     api.unlock_user(username)
Exemplo n.º 13
0
    def delete_user_groups(username, groups):

        api = UserService(settings.OPENFIRE_ADDRESS,
                          settings.OPENFIRE_SECRET_KEY)
        api.delete_group(username, groups)