Creating end-user accounts: Difference between revisions
(New page: =Registration and login = It is likely that your intervention will need a registration page to allow end-users to sign up for an intervention. Getting your end-users to register for an...) |
No edit summary |
||
Line 13: | Line 13: | ||
== The | == The Registration Page == | ||
The registration page will need to include an option to enter: | The registration page will need to include an option to enter: | ||
# A username OR e-mail address | # A username OR e-mail address | ||
# A password (These two pieces of information will be used together to create the user account in the logic of the intervention (more info below)) | # A password (These two pieces of information (1 and 2) will be used together to create the user account in the logic of the intervention (more info below)) | ||
# Any other information that you may want them to enter (e.g. a box to tick to say they agree to the study, e-mail address or phone number for sending automated messages etc) | # Any other information that you may want them to enter (e.g. a box to tick to say they agree to the study, e-mail address or phone number for sending automated messages etc) | ||
Line 49: | Line 49: | ||
== Creating User | == Creating User Accounts: The logic == | ||
This section will introduce you to the following logic commands <code> makenewuser </code> and <code> authenticateuser </code>. The logic command <code> set </code>is also used to make sure that the person’s username can be used for further logic commands throughout the rest of the intervention. | This section will introduce you to the following logic commands <code> makenewuser </code> and <code> authenticateuser </code>. The logic command <code> set </code>is also used to make sure that the person’s username can be used for further logic commands throughout the rest of the intervention. |
Revision as of 19:39, 16 September 2010
Registration and login
It is likely that your intervention will need a registration page to allow end-users to sign up for an intervention.
Getting your end-users to register for an intervention is highly recommended if:
- It is anticipated that they will be using your intervention more than once. This allows:
- all instances of using the intervention to be recorded against the same person
- you to save data from the end-user in previous sessions to be shown or used in later sessions
- end-user’s information to stay secure.
- You will be collecting data from your intervention (interventions that do not get the person to register records all users as ‘anon’)
- Collecting an e-mail address or mobile number during the registration process will allow you to send text or email messages to the end-user.
The Registration Page
The registration page will need to include an option to enter:
- A username OR e-mail address
- A password (These two pieces of information (1 and 2) will be used together to create the user account in the logic of the intervention (more info below))
- Any other information that you may want them to enter (e.g. a box to tick to say they agree to the study, e-mail address or phone number for sending automated messages etc)
A username or e-mail address
In order to create a new user account, it is necessary to have a unique username for each user. This username can be an email address, or it can be a sequence of alphanumeric characters (i.e. letters and numbers, but no spaces or punctuation).
This information can be collected using text entry interactions.
We would recommend asking a user to choose a username rather than an e-mail address if it is likely that they may need to change their e-mail address at a later date.
Error messages can be used to make end-users enter a username/e-mail before moving onto the next page
A password
Passwords are entered using text entry interactions that have been set to password format.
The stronger the password that the end-user enters the more secure their data will be. You might, therefore, want to advise your end-users to choose a password that is at least eight characters long, includes alpha and numeric characters, contains both capital and lowercase letters and does not include their name/username.
Error messages can be used to make end-users enter a password before moving onto the next page
The Login Page
You will need to create a login page to allow end-users to log back in with their username and password in any subsequent visits to the intervention.
This login page will need to ask end-users to re-enter the exact same information that they entered for 1 and 2 above.
If they have forgotten their password since the last time they logged in then you can allow your end-users to reset their passwords (see below).
Creating User Accounts: The logic
This section will introduce you to the following logic commands makenewuser
and authenticateuser
. The logic command set
is also used to make sure that the person’s username can be used for further logic commands throughout the rest of the intervention.
The following is a breakdown of how the first lines of logic will probably look like for your intervention.
set username to login.login_username
if (not (isempty (signup.signup_username))) set username to signup.signup_username
- A person's username may be used throughout the logic for a number of different logic functions (e.g. setting up user accounts, saving things across sessions, verifying users are registered etc).
- These first two lines of logic makes sure that the person's username is always taken from the right place. For example if the person is using the intervention after they have just registered you will need to take the username from the signup page. If they have logged back in the username will need to be taken from their login page. So the logic will set the variable 'username' to the interaction called 'username' on the 'login' page. However, if this interaction is empty it will move onto the next line of logic where it will take the username from the interaction on the signup page.
show welcome
- Shows the first page of the intervention which is called welcome
show signup
- Shows the signup page when the person selects the option on the welcome page.
after signup if (makenewuser(signup.signup_username, signup.signup_password)) goto thankyou
save signup for username
- This is the registration process - the makenewuser command is used to set up an account for the user using a username and password
show thankyou
- Shows the thankyou page
show login
- If the person clicks the option to login instead of register they will go to the login page. This is because the login button on the welcome page is a jump button so it can jump to anyway in the logic instead of the next page.
after login if (authenticateuser (login.login_username, login.login_password)) goto loginthanks
- This line of logic is used to check that a user already exists (i.e. that they have already registered for the intervention). This is extremely important logic, without this logic functions such as to save information or to set up graphs will not work successfully. Note that this logic could be written into an error message instead.
show loginthanks