Specifications

LISTING 28.2 Continued
case ‘store-change-password’ :
{
if(change_password(get_email(), $old_passwd,
$new_passwd, $new_passwd2))
{
echo “<p>OK: Password changed.<br><br><br><br><br><br>”;
}
else
{
echo “<p>Sorry, your password could not be changed.”;
display_password_form();
}
break;
}
}
}
// The following actions may only be performed by an admin user
if(check_admin_user())
{
switch ( $action )
{
case ‘create-mail’ :
{
display_mail_form(get_email());
break;
}
case ‘create-list’ :
{
display_list_form(get_email());
break;
}
case ‘store-list’ :
{
if(store_list($admin_user, $HTTP_POST_VARS))
{
echo “<p>New list added<br>”;
display_items(“All Lists”, get_all_lists(), ‘information’,
‘show-archive’,’’);
}
else
echo “<p>List could not be stored, please try “
.”again.<br><br><br><br><br>”;
break;
}
Building Practical PHP and MySQL Projects
P
ART V
668
34 7842 CH28 3/6/01 3:46 PM Page 668