<?PHP
#
#   FILE:  CleanSpam.php
#
#   Part of the Collection Workflow Integration System (CWIS)
#   Copyright 2012 Internet Scout Project
#   http://scout.wisc.edu/
#

# ----- EXPORTED FUNCTIONS ---------------------------------------------------

function PrintResourceComments($PosterId, $PosterName, $PosterEmail)
{
    global $DB;

    $MessageFactory = new MessageFactory();
    $Comments = $MessageFactory->GetMessagesPostedByUser($PosterId);

    foreach ($Comments as $Comment)
    {
        PrintForumMessage($Comment, FALSE, NULL, NULL, NULL, TRUE, NULL);
    }
}

# ----- MAIN -----------------------------------------------------------------

PageTitle("Preview Message");

# check if current user is authorized
CheckAuthorization(PRIV_FORUMADMIN, PRIV_USERADMIN);

$PosterId   = intval(GetArrayValue($_GET, "PosterId", -1));
$ResourceId = intval(GetArrayValue($_GET, "ResourceId", -1));

$TgtUser = new User ($DB, $PosterId);

$PosterName = $TgtUser->Name();
$PosterEmail = $TgtUser->Get("EMail");
