add confirm password field
This commit is contained in:
		| @@ -91,6 +91,7 @@ def register(): | ||||
|     elif request.method == 'POST': | ||||
|         username = request.form['username'] | ||||
|         password = request.form['password'] | ||||
|         confirmpassword = request.form['confirmpassword'] | ||||
|         captcha_answer = request.form['captchaa'] | ||||
|         captcha_filename = request.form['captchaq'] | ||||
|         captcha_path = CAPTCHA_PATH + captcha_filename | ||||
| @@ -117,6 +118,10 @@ def register(): | ||||
|         if len(password) < 8: | ||||
|             return 'Error: password is too short' | ||||
|  | ||||
|         # Check lenght of password | ||||
|         if password != confirmpassword: | ||||
|             return 'Error: passwords do not match' | ||||
|  | ||||
|         # Check if username has uppercase | ||||
|         if username.islower() == False: | ||||
|             return 'Error: uppercase characters in username are not allowed' | ||||
|   | ||||
| @@ -17,6 +17,8 @@ | ||||
|             <input type="text" name="username" id="username" placeholder="username" required> | ||||
|             <label for="password">password</label> | ||||
|             <input type="password" name="password" id="password" placeholder="password" required> | ||||
|             <label for="confirmpassword">password</label> | ||||
|             <input type="confirmpassword" name="confirmpassword" id="confirmpassword" placeholder="confirmpassword" required> | ||||
|             <p>password must be at least 8 characters long<p> | ||||
|             <br> | ||||
|             <img src=/account/register/captcha_img/{{ imgsrc }} alt="{{ captchahash }}" style="width:200;margin:auto;"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user