コード例 #1
0
def create_lay(self, title1):
    if title1 == "Create Account":
        #Diverted the flow towards create account window
        create_account_layout.create_ac(self,title1)
    elif title1 == "SignIn":
        # Diverted the flow towards Signin window
        signin_layout.signin(self, title1)
    elif title1 == "Forgot Password":
        # Diverted the flow towards Reset Password window
        forgot_password_layout.forgot_lay(self,title1)
コード例 #2
0
 def not_lay():
     x = lambda: main.forgotpassword(e.get())
     if x() == 1:
         l = Label(self,
                   text="Check your email for reset link",
                   bg="black",
                   fg="red",
                   font=("comicsansms", 30, "bold"),
                   relief=FLAT).place(x=150, y=400)
         bt = Button(self,
                     activebackground="black",
                     activeforeground="white",
                     text="Signin",
                     bg="white",
                     fg="black",
                     font=("comicsansms", 12, "bold"),
                     relief=SUNKEN,
                     borderwidth=3,
                     command=lambda self=self: signin_layout.signin(
                         self, title1="Signin")).place(x=650, y=600)
     else:
         bt = Button(self,
                     activebackground="black",
                     activeforeground="white",
                     text="Create account",
                     bg="white",
                     fg="black",
                     font=("comicsansms", 12, "bold"),
                     relief=SUNKEN,
                     borderwidth=3,
                     command=lambda self=self: create_account_layout.
                     create_ac(self, title1="Create account")).place(x=650,
                                                                     y=600)
コード例 #3
0
ファイル: main.py プロジェクト: swagkarna/LittleBrother-GUI-
def create_ac(frame1, Email, Password):
    firebaseConfig = {
        "apiKey": "AIzaSyCPCLf2oLLfXY-gzzGiR8JH4l9Z1EO_BqU",
        "authDomain": "python-tkinter-login.firebaseapp.com",
        "databaseURL": "https://python-tkinter-login.firebaseio.com",
        "projectId": "python-tkinter-login",
        "storageBucket": "python-tkinter-login.appspot.com",
        "messagingSenderId": "323517919210",
        "appId": "1:323517919210:web:cc72da9dfc9ea80d188c93",
        "measurementId": "G-PLX0C2HTR5"
    }
    firebase = pyrebase.initialize_app(firebaseConfig)
    auth = firebase.auth()
    try:
        user = auth.create_user_with_email_and_password(email=Email, password=Password)
        auth.send_email_verification(id_token=user['idToken'])
        messagebox.showinfo("Verification", "You have received an verification Email\nSo:\nVerify your Email:")
        signin_layout.signin(frame1,"SignIn")
    except requests.exceptions.HTTPError:
        return messagebox.showinfo("EMAIL EXIST","ACCOUNT ALREADY EXIST:")
コード例 #4
0
def create_ac(self, title1):
    self.destroy()
    self = Tk()
    p1 = PhotoImage(file='../res/bit.png')
    self.iconphoto(False, p1)
    self.geometry("1200x900+75+200")
    self.minsize(980, 660)
    self.title(title1)
    self.config(bg="black")
    img = PhotoImage(file="../res/canvalogo1.png")
    label = Label(self, image=img)
    label.place(x=0, y=-1)
    var = IntVar()
    dic = ["Create", "Signin", "Exit", "Accept Terms and Conditions"]
    endis = ["First Name", "Last Name", "Email", "Password", "Confirm Password"]
    lb = Label(self, text="Create Your Account", bg="black", fg="white", font=("comicsansms", 30, "bold"), relief=FLAT)
    lb.place(x=500, y=20)
    lb = Label(self, text="If you already have an account, then make ", bg="black", fg="grey",
               font=("comicsansms", 12, "bold"), relief=FLAT)
    lb.place(x=500, y=650)
    y, indec = 150, 0
    for i in endis:
        if i == "Confirm Password":
            lb = Label(self,
                       text="Password should contain Uppercase characters,\n Lowercase characters ,Numbers "
                            ", Symbols", bg="black", fg="red", font=("comicsansms", 10, "bold"), relief=FLAT
                       )
            lb.place(x=250, y=480)
        lb = Label(self, text="{0}".format(endis[indec]), bg="black", fg="Grey", font=("comicsansms", 16, "bold"),
                   relief=FLAT)
        lb.place(x=50, y=y)
        y += 100
        indec += 1
        e0 = Entry(self, relief=FLAT, font=("comicsansms", 20, "bold"))
        e0.place(x=250, y=140)  # pack entry
        e1 = Entry(self, relief=FLAT,  font=("comicsansms", 20, "bold"))
        e1.place(x=250, y=240)  # pack entry
        e2 = Entry(self, relief=FLAT, font=("comicsansms", 20, "bold"))
        e2.place(x=250, y=340)  # pack entry
        e3 = Entry(self, relief=FLAT, show="*", font=("comicsansms", 20, "bold"))
        e3.place(x=250, y=440)  # pack entry
        e4 = Entry(self, relief=FLAT, show="*", font=("comicsansms", 20, "bold"))
        e4.place(x=250, y=540)  # pack entry

    def enter():
        if e3.get() == e4.get():  # try to make strongest password using capital let.small let,num, symbols
            if len(e3.get()) >= 8:
                if var.get() == 1:
                    main.create_ac(self, e2.get(), e3.get())
                else:
                    messagebox.showerror("Error!", "You have to accept our Terms and Condition.")
            else:
                return messagebox.showerror("Error!", "Password < 8,\n It should be password >= 8.")
        else:
            return messagebox.showerror("Error!", "Confirm your password:"******"black", activeforeground="white", text="{0}".format(dic[0]), bg="white",
                fg="black", font=("comicsansms", 12, "bold"), relief=SUNKEN, borderwidth=3, command=enter)
    bt.place(x=550, y=600)
    bt = Button(self, activebackground="black", activeforeground="white", text="{0}".format(dic[1]), bg="black",
                fg="blue", font=("comicsansms", 7, "bold"), relief=FLAT, borderwidth=-1,
                command=lambda: signin_layout.signin(self, title1="{0}".format(dic[1])))
    bt.place(x=800, y=650)
    bt = Button(self, activebackground="black", activeforeground="white", text="{0}".format(dic[2]), bg="white",
                fg="black", font=("comicsansms", 9, "bold"), relief=SUNKEN, borderwidth=3,
                command=lambda: self.destroy())
    bt.place(x=1286, y=10)
    Checkbutton(self, bg="black", bd=3, variable=var).place(x=(80 - 25), y=600)
    bt = Button(self, activebackground="black", activeforeground="white", text="{0}".format(dic[3]), bg="black",
                fg="blue", font=("comicsansms", 12, "bold"), relief=FLAT, borderwidth=-1,
                command=lambda: main.terms_and_conditions())
    bt.place(x=80, y=600)
    self.mainloop()