Beispiel #1
0
def parseArgs(args):
    '''
    Parse arguments using online database functions
    '''
    if args.user:
        # login user if username provided
        loginUser(args.user)
    else:
        # prompt login if no user given
        loginUser()

    if args.add:
        addServicePrompt(args.add)
    if args.edit:
        editServicePrompt(args.edit)
    if args.list:
        listServicesPrompt()
    if args.name:
        getNamePrompt(args.name)
    if args.password:
        getPassPrompt(args.password)
    if args.remove:
        removeServicePrompt(args.remove)
    if args.www:
        getUrlPrompt(args.www)
    quit()
Beispiel #2
0
def main_prog():
    print("\t***Welcome***\n\n")
    print("\n\t1:Signup\n\n\t2:Login\n\n")
    ch = int(input("Enter your ch:"))
    if (ch == 1):
        signup.dataEntry()
        input()
        main_prog()
    elif (ch == 2):
        login.loginUser()
    else:
        exit()
Beispiel #3
0
def mainProgram():
    print("***Welcome***\n")
    createDatabase()
    ch = int(input("\n1:Login\n2:Signup\n3:Exit\n\nEnter your choice:"))
    if (ch == 1):
        login.loginUser()
        input()
        mainProgram()
    elif (ch == 2):
        signup.signupUser()
        input()
        mainProgram()
    elif (ch == 3):
        exit()
    else:
        print("\nPlease select a valid option....")
Beispiel #4
0
def loginPageHandler():
    if request.method == 'POST':
        if request.form['submit'] == 'register':
            registerForm.registerSubmit(request.form)
            return render_template('index.html')
        elif request.form['submit'] == 'login':
            check = login.loginUser(request.form)
            if check:
                return redirect(url_for('profile'))
            else:
                return render_template('index.html')
    else:
        return "false request"
def login():
    if request.method == "POST":
        try:
            if request.form["searchText"]:
                searchText = request.form["searchText"]
                return redirect(url_for('search', searchText=searchText))
        except:
            username = str(request.form["username"])
            password = str(request.form["password"])

            if loginUser(username, password):
                return redirect(url_for("index"))
    if current_user.is_authenticated:
        return redirect(url_for("index"))
    return render_template("loginU.html")
import login
print("****Welcome****")
print("Please enter Username and Password")
login.loginUser()
Beispiel #7
0
def login():
    if request.method == 'POST':
        return loginUser(request.form['email'], request.form['password'])