'Called on successful login'

def on_login(self, user_id, username, user_group):

    ip_address = cherrypy.request.headers.get('X-Forwarded-For', cherrypy.request.headers.get('Remote-Addr'))
    host = cherrypy.request.headers.get('Origin')
    user_agent = cherrypy.request.headers.get('User-Agent')
    Users().set_user_login(user_id=user_id, user=username, user_group=user_group, ip_address=ip_address, host=host, user_agent=user_agent)
    logger.debug((u"PlexPy    WebAuth    ::    %s    user    '%s'    logged    into    PlexPy." % (user_group.capitalize(), username)))
