+-------------+ |Martin Elthon| |Period 3 | |Code Analysis| +-------------+ -------------------------------------------------------------------- config.php *core variables, such as database name, server, user, password --------------------------------------------------------------------- ------------------------------------------------------------------------- auth.php *checks whether the user has a valid cookie, signifing whether they are logged in or not. Cookies store username and timestamp when the account was created, providing a secure and reliable way to authenticate. -------------------------------------------------------------------------- -------------------------------------------------------------------------- index.php / login.php *provide a login page. Check database whether username and password are correct, and if so, give a cookie that would be interpreted as a valid login. Then, the login redirects to main.php (index.php is symlinked to login.php) -------------------------------------------------------------------------
Login " . $status . "

\n"; } ?>

Username:
Password:
------------------------------------------------------------------------- main.php *splash-screen. Provides links to all of the features that the site contains. --------------------------------------------------------------------------
Welcome

Logout
Add a User
Remove a User
------------------------------------------------------------------------------ logout.php *removes all cookies from this site, and redirects to auth.php, which will check whether you are authenticated. Since you are not authenticated, it will then redirect you to the login page. --------------------------------------------------------------------------- $value) { setcookie($key,$value,time()-3600); } header("Location: auth.php"); ?> -------------------------------------------------------------------------- adduser.php *adds a user to the system -------------------------------------------------------------------------

Username:
Password:
Retype Password:
---------------------------------------------------------------------- rmuser.php *removes a user from the system. Pull-down menu with all the current users, select which one you want to delete, then it deletes it. ----------------------------------------------------------------------