$dbtype = get_database_type($dbh);
$cache = new MessageCache($cache_type, $dbh, $dbtype, $smarty);
if (isset($_POST["submit"])) {
    $message = $cache->confirm_cache($euid);
    $_SESSION["message"] = $message;
    header("Location: list-cache.php" . $msid . "cache_type={$cache_type}");
    exit;
}
//redirect if we are setting new search order
if (isset($_GET["sort"])) {
    $cache->set_sort_order($_GET["sort"], $euid, $msid);
    // function does not return - page redirects
}
$offset = $cache->get_offset();
/*notes about caches
  spam and ham have opposite sort orders for score
  attachment, virus, and headers do not show the score.
  different named variables once existed, depending on action: 
    spam -> rescued/confirmed/deleted
    ham -> confirmed/reported/deleted
    attachment/virus/header -> rescue/delete
  
  
  */
$cache->get_sort_order($euid);
// Get a list of all the suspected (H)am items with this user's
// ID in the recipient list, and sort it in ascending
// order by spam score.
$cache->set_select();
$cache->render($euid);
//print_r($_POST);