import helper,psql maxuser = 1000 def display_create_form(req,form): """ gets a request object and a util.FieldStorage form. writes a HTML page containing one name and two password fields. """ data = """
""" % helper.generate_session_id() req.write(data) def process_form(req,form): """ gets a request object and a util.FieldStorage form. Tries to read out username, password1 and password2 from form. If all needed data is there, create the named user and return a 'success' page. Else fail with detailed error. """ try: password1 = form["password1"] except: password1 = "" try: password2 = form["password2"] except: password2 = "" try: username = form["username"] except: username = "" if (username != "") and (password1 != "") and (password2 != "") and (password1 == password2): psql.add_webgo_user(username,password1) req.write("User %s has been successfully created. Click the following button to login: