def logout(): if users.user_role() == 0: return render_template("error.html", message="Ei oikeutta nähdä sivua.") users.logout() return redirect("/")
def logout(): user_id = users.user_id() if user_id == 0: error_statement = "You shouldn't go there ;)" return default_homepage_with_error(error_statement) users.logout() return render_template("logout.html")
def logout(self, peer): self.lock.acquire() userName = users.getNameFromPeer(peer) # Temporary fix. if userName: users.logout(userName) logger.info("User %s %s exiting." % (userName, peer)) self.lock.release()
def logout(): try: users.logout() except: return redirect("/") return render_template("index.html", message="Logged out.", navbars=navbars())
def logout(): user_id = users.user_id() if user_id == 0: flash(f'Kirjaudu jotta voit kirjautua ulos', 'danger') return redirect("/") users.logout() flash(f'Ulos kirjautuminen onnistui!', 'success') return redirect("/")
def logout(self, peer): self.lock.acquire() userName = users.getNameFromPeer(peer) # Temporary fix. if userName: users.logout(userName) logger.info("User %s %s exiting." %(userName, peer)) self.lock.release()
def logout(): if users.user_id == 0: return render_template("error.html", message="Et ole kirjautunut sisään.", url="/login") else: users.logout() return redirect("/")
def logout(): if session.get("user_id"): users.logout() return redirect("/") else: return render_template("index.html", location=locations.get(), price_line=prices.get())
def logout(): catList = categories.get_all() try: users.logout() except: return redirect("/") return render_template("index.html", message="Logged out.", categories=catList)
def test_delete_session(self): """The delete_session procedure should remove all sessions for a given user in the sessions table. Test relies on working generate_session""" # run tests for all test users for passwd, nick, avatar in self.users: # now remove the session users.logout()
def remove_account(id): user_id = session["user_id"] if user_id == id or session["admin"] == True: lessons.remove_sign_ups(id) users.remove_account(id) if session["admin"] == True: return redirect("/all_users") else: abort(403) users.logout() return redirect("/")
def remove(conn, message="", reason=""): global clients, clients_keys, client_users if not message: message = "%s disconnected" % clients_address[conn] print(message) conn.close() if conn in clients: clients.remove(conn) if conn in clients_keys: clients_keys.pop(conn) if conn in client_users: users.logout(client_users[conn]) client_users.pop(conn) send_to_everybody(reason, None)
def logout(): """Route for user logout""" resp_data = {} if users.logout(): resp_data = { 'status': 200, 'message': "Logout success!", } return jsonify(resp_data)
def delete(id): allow = False isAdmin = False if users.isAdmin(users.user_id()): allow = True isAdmin = True if users.user_id() == id: allow = True if not allow: return redirect("/profile/" + str(id)) if request.method == "GET": username = users.getUsername(id) return render_template("delete.html", isAdmin=isAdmin, id=id, username=username) if request.method == "POST": if users.isTeacher(id): return render_template("delete.html", isAdmin=isAdmin, id=id, message="Et voi poistaa käyttäjää, joka on opettaja.") if users.deleteUser(id): users.logout() return redirect("/") return render_template("delete.html", isAdmin=isAdmin, id=id, message="Käyttäjän poistaminen epäonnistui, yritä uudelleen")
def logout(): """Process a logout request""" users.logout() bottle.redirect('/')
def logout(): return users.logout()
def logout(): if session: users.logout() return redirect("/") else: return render_template("error.html", message="Et ole kirjautunut sisään")
def main(): """Main function that will be run in the application.""" # Only needs this global variable to keep track of sessions authentication: Union[int, bool] = False # Initialize redis redis = redis_init() # Enter infinite loop while True: main_menu() try: choice = int(input("Input: ")) if choice == 1: sign_up(redis) elif choice == 2: authentication = sign_in(redis) elif choice == 3: with_authentication(profile, authentication, redis, authentication) elif choice == 4: with_authentication(tweet, authentication, redis, authentication) elif choice == 5: with_authentication(follow, authentication, redis, authentication) elif choice == 6: with_authentication(other_profile, authentication, redis) elif choice == 7: with_authentication(unfollow, authentication, redis, authentication) elif choice == 8: timeline(redis) elif choice == 9: with_authentication(update_profile, authentication, redis, authentication) elif choice == 10: authentication = logout() elif choice == 11: exit_menu() elif choice == 12: get_all_data(redis) elif choice == 13: flush_database(redis) else: raise ValueError() except ValueError: print("Please input a correct value!") continue except ( DuplicateUserError, EmptyInputError, FollowError, NotAuthenticatedError, UserDoesNotExistError, UserIsNotYourFollowingError, ) as err: print(err.message) continue finally: input("\nPress any key to continue!")
def logout(): users.logout() return redirect(request.referrer)
def logout(): users.logout() return redirect(session.get("url","/"))
if rfid_tag_id == wait_for_valid_rfid(): new_user_nick = input("input your nick: ") if new_user_nick: users.add(new_user_nick, rfid_tag_id) log_action(new_user_nick, 'login') print('You now exist and are logged in! Dont forget to logout!') else: print('Provied nick empty blipp again.') else: print("Tagg not the same as earlier please try again") else: if user['isHere']: users.logout(rfid_tag_id) log_action(user['Nick'], 'logout') user = users.fetch(rfid_tag_id) print('Goodbye {Nick}, your highscore is: {totalTime}'.format( Nick = user['Nick'], totalTime = util.formatTime(user['totalTime']))) else: users.login(rfid_tag_id) log_action(user['Nick'], 'login') print("Welcome {Nick}!".format(**user)) print("-----------------------------------------------") trigger_random_sound()
def logout(): if users.logout(): return redirect("/") return render_template("home.html", notification="Something went wrong.")
def logout(): '''Log out the user and display the main index page.''' users.logout() return redirect(url_for("index"))
def logout(): users.logout(response) redirect("/")
def logout(): users.logout() flash("Kirjauduttu ulos") return redirect("/")
def logout(): if "user_id" in session: users.logout() flash("Uloskirjautuminen onnistui!") users.logout() return redirect("/")
shutil.rmtree(LOCAL_FOLDER) os.mkdir(LOCAL_FOLDER) open("fileMonitorLog.txt", "w").close() if sys.argv[1] == "ui": print home while True: print "Welcome to OneDir!\n" print "Please enter the number for a command:\n" print "1. Create a new user\n" print "2. Log in a user and start onedir: \n" print "3. Toggle synchronization" userInput = input() if userInput == 1: users.logout() print "Please enter a username:"******"Please enter a password:"******"Please enter password again: " cwpassword = raw_input() response = users.register(username, password, cwpassword) if response.__contains__("successfully"): print response resetOnedir() print "You can now begin using ~/onedir" else: print response if userInput == 2: print "Please enter a username:"
def GET(self): users.logout() return web.seeother('/')
def logout(): try: users.logout() except: pass return redirect("/")
def logout(): if users.user_id() == 0: return redirect("/") else: users.logout() return redirect("/")
def GET(self): users.logout() web.redirect(url.url_for('home'))
def logout(): users.logout() return render_template("logout.html", login="******")
def logout(): users.logout() return redirect("/")
def logout_front(): response = users.logout() # Since the login function returns a response, here is a convoluted way to copy tokens while serving a template r = redirect('/web/login') r.headers.setlist('Set-Cookie', response.headers.getlist('Set-Cookie')) return r