Exemplo n.º 1
0
    		print_r($_POST["to"]);
    		echo "</pre><br>";*/
    if ($_POST["to"]) {
        //Merge the session array with post array
        if ($letterInfo->Title == "Paper Acceptance" || $letterInfo->Title == "Paper Rejection") {
            $_SESSION["arrUpdateEmails"] = array_merge_assoc($arrDiff, $_POST["to"]);
        } else {
            $_SESSION["arrUpdateEmails"] = array_merge($arrDiff, $_POST["to"]);
        }
    } else {
        $_SESSION["arrUpdateEmails"] = $arrDiff;
    }
    /*
    		echo "<br>Merge Array now is <pre>";
    		print_r($_SESSION["arrUpdateEmails"]);
    		echo "</pre><br>";*/
} else {
    //echo "<br>Very first time.<br>";
    $arrUpdateEmails = get_Unsended_EmailList($letterID, $recipientGroupName);
    if (count($arrUpdateEmails) > 0) {
        $_SESSION["arrUpdateEmails"] = $arrUpdateEmails;
    }
}
//Redirect the page to view email list
if ($letterInfo->Title == "Paper Acceptance" || $letterInfo->Title == "Paper Rejection") {
    $url = "Location: view_emails_list_by_papers.php?letterID=" . $_POST["letterID"] . "&recipientGroupName=" . $_POST["recipientGroupName"];
} else {
    $url = "Location: view_emails_list.php?letterID=" . $_POST["letterID"] . "&recipientGroupName=" . $_POST["recipientGroupName"];
}
header($url);
exit;
if ($_POST["Submit"] == "Back") {
    unset($_SESSION["arrContent"]);
    $url = "Location: send_account_info.php?lettertype=" . $arrLetterInfo["lettertype"];
    header($url);
    exit;
}
//get the conference info to get the contact mail
$conferenceInfo = get_conference_info();
//Get the letter info and its constant
$letterInfo = get_Letter_Info($arrLetterInfo["letterID"]);
$arrConstants = evaluate_Letter_Constants($arrLetterInfo["lettertype"]);
//Check if there is session email list to retrieve out
if (isset($_SESSION["arrUpdateEmails"])) {
    $arrEmails = $_SESSION["arrUpdateEmails"];
} else {
    $arrEmails = get_Unsended_EmailList($letterInfo->LetterID, $letterInfo->RecipientGroupName);
}
$arrContent = $_SESSION["arrContent"];
//Call the function to setup reviwer account
while (list($memberName, $email) = each($arrEmails)) {
    //Update the mail log
    $result = updateMailLog($memberName, $letterInfo->LetterID);
    if ($result === true) {
        //Successful Mail Log update
        //Now update the user password
        $result = updateUserPassword($memberName, $arrPassword[$memberName]);
        //If can log the email
        if ($result === true) {
            //Successful Password Update
            //Send Email to user
            //~ $mail = new Mail();