In this assignment, you will enhance the CGI program
membership.cgi that you have written for Question 4 of Assignment 2. In
addition to the existing input fields, your program should allow a new member
to enter a username (a text field) and a password (a password field) when he or
she registers. Before your program inserts a new record into the database, it
should check if the same username has been previously used or not. Only if the
same username doesn't exist will your program add a new record to the database.
In order to protect the password from illegal access or
tampering, your program should not store
the password in plain text; instead, it should store a hash of the password,
and should add a random -salt- value to
the end before generating the hash.
If the registration is successful, your program should send
an email back to the new member by using his or her email address as the
recipient. Your program should use admin-joyluckclub@une.edu.au as the sender's
address. The content of the email should include the registration details, one
line at a time.
To test your program, place membership.cgi in the
public_html/ folder under your $HOME directory. The CGI file should have
permission 744 (i.e. group and others only have read permission). Try entering
your UNE email address as the recipient's address and see if you would receive
a email with the correct details.
You can diagnose errors that might occur by viewing the
files /var/log/httpd/error_log and /var/log/httpd/suexec.log.
Submission
Submit your CGI source file and any other HTML file(s) that
you might have written using the submit program on Turing. Ensure you compile
and test your code using test values of your own creation as part of your
submission script, demonstrating that your program compiles without errors and
works as expected.
0 comments:
Post a Comment