예제 #1
0
 def POST(self):
     post_params = web.input()
     username = post_params['userID']
     password = post_params['password']
     confirmPassword = post_params['confirmPassword']
     if username == "":
         return render_template('create_account.html',
                                message="Please enter a non-empty username")
     if password == "":
         return render_template('create_account.html',
                                message="Please enter a non-empty password")
     if password != confirmPassword:
         return render_template(
             'create_account.html',
             message="Password does not match Confirm Password!")
     usernameExistCheck = sqlitedb.getPassword(username)
     if len(usernameExistCheck) != 0:
         message = "Username '"
         message = message + username
         message = message + "' already exists. Please choose a different username!"
         return render_template('create_account.html', message=message)
     else:
         sqlitedb.addUser(username, password)
         sqlitedb.addAboutMe(username, "Currently no about me.")
         session.user = username
         return web.redirect('/hello')
예제 #2
0
파일: grub.py 프로젝트: vchang2/grub
 def POST(self):
     post_params = web.input()
     userIDInput = post_params['userID']
     passwordInput = post_params['password']
     actualPasswordResult = sqlitedb.getPassword(userIDInput)
     if len(actualPasswordResult) == 0:
         return render_template('login.html', message = "Username " + userIDInput + " does not exist.")
     else:
         actualPassword = actualPasswordResult[0]['Password']
         if passwordInput == actualPassword:
             session.user = userIDInput
             return web.redirect('/hello')
         else:
             return render_template('login.html', message = "Please enter the correct password.")
예제 #3
0
 def POST(self):
     post_params = web.input()
     userIDInput = post_params['userID']
     passwordInput = post_params['password']
     actualPasswordResult = sqlitedb.getPassword(userIDInput)
     if len(actualPasswordResult) == 0:
         return render_template('login.html',
                                message="Username " + userIDInput +
                                " does not exist.")
     else:
         actualPassword = actualPasswordResult[0]['Password']
         if passwordInput == actualPassword:
             session.user = userIDInput
             return web.redirect('/hello')
         else:
             return render_template(
                 'login.html', message="Please enter the correct password.")
예제 #4
0
파일: grub.py 프로젝트: vchang2/grub
 def POST(self):
     post_params = web.input()
     username = post_params['userID']
     password = post_params['password']
     confirmPassword = post_params['confirmPassword']
     if username == "":
         return render_template('create_account.html', message = "Please enter a non-empty username")
     if password == "":
         return render_template('create_account.html', message = "Please enter a non-empty password")
     if password != confirmPassword:
         return render_template('create_account.html', message = "Password does not match Confirm Password!")
     usernameExistCheck = sqlitedb.getPassword(username)
     if len(usernameExistCheck) != 0:
         message = "Username '"
         message = message + username
         message = message + "' already exists. Please choose a different username!"
         return render_template('create_account.html', message = message)
     else:
         sqlitedb.addUser(username, password)
         sqlitedb.addAboutMe(username, "Currently no about me.")
         session.user = username
         return web.redirect('/hello')