Ejemplo n.º 1
0
def disconnect():
    """ Log off the current user """
    get_session().loggedin = False
    get_session().username = None
    get_session().realname = None
    get_session().email = None
    return
Ejemplo n.º 2
0
def connect_user_internal(username, email, realname):
    """ Connect a user. Should only be used by plugins to effectively connect the user. **this function does not make any verifications!** """
    get_session().loggedin = True
    get_session().email = email
    get_session().username = username
    get_session().realname = realname

    get_data().update_basic_informations(get_session().realname, get_session().email)
Ejemplo n.º 3
0
def is_logged_in():
    """" Returns if the user is logged in or not """
    return "loggedin" in get_session() and get_session().loggedin
Ejemplo n.º 4
0
def get_realname():
    """ Returns the real name of the current user. Returns None if no user is logged in """
    if not is_logged_in():
        return None
    return get_session().realname
Ejemplo n.º 5
0
def get_username():
    """ Returns the username (which is unique) of the current user. Returns None if no user is logged in """
    if not is_logged_in():
        return None
    return get_session().username
Ejemplo n.º 6
0
def get_data():
    """ Get the User Data for the connected user """
    if not is_logged_in():
        return None
    return UserData(get_session().username)