Comment 5 for bug 1720237

Revision history for this message
Niranjan (niranjan528) wrote :

URL: https://bugs.launchpad.net/mahara/+bug/1720237

Bug description: Adding default user name to use in registration

Environment to be tested: Master
Browser to be tested: Any browser

Precondition:
1. An Institution admin user ‘Inst one’ should exist.
2. Make sure to allow emails by changing the config file to "$cfg->sendemail = true;"
3. Save the config file by making changes to "$cfg->sendallemailto = '<valid email>';"

Note: ‘Valid email’ here is your personal email address.

Steps to reproduce:

1. Log in as ‘Inst one’.
2. Navigate to Administration menu > Institutions > Settings.
3. Click the ‘Settings’ button for ‘Institution one’.
4. Switch ‘Registration allowed’ to ‘Yes’.
5. Switch ‘Confirm registration’ to ‘No’.
6. Click the ‘Submit’ button.
7. Log out from the ‘Inst admin’ user.
8. Click the ‘Register’ link on the Mahara login screen.
9. Enter ‘First name’ & ‘Last name’ with the text ‘<script>alert(1)</script>’.
10. Enter the email that is used at the precondition 3 under ‘Email address’.
11. Click the ‘Register’ button.

Expected result: Registration email with sign-up link should be sent.

12. Click the ‘Registration link’ that is sent to the email.

Expected result: ‘New username’ field should fill with text as ‘user’ by default.

13. Enter the ‘New password’ & ‘Confirm password’.
14. Enter the ‘First name’ & ‘Last name’.
15. Click the ‘Submit’ button.

Expected result: The user should log in successfully and the text ‘Your new password has been saved’ should be displayed on the screen.

16. Log out of the user.
17. Repeat steps 8 to 12 but make sure to use different email at step 10.

Expected result: ‘New username’ field should fill with text as ‘user1’ by default.

Note: By repeating steps 8 to 12 the default 'New username' should be incremented by one, for example user2, user3, and user4.