def post(self): # writeToFile('database.txt', "13:38: Slava: I'm a pro, too :(") sendPush( self.request.get("text") + "; rot13: " + rot13(self.request.get("text")), "ROT13", readIp(self.request)) self.response.write( template % {"textarea": escape_html(rot13(self.request.get("text")))})
def get(self): sendPush("We've got a guest at SignUp page!", "New user", readIp(self.request)) self.response.write(template % {"username": "", "email": "", "username_error": "", "password_error": "", "pass_verify_error": "", "email_error": "" })
def post(self): username = self.request.get('username') password = self.request.get('password') repeated_pass = self.request.get('verify') email = self.request.get('email') if valid_username(username) and valid_password(password) and valid_repeat_pass(password, repeated_pass) and valid_email(email): sendPush(username + " entered some valid data.", "SignUp", readIp(self.request)) self.redirect("/signup/welcome?username="******"" if valid_username(username) else "<span style='color: red'>bad name</span>" passwordError = "" if valid_password(password) else "<span style='color: red'>bad password</span>" pverifyError = "" if valid_repeat_pass(password, repeated_pass) else "<span style='color: red'>bad repeated password</span>" emailError = "" if valid_email(email) else "<span style='color: red'>bad email</span>" # self.response.write("Here we go again, " + username) sendPush(username + " entered some invalid data.", "SignUp", readIp(self.request)) self.response.write(template % {"username": escape_html(username), "email": escape_html(email), "username_error": usernameError, "password_error": passwordError, "pass_verify_error": pverifyError, "email_error": emailError })
def post(self): user_month = self.request.get('month') user_day = self.request.get('day') user_year = self.request.get('year') month = valid_month(user_month) day = valid_day(user_day) year = valid_year(user_year) if not (month and day and year): self.write_form("That doesn't look valid to me, friend.", user_month, user_day, user_year) else: sendPush( "The man entered: " + str(day) + " " + month + " " + str(year), "B-day", readIp(self.request)) self.redirect("/thanks")
def get(self): sendPush("Someone has opened rot13!", "ROT13", readIp(self.request)) self.response.write(template % {"textarea": ""})
def get(self): sendPush("We got him at birthday page!", "B-day", readIp(self.request)) self.write_form()