Exemplo n.º 1
0
def getCurrentUser():
    """
    Gets the current user logged into the session.
    """
    if "username" not in session:
        return None
    return User.findUser(session["username"], SESSION)
Exemplo n.º 2
0
def getUser(redirect_dest="index"):
    user, redirect_return = None, None
    if "username" not in session:
        flash("You requested a restricted access page. Please login.")
        if VERBOSE:
            print "You requested a restricted access page. Please login."
        redirect(url_for("login"))
        redirect_return = redirect(url_for("login"))
    else:
        user = User.findUser(session["username"], SESSION)
    return user, redirect_return
Exemplo n.º 3
0
 def getUser(self):
     user = User.findUser("Jane", SESSION)
     if user ==None:
         user = User("Jane", "user", "password")
     return user