only for RuBoard - do not distribute or recompile Previous Section Next Section

Solution Overview

For this project, we will again use an event-driven approach to writing our code, as we did in Chapter 27, "Building a Web-Based Email Service."

We have again begun by drawing a set of system flow diagrams to show the paths users might take through the system. In this case, we have drawn three diagrams to represent the three different sets of interactions users can have with the system. Users have different allowable actions when they are not logged in, when they are logged in as regular users, and when they are logged in as administrators. These actions are shown in Figures 28.1, 28.2, and 28.3, respectively.

Figure 28.1. A user can only choose a limited number of actions when he is not logged in.
graphics/28fig01.gif
Figure 28.2. After logging in, users can change their preferences through a variety of options.
graphics/28fig02.gif
Figure 28.3. Administrators have additional actions available to them.
graphics/28fig03.gif

In Figure 28.1 you can see the actions that can be taken by a user who is not logged in. As you can see, he can log in (if he already has an account), create an account (if he doesn't already have one), or view the mailing lists available for signup (as a marketing tactic).

Figure 28.2 shows the actions a user can take after logging in. He can change his account set-up (email address and preferences), change his password, and change which lists he is subscribed to.

Figure 28.3 shows the actions available if an administrator has logged in. As you can see, an administrator has most of the functionality available to a user, and some additional options. She can also create new mailing lists, create new messages for a mailing list by uploading files, and preview messages before sending them.

Because we have used an event-driven approach again, the backbone of the application is contained in one file, index.php, which calls on a set of function libraries. An overview of the files in this application is shown in Table 28.1.

Table 28.1. Files in the Mailing List Manager Application
Filename Type Description
index.php Application The main script that runs the entire application.
include_fns.php Functions Collection of include files for this application.
data_valid_fns.php Functions Collection of functions for validating input data.
db_fns.php Functions Collection of functions for connecting to the mlm database.
mlm_fns.php Functions Collection of functions specific to this application.
output_fns.php Functions Collection of functions for outputting HTML.
upload.php Component Script that manages the file upload component of the administrator role. Sepa rated out to make security easier.
user_auth_fns.php Functions Collection of functions for authenticating users.
create_database.sql SQL SQL to set up the mlm database and set up a Web user and an administrative user.

We will work our way through the project implementation, beginning with the database in which we will store subscriber and list information.

only for RuBoard - do not distribute or recompile Previous Section Next Section