Web Development Assignment 5: Functions & Roles Build upon the existing family / friend / pet tree website. In order to prevent unauthorized access to the family or friend or pet tree, develop a login page that fronts these pages and requires a session for their viewing. Two functions are necessary and should be created in the file â€œfunction.php.â€ Include function.php on each of the relevant family / friend / pet pages using the â€œincludeâ€ function in php. Create a PHP login function that checks to assure users are authenticated that are viewing the tree. Set a user session upon login. For the second function, create a PHP role function that only allows those with the website administrator role to update the tree with new content. To associate a role with a username you can use an array or a database table if you are ahead in your reading. Name your functions using your last name. For example, the two functions could be â€œAnderson_Login()â€ and â€œAnderson_role()â€. Allow the username â€œcustomerâ€ and password â€œcustomerâ€ to successfully login to the website. Allow the username â€œadminâ€ and password â€œadminâ€ to successfully login to the website. If the username/password is wrong, the instructor may not be able to grade this and you will received a reduction in points. 1. Create a login function. The login function must check to determine whether the customer or admin sessions are set on all family/friend member pages. Create a proper session for the â€œcustomerâ€ and â€œadminâ€ usernames upon authentication. Each page of the family tree should require a session to be set and the user to be authenticated in order to view it. If no session exists, the user should be given a message indicating they are not authenticated and be automatically redirected back to the login page. If redirects are not working on your webhost you can create a URL or use an include to include the login.php page. Proper form validation should be used on the login and special characters for the password field that disallow bystanders from seeing the password. In addition, if a session exists the footer of each web page should have a logout link. When the logout link is clicked, the user should be asked to confirm or cancel their logout. Once confirmed, the session should be destroyed. 2. Create a role function. The role function will identify whether the authenticated individual is either a customer or a website administrator. Once authenticated, the role function will print the role of the logged in user next to the logout link. If the role of the user is a website administrator authenticated with the username â€œadmin,â€ allow the user to update the content for each member of the tree. If the authenticated user is not â€œadmin,â€ disallow updates to the family / friend / pet tree, it should be read only. Remember to name all of the function variables beginning with your last name in your code. Store the functions in a separate PHP file called â€œfunction.php.â€ Include the function.php in your family / friend / pet tree pages using the PHP include or include_once function.