Specifications
store_account_settings($auth_user, $HTTP_POST_VARS);
break;
}
case ‘select-account’ :
{
// if have chosen a valid account, store it as a session variable
if($account&&account_exists($auth_user, $account))
{
$selected_account = $account;
session_register(‘selected_account’);
}
}
}
// set the buttons that will be on the tool bar
$buttons[0] = ‘view-mailbox’;
$buttons[1] = ‘new-message’;
$buttons[2] = ‘account-setup’;
//only offer a log out button if logged in
if(check_auth_user())
{
$buttons[4] = ‘log-out’;
}
//*****************************************************************************
// Stage 2: headers
// Send the HTML headers and menu bar appropriate to current action
//*****************************************************************************
if($action)
{
// display header with application name and description of page or action
do_html_header($auth_user, “Warm Mail - “.
format_action($action), $selected_account);
}
else
{
// display header with just application name
do_html_header($auth_user, “Warm Mail”, $selected_account);
}
display_toolbar($buttons);
//*****************************************************************************
// Stage 3: body
// Depending on action, show appropriate main body content
//*****************************************************************************
Building a Web-Based Email Service
C
HAPTER 27
27
BUILDING A
WEB-BASED
EMAIL
SERVICE
625
LISTING 27.2 Continued
33 7842 CH27 3/6/01 3:41 PM Page 625










