SHARE
TWEET

Untitled

a guest Jun 25th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def login_verify():
  2.     db = sqlite3.connect("userfile.db")
  3.     c = db.cursor()
  4.     u_crypt = sha256_crypt.encrypt(username_verify.get())
  5.     p_crypt = sha256_crypt.encrypt(password_verify.get())
  6.     dbusername= "SELECT * from user WHERE username = '%s'"
  7.     dbpassword = "SELECT * from user WHERE password = '%s'"
  8.     if [(sha256_crypt.verify(dbusername, u_crypt)) == True] and [(sha256_crypt.verify(dbpassword, p_crypt)) == True]:
  9.         ms.showinfo(title="Welcome", message=("You are Logged in"))
  10.     elif [(sha256_crypt.verify(dbusername, u_crypt)) == True] and [(sha256_crypt.verify(dbpassword, p_crypt)) != True]:
  11.         ms.showerror(title="ERROR", message=("Invalid Password!"))
  12.         Label(login_screen, text="Login Failed", fg="red", font=("calibri", 11)).pack()
  13.         Label.after(1000 , Label.destroy)
  14.     elif [(sha256_crypt.verify(dbusername, u_crypt)) != True] and [(sha256_crypt.verify(dbpassword, p_crypt)) == True]:
  15.         ms.showerror(title="ERROR", message=("Username does not exist!"))
  16.         Label(login_screen, text="Login Failed", fg="red", font=("calibri", 11)).pack()
  17.         Label.after(1000 , Label.destroy)
  18.     else:
  19.         ms.showerror(title="ERROR", message="Invalid Username or Password!")
  20.         Label(login_screen, text="Login Failed", fg="red", font=("calibri", 11)).pack()
  21.         Label.after(1000 , Label.destroy)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top