예제 #1
0
def runTests():
    binary = FirefoxBinary()
    driver = webdriver.Firefox(firefox_binary=binary)

    # Signup
    driver.get(baseUrl + "signup")
    signup.signup(fname, lname, addressOne, addressTwo, city, state, zipCode,
                  phoneNumber, email, password, driver)

    #Login
    driver.get(baseUrl + "home")
    login.doLogin(email, password, driver)

    # #Add new address location
    driver.get(baseUrl + "notification")
    addlocations.addLoc(nickname, addressOne, city, state, zipCode, driver)
    savenotifications.savenotifications(driver)
    dashboard.doDashboard(driver)

    # #Update account information
    driver.get(baseUrl + "account")
    updateaccount.account(updateFname, updateLname, updateAddress1,
                          updateAddress2, updateCity, updateState,
                          updateZipcode, updatePhone, updateEmail,
                          updateOldPassword, updatePassword,
                          updateConfPassword, driver)
    dashboard.doDashboard(driver)

    driver.find_element_by_id('logout').click()
    driver.close()
예제 #2
0
def test_fold():
    client = WindmillTestClient(__name__)
    signup(client)
    client.click(id=u'play-now-button')
    client.waits.forElement(classname=u'jpoker_table')
    for i in range(100):
        client.click(classname=u'jpoker_ptable_fold')
        client.waits.sleep(milliseconds=5000)
예제 #3
0
	def login(self,user_id):
	
			match_user = 1
			actual_password = ""
			
			user_id = input("ENTER ID: ")
			enter_password = input("ENTER PASSWORD: "******"data_base.db") 
			# cursor 
			crsr = connection.cursor() 
			crsr.execute("SELECT * FROM user")  
			# store all the fetched data in the ans variable 
			ans= crsr.fetchall() 
			print(ans) 
			
			# loop to print all the data 
			for i in ans: 
			    if i[0] == user_id:
			    	print(i[0],i[-1],"Sss")
			    	actual_password =i[-1]
			    	match_user = 0
			    	break

			    	
			# close the connection 
			connection.close() 

			while (enter_password != actual_password or match_user):
				print("Please check deatails again!")
				sign_flag  = int(input("New user ? signup | ENTER 1 | login - ENTER 2 : "))
				if sign_flag ==1:
					signup.signup().signup()
				else:
					user_id = input("ENTER ID: ")
					enter_password = input("ENTER PASSWORD: "******"clear")
			print(user_id)
			print("welcome to read stories enter 1 else 2")
			profile.profile().show_profile(user_id)
def test_os_poker_tourney_register_unregister():
    client = WindmillTestClient(__name__)

    signup(client)
    client.click(xpath=u"//li[@id='lobby_sng']/a")
    client.waits.forElement(classname=u'jpoker_tourney_state_registering')
    client.click(classname=u'jpoker_tourney_state_registering')
    client.waits.sleep(milliseconds=u'1000')
    client.click(id=u"lobby_join_table")
    for i in range(100):
        print i
        client.waits.forElement(value=u'Register')
        client.click(value=u'Register')
        client.waits.forElement(value=u'Unregister')
        client.click(value=u'Unregister')
예제 #5
0
def mainmenu():
    print(
        "**********************************MAIN MENU********************************\n\n1. Sign Up (New Customer)\n2. Sign In (Existing Customer)\n3. Admin Sign In\n4. Exit\n"
    )
    print(
        "***************************************************************************"
    )
    mainmenu = input("Enter Choice:")
    if mainmenu == '1':
        signup.signup()
    elif mainmenu == '2':
        signin.signin()
    elif mainmenu == '3':
        signin.adminsignin()
    elif mainmenu == '4':
        print("\nThank you for choosing our service...")
        exit()
    else:
        print("\nPlease enter a valid option")
예제 #6
0
def signup():
    if request.method == "POST":
        rtn_data: returnData = mysignup.signup(request)
        return render_template("response.html",
                               message=rtn_data.message,
                               backToURL=rtn_data.backToUrl,
                               buttonCaption=rtn_data.caption)
    elif request.method == "GET":
        return render_template("register.html",
                               signupURL=signupAddress,
                               loginURL=loginAddress)
예제 #7
0
def snap_main():
	print("@@@@Welcome to SnapQuick@@@@")
	print("")

	log = int(input("Enter '1': Login | Enter '2': signup: "))
	print("")


	connection  = sqlite3.connect("data_base.db")
	crsr = connection.cursor()
	sql_command = """ CREATE TABLE if not exists user(user_id char,fname char,lname char,gender char,email_id char,phone_number int,password char)"""
	crsr.execute(sql_command)

	#check log or sign
	if log==1:

		login.login().login(user_id)

	else:
		signup.signup().signup()
예제 #8
0
    def locateChild(self, ctx, segments):
        if segments[0] == "" or segments[0] == "index.html":
            return self, []
        if len(segments[0]) < 4 or len(segments[0]) > 20:
            return rend.NotFound
        elif segments[0] == "site":
            return dyn_site_root(), []
        elif segments[0] == "signup":
            return signup(), []
        elif segments[0] == "upgrade":
            return user_upgrade(), []
        elif segments[0] == "free_account":
            return free_account(), []
        elif segments[0] == "downloads":
            return downloads(), []
        elif segments[0] == "qoop":
            return qoop(), segments[1:]
        if "reset_password" in segments[0]:
            request = inevow.IRequest(ctx)
            if request.args.has_key('username') and request.args.has_key(
                    'hash'):
                return reset_password(), []
            else:
                return rend.NotFound
        if "quick_start_guide" in segments[0]:
            return quick_start_guide(), []
        if "features" in segments[0]:
            return features(), []
        if "developers" in segments[0]:
            return developers(), []
        if "publish" in segments[0]:
            return user_publish("unknown"), segments[1:]
        if "community" in segments[0] and "feeds" in segments[1]:
            obj = user_homepage("")
            obj.username = "******"  # have to hack this because the user_homepage ctor
            # lowercases it
            return obj, segments[1:]

        def act_check(count):
            if count:
                return user_homepage(segments[0]), segments[1:]
            else:
                if segments[1] == "img":
                    return dyn_image_handler("noserve", self.app,
                                             self.log), segments[2:]
                else:
                    return rend.NotFound

        d = self.app.api.users.check_exists('username', segments[0])
        d.addCallback(act_check)
        return d
예제 #9
0
def login():
    username = str(input("Enter name:")).lower()
    password = str(input("Enter password:"******"Logged in!")
            game.main(lineUser)
        else:
            print("It Does not Match :(")
    else:
        print("User not found")
        registerNewUser = bool(input("Do you wanna join? y/n?") == 'y')
        if registerNewUser:
            signup.signup(username, password)
            game.main(username)
        else:
            exit()
	def locateChild(self, ctx, segments):
		if segments[0] == "" or segments[0] == "index.html":
			return self, []
		if len(segments[0]) < 4 or len(segments[0]) > 20:
			return rend.NotFound
		elif segments[0] == "site":
			return dyn_site_root(), []
		elif segments[0] == "signup":
			return signup(), []
		elif segments[0] == "upgrade":
			return user_upgrade(), []
		elif segments[0] == "free_account":
			return free_account(), []
		elif segments[0] == "downloads":
			return downloads(), []
		elif segments[0] == "qoop":
			return qoop(), segments[1:]
		if "reset_password" in segments[0]:
			request = inevow.IRequest(ctx)
			if request.args.has_key('username') and request.args.has_key('hash'):
				return reset_password(), []
			else:
				return rend.NotFound
		if "quick_start_guide" in segments[0]:
			return quick_start_guide(), []
		if "features" in segments[0]:
			return features(), []
		if "developers" in segments[0]:
			return developers(), []
		if "publish" in segments[0]:
			return user_publish("unknown"), segments[1:]
		if "community" in segments[0] and "feeds" in segments[1]:
			obj = user_homepage("")
			obj.username = "******" # have to hack this because the user_homepage ctor
			                       # lowercases it
			return obj, segments[1:]

		def act_check(count):
			if count:
				return user_homepage(segments[0]), segments[1:]
			else:
				if segments[1] == "img":
					return dyn_image_handler("noserve", self.app, self.log), segments[2:]
				else:
					return rend.NotFound

		d = self.app.api.users.check_exists('username', segments[0])
		d.addCallback(act_check)
		return d
예제 #11
0
    def post(self):
        parser = reqparse.RequestParser()
        parser.add_argument("code")
        parser.add_argument("email")
        parser.add_argument("pin")
        parser.add_argument("devid")
        parser.add_argument("user_half_secret")
        args = parser.parse_args()

        try:
            user_hash = signup(args["email"], args["pin"], args["devid"],
                               args["code"], args["user_half_secret"])

            response_data = {"status": "success", "user_hash": user_hash}
        except (DataBaseError, CodeError) as err:
            response_data = {"status": "failure", "error": err.args[0]}

        return response_data
예제 #12
0
def parse(data, conn, cursor):
	decodedData = json.loads(data)
	function = decodedData['function']

	if(function == 'login'):
		print 'login'
		return login.loginTo(decodedData, conn, cursor)
	elif(function == 'signup'):
		print 'signup'
		return signup.signup(decodedData, conn,cursor)
	elif(function == 'addLocation'):
		print 'Add Location'
		return addLocation.addLocation(decodedData, conn, cursor)
	elif(function == 'thumbsUp'):
		print 'thumbsUp'
		thumbsUp.thumbsUp(decodedData, conn, cursor)
	elif(function == 'thumbsDown'):
		print 'thumbsDown'
		thumbsDown.thumbsDown(decodedData, conn, cursor)
	elif(function == 'getLocation'):
		print 'getLocation'
		return getLocation.getLocation(decodedData, conn, cursor)
	elif(function=='setThumb'):
		print 'setThumb'
		setThumb.setThumb(decodedData, conn, cursor)
	elif(function=='getThumb'):
		print 'getThumb'
		return getThumb.getThumb(decodedData, conn,cursor)
	elif(function == 'addComment'):
		print 'addComment'
		return addComment.addComment(decodedData, conn, cursor)
	elif(function == 'addPicture'):
		print 'addPicture'
		return addPicture.testPicture(decodedData, conn, cursor)
	elif(function == 'getPicture'):
		print 'getPicture'
		return getPicture.getPicture(decodedData, conn, cursor)
	elif(function=='getClosestLocation'):
		print 'getClosestLocation'
		return getClosestLocation.getClosestLocation(decodedData, conn, cursor)
	else:
		print 'Bad function'
		return
예제 #13
0
def parse(data, conn, cursor):
    decodedData = json.loads(data)
    function = decodedData['function']

    if (function == 'login'):
        print 'login'
        return login.loginTo(decodedData, conn, cursor)
    elif (function == 'signup'):
        print 'signup'
        return signup.signup(decodedData, conn, cursor)
    elif (function == 'addLocation'):
        print 'Add Location'
        return addLocation.addLocation(decodedData, conn, cursor)
    elif (function == 'thumbsUp'):
        print 'thumbsUp'
        thumbsUp.thumbsUp(decodedData, conn, cursor)
    elif (function == 'thumbsDown'):
        print 'thumbsDown'
        thumbsDown.thumbsDown(decodedData, conn, cursor)
    elif (function == 'getLocation'):
        print 'getLocation'
        return getLocation.getLocation(decodedData, conn, cursor)
    elif (function == 'setThumb'):
        print 'setThumb'
        setThumb.setThumb(decodedData, conn, cursor)
    elif (function == 'getThumb'):
        print 'getThumb'
        return getThumb.getThumb(decodedData, conn, cursor)
    elif (function == 'addComment'):
        print 'addComment'
        return addComment.addComment(decodedData, conn, cursor)
    elif (function == 'addPicture'):
        print 'addPicture'
        return addPicture.testPicture(decodedData, conn, cursor)
    elif (function == 'getPicture'):
        print 'getPicture'
        return getPicture.getPicture(decodedData, conn, cursor)
    elif (function == 'getClosestLocation'):
        print 'getClosestLocation'
        return getClosestLocation.getClosestLocation(decodedData, conn, cursor)
    else:
        print 'Bad function'
        return
예제 #14
0
import sys
from login import login
from signup import signup
from createJournal import createJournal
from listJournal import listJournal

while True:
    loginSignup = int(input("Enter 1 for Signup or 2 for Login or 3 for exit\n"))

    if loginSignup == 1:
        username = signup()
        if username is None:
            continue
        break
    elif loginSignup == 2:
        username = login()
        if username is None:
            continue
        break
    elif loginSignup == 3:
        sys.exit()
    else:
        print("Please choose correct option")
        continue

while True:
    journalOption = int(input("Enter 1 to list all your entries or 2 to create a new entry or 3 for exit\n"))
    if journalOption == 1:
        listJournal(username)
        continue
    elif journalOption == 2:
예제 #15
0
 def signup(self):
     self.ui1 = signup.signup()
     self.close()
     self.ui1.show()
예제 #16
0
def accept_request():

    if request.method == 'POST':
        keys = []

        for i in request.form.keys():
            keys.append(i)

        # print(keys)

        if 'login' in keys:
            data = request.form['login']

            login_player = login(db_host, db_user, db_psswrd, db)
            response = login_player.player_login_details(
                tuple(data.split('&')), request.form['type_of_login'])
            return str(response)

        if 'signup' in keys:
            data = request.form['signup']
            details = data.split('&')
            signup_player = signup(db_host, db_user, db_psswrd, db)
            availablity_username, response_code = signup_player.sign_up(
                details[0], details[1], details[2], details[3], details[4])
            return str(availablity_username) + '&' + str(response_code)

        if 'check_username' in keys:
            data = request.form['check_username']
            signup_player = signup(db_host, db_user, db_psswrd, db)
            a = str(signup_player.check_unique_data(('ds', (data))))
            return a

        if 'player_info' in keys:
            data = request.form['player_info']
            player_info_ = player_info(db_host, db_user, db_psswrd, db)
            details = ''
            for i in player_info_.get_user_details(data):
                details = details + '&' + str(i)

            details = details[1:]
            return details

        if 'check_mailid' in keys:
            data = request.form['check_mailid']
            signup_player = signup(db_host, db_user, db_psswrd, db)
            a = str(signup_player.check_unique_data(((data), 'ds')))
            return a

        if 'chest_update' in keys:
            chest_n = request.form['chest_update']
            player_id = request.form['id']
            action = request.form['action']
            chest_update = player_stats(db_host, db_user, db_psswrd, db)
            chest_update.update_chest_info(chest_n, player_id, action)
            return "DONE"

        if 'player_res_gained' in keys:
            res_gained = tuple(request.form['player_res_gained'].split('&'))
            player_id = request.form['id']
            res_update = player_stats(db_host, db_user, db_psswrd, db)
            res_update.update_player_res(res_gained, player_id)
            return "DONE"

        if 'emote_buy' in keys:
            bill_details = request.form['emote_buy'].split('&')
            shop_manage = shop_manager(db_host, db_user, db_psswrd, db)
            shop_manage.buy_emote(bill_details[0], bill_details[1])
            return "BILL ACCEPTED"

        if 'emote_cost' in keys:
            shop_manage = shop_manager(db_host, db_user, db_psswrd, db)
            return shop_manage.get_emote_cost()

        if 'match_making' in keys:
            player_details = request.form['match_making'].split('&')
            mc = match_control(db_host, db_user, db_psswrd, db)
            mc.add_player_to_que(player_details[0], list(player_details[1:]))
            return "ADDED"

        if 'remove' in keys:
            player_details = request.form['remove']
            mc = match_control(db_host, db_user, db_psswrd, db)
            mc.remove_player(player_details)
            return "CANCELLED"

        if 'check_for_match' in keys:
            player_details = request.form['check_for_match']
            mc = match_control(db_host, db_user, db_psswrd, db)
            a = mc.check_for_players(player_details)
            return a

        if 'opp_id' in keys:
            details = request.form['opp_id'].split('&')
            mc = match_control(db_host, db_user, db_psswrd, db)
            a = mc.get_opp_id(details[0], details[1])
            return a

        if 'update_player' in keys:
            details = request.form['update_player'].split('&')
            mc = match_control(db_host, db_user, db_psswrd, db)
            mc.update_player_details(details[:-1], details[-1])
            return "UPDATED"

        if 'delete_room' in keys:
            room = request.form['delete_room']
            mc = match_control(db_host, db_user, db_psswrd, db)
            mc.delete_the_room(room)
            return "DONE"

        if 'get_player_game_details' in keys:
            details = request.form['get_player_game_details'].split('&')
            mc = match_control(db_host, db_user, db_psswrd, db)
            a = mc.get_data_to_render(details[0], details[1])
            return a[0] + "&" + a[1]

        if 'master_control' in keys:
            details_query = request.form['master_control'].split('&')
            data = ""
            if len(details_query) == 1:
                a = master_control(db_host, db_user, db_psswrd, db)
                data = a.action_to_do("read", details_query[0])

            if len(details_query) == 2:
                a = master_control(db_host, db_user, db_psswrd, db)
                data = a.action_to_do("modify", details_query[0],
                                      details_query[1])

            return data

        if 'create_db' in keys:
            a = create_db(db_host, db_user, db_psswrd, db)
            return "SUCESS"

        if 'testing' in keys:
            import requests
            import time

            a = time.time()

            requests.post('https://thekeres.herokuapp.com/',
                          {"master_control": 'SELECT * FROM MATCH_MAKING'})

            b = time.time()

            c = b - a
            print(c)
            return str(c)

    else:
        return 'invalid'
def employee(root):
    def store(v):
        if e1.get() == "" or e2.get() == "":  #Condition to check Empty Fields
            messagebox.showinfo("ERROR3", "Each Field is Mandatory")

        else:

            res = []
            p.execute('''select username from employee1''')
            result = p.fetchall()
            for row in result:
                if row[0] == e1.get():
                    p.execute(
                        "select password from employee1 where username='******';")
                    result1 = p.fetchall()
                    name = e1.get()
                    if result1[0][0] == e2.get():
                        messagebox.showinfo("Success",
                                            "Logged In Successfully")
                        p.execute(
                            "select designation from employee1 where username='******';")
                        result2 = p.fetchall()
                        desig = result2[0][0]
                        e1.delete(0, 'end')
                        e2.delete(0, 'end')
                        login.login(v, root, name, desig)
                        break
            else:
                flag = False
                p.execute("select username from employee1")
                res = p.fetchall()
                for row in res:
                    if row[0] == e1.get():
                        flag = True
                #print(flag)
                if flag == False:
                    messagebox.showinfo("Error", "Wrong Username")
                else:
                    flag = False
                    p.execute(
                        "select password from employee1 where username='******';")
                    res1 = p.fetchall()
                    for row in res1:
                        if row[0] == e2.get():
                            flag = True
                    #print(flag)
                    if flag == False:
                        messagebox.showinfo("Error", "Wrong password")
                v.deiconify()

    i = 3
    v = Toplevel(root)
    v.title("employee")
    v.minsize(1250, 700)
    background_img = PhotoImage(file="./bg1.png")
    background_label = Label(v, image=background_img)
    background_label.pack(fill=BOTH, expand=True)
    #employee="employee"

    #print(employee)

    #BUTTON

    b1 = Button(v,
                bg="steelblue2",
                fg="black",
                text='HOME',
                font="Bold 10",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=15,
                command=lambda: home(root, v))
    b1.place(x=600, y=20)
    b2 = Button(v,
                bg="steelblue2",
                fg="black",
                text='MANAGER',
                font="Bold 10",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=15,
                command=lambda: manager.manager(v))
    b2.place(x=750, y=20)

    b3 = Button(v,
                bg="white",
                fg="black",
                text='EMPLOYEE',
                font="Bold 10",
                pady=3.0,
                relief=GROOVE,
                height=1,
                width=15)
    b3.place(x=900, y=20)

    b4 = Button(v,
                bg="steelblue2",
                fg="black",
                text='ACCOUNT DETAILS',
                font="Bold 10",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=15,
                command=lambda: admin.admin(v))
    b4.place(x=1050, y=20)

    l1 = Label(v,
               font="Bold 15",
               fg="BLACK",
               bg="lightcyan",
               text="Username: "******"Bold 15",
               fg="BLACK",
               bg="lightcyan",
               text="Password  : "******"*")
    l1.place(x=500, y=250)
    l2.place(x=500, y=300)
    e1.place(x=700, y=250)
    e2.place(x=700, y=300)

    b5 = Button(v,
                bg="DEEP SKY BLUE",
                fg="Black",
                text='LOGIN',
                font="Bold 10",
                pady=3.0,
                relief=RAISED,
                height=1,
                width=15,
                command=lambda: store(v))
    b5.place(x=600, y=350)
    b6 = Button(v,
                bg="lightcyan",
                fg="NAVY BLUE",
                text='New User? Sign Up Here.',
                font="Bold 15",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=20,
                command=lambda: signup.signup(v, root, "employee1"))
    b6.place(x=580, y=390)

    #c=con.cursor()
    #result=c.execute('''select * from employee1''')
    '''con.commit()
        for row in result:
                        print(row[0],end=', ')
                        print(row[1],end=', ')
                        print(row[2],end=', ')
                        print(row[3],end=', ')
                        print(row[4])'''

    root.withdraw()
    v.mainloop()

    return v
    print('3. mencari pemain')
    print('4. mencari wahana')
    print('5. melihat kritik dan saran')
    print('6. menambahkan wahana baru')
    print('7. top up saldo')
    print('8. melihat riwayat penggunaan wahana')
    print('9. melihat jumlah tiket pemain')
    print('10. upgrade golden account')
    print('11. exit')

masukan = str(input('Masukkan nomor fitur yang diinginkan: '))
while (masukan != '15'):
    if (masukan == '1'):
        savefile.save(user,wahana,pembelian,penggunaan,kepemilikan,refund,kritiksaran)
    elif(masukan == '2' and datauser[5] == 'Admin'):
        user = signup.signup(datauser,user)
    elif (masukan == '3' and  datauser[5] == 'Admin'):
        caripemain.caripemain(datauser,user)
    elif (masukan == '2' and datauser[5] == 'Pemain') or (masukan == '4' and datauser[5] == 'Admin'):
        cariwahana.cari(datauser,wahana)
    elif (masukan == '3' and datauser[5] == 'Pemain'):
        (user,datauser,pembelian,kepemilikan) = beli_tiket.belitiket(datauser, user, wahana, kepemilikan, pembelian)
    elif (masukan == '4' and datauser[5] == 'Pemain'):
        (kepemilikan,penggunaan) = menggunakantiket.menggunakantiket(datauser, kepemilikan, penggunaan)
    elif (masukan == '5' and datauser[5] == 'Pemain'):
        (user,kepemilikan,datauser,refund) = r3fund.uangkembali(user,wahana,datauser,kepemilikan,refund)
    elif (masukan == '6' and datauser[5] == 'Pemain'):
        kritiksaran = kritikdansaran.kritiksaran1(datauser, kritiksaran)
    elif (masukan == '5' and  datauser[5] == 'Admin'):
        lihat_laporan.lihat_laporan(datauser,kritiksaran)
    elif (masukan == '6' and  datauser[5] == 'Admin'):
예제 #19
0
from login import login
from signup import signup
print(
    "please user select one you want her 'c' stand for create while 's' stands for sigin"
)
p = input("type her ")
c = "c"
s = "s"
if (p == str(c)):
    sig = signup()
elif (p == str(s)):
    log = login()
else:
    print("you lost close and start")
예제 #20
0
 def ok (self):
         self.ui=signup.signup()
         self.close()
         self.ui.show()
def manager(root):
    def store(a):
        if e1.get() == "" or e2.get() == "":  #Condition to check Empty Fields
            messagebox.showinfo("ERROR3", "Each Field is Mandatory")
            print("error1")

        else:
            con = sqlite3.connect('database.db')
            p = con.cursor()
            res = []
            result = p.execute('''select username from manager''')
            #con.commit()
            '''for row in result:
                                        #print(row[0],end=', ')
                                        #print(row[1],end=', ')
                                res.append(row[2])
                                        #print(row[3],end=', ')
                                        #print(row[4])'''

            for row in result:
                if row[0] == e1.get():
                    result1 = p.execute(
                        "select * from manager where username='******';")
                    #con.commit()
                    print(result1)
                    for row in result1:
                        pas = row[4]
                        #print(pas)
                    if pas == e2.get():
                        messagebox.showinfo("Success",
                                            "Logged In Successfully")
                        e1.delete(0, 'end')
                        e2.delete(0, 'end')
                        login_manager.login_manager(a, root)
                        break
            else:
                flag = False
                p.execute("select username from manager")
                res = p.fetchall()
                for row in res:
                    if row[0] == e1.get():
                        flag = True
                #print(flag)
                if flag == False:
                    messagebox.showinfo("Error", "Wrong Username")
                else:
                    flag = False
                    p.execute("select password from manager where username='******';")
                    res1 = p.fetchall()
                    for row in res1:
                        if row[0] == e2.get():
                            flag = True
                    #print(flag)
                    if flag == False:
                        messagebox.showinfo("Error", "Wrong password")
                a.deiconify()

    i = 3
    a = Toplevel(root)
    a.title("manager")
    a.minsize(1250, 700)
    background_img = PhotoImage(file="./bg1.png")
    background_label = Label(a, image=background_img)
    background_label.pack(fill=BOTH, expand=True)

    #BUTTON

    b1 = Button(a,
                bg="steelblue2",
                fg="black",
                text='HOME',
                font="Bold 10",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=15,
                command=lambda: home(root, a))
    b1.place(x=600, y=20)
    b2 = Button(a,
                bg="white",
                fg="black",
                text='MANAGER',
                font="Bold 10",
                pady=3.0,
                relief=GROOVE,
                height=1,
                width=15)
    b2.place(x=750, y=20)

    b3 = Button(a,
                bg="steelblue2",
                fg="black",
                text='EMPLOYEE',
                font="Bold 10",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=15,
                command=lambda: employee.employee(a))
    b3.place(x=900, y=20)

    b4 = Button(a,
                bg="steelblue2",
                fg="black",
                text='ADMIN',
                font="Bold 10",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=15,
                command=lambda: admin.admin(a))
    b4.place(x=1050, y=20)

    l1 = Label(a,
               font="Bold 15",
               fg="BLACK",
               bg="lightcyan",
               text="Username : "******"Bold 15",
               fg="BLACK",
               bg="lightcyan",
               text="Password  : "******"*")
    l1.place(x=500, y=250)
    l2.place(x=500, y=300)
    e1.place(x=700, y=250)
    e2.place(x=700, y=300)
    b5 = Button(a,
                bg="DEEP SKY BLUE",
                fg="black",
                text='LOGIN',
                font="Bold 10",
                pady=3.0,
                relief=RAISED,
                height=1,
                width=15,
                command=lambda: store(a))
    b5.place(x=600, y=350)
    b5 = Button(a,
                bg="lightcyan",
                fg="NAVY BLUE",
                text='New User? Sign Up Here.',
                font="Bold 15",
                pady=3.0,
                relief=FLAT,
                height=1,
                width=20,
                command=lambda: signup.signup(a, root, "manager"))
    b5.place(x=580, y=390)
    root.withdraw()
    a.mainloop()

    return a
예제 #22
0
import falcon

from signup import signup
from login import login
from activeprj import gPrj

from falcon.http_status import HTTPStatus


#gunicorn -b 0.0.0.0:5000 auth_signup:api --reload &
class HandleCORS(object):
    def process_request(self, req, resp):
        resp.set_header('Access-Control-Allow-Origin', '*')
        resp.set_header('Access-Control-Allow-Methods', '*')
        resp.set_header('Access-Control-Allow-Headers', '*')
        resp.set_header('Access-Control-Max-Age', 1728000)  # 20 days
        if req.method == 'OPTIONS':
            raise HTTPStatus(falcon.HTTP_200, body='\n')


#wsgi_app = api = falcon.API(middleware=[HandleCORS() ])
api = falcon.API(middleware=[HandleCORS()])

signup = signup()
login = login()
gprj = gPrj()

api.add_route('/api/v1/signup', signup)
api.add_route('/api/v1/login', login)
api.add_route('/api/v1/getAllProj', gprj)