Пример #1
0
 function mail_PPsubmitter($action = "Reserved")
 {
     global $row, $mailClass;
     $owner = auth::getGecos($row["owneruid"], 0);
     $pp = self::getFullPpNumber($row["Year"], $row["Report"]);
     $mailClass->send(uid2login($row["owneruid"]), "Preprint {$pp} reserved for you", mail_preprint_prettyprinted($row, $owner, $pp, $action) . pp_reservationMessage($row["RowId"]));
 }
Пример #2
0
function sendReminder()
{
    global $dbClass, $row;
    $action = "reminder";
    if ($_SESSION[$action][$action]++) {
        return;
    }
    $remindingPeriod = core_getConfig("remindingPeriod", 7 * 24 * 3600);
    // a week
    if ($q = getPendingPreprints("Tm < " . (time() - $remindingPeriod))) {
        while ($row = $dbClass->next_record($q)) {
            $pp = pp_preprintID($row["Year"], $row["Report"]);
            $gecos = uid2gecos($row["Id"]);
            if (core_getoption("CLI")) {
                print sprintf("%-15s %-25s %-15s %s \n", $pp, uid2login($row["Id"]), $gecos, long_date_and_time_string($row["Tm"]));
            }
            $l = $dbClass->query("SELECT * FROM " . PP_LOGTABLE . " WHERE text REGEXP '" . $pp . " ' " . "AND type = '" . $action . "' ORDER BY time DESC");
            $tobeSent = !$dbClass->num_rows($l);
            while ($log = $dbClass->next_record($l)) {
                if ((int) $log["time"] > time() - $remindingPeriod) {
                    break;
                }
                $tobeSent = True;
            }
            if ($tobeSent) {
                logIt($action, $pp, $gecos);
                mailReminder();
            }
        }
    }
}
Пример #3
0
function mail_PPsubmitter($action = "Reserved")
{
    global $row, $mailClass;
    $cn = uid2gecos($row["Id"]);
    $pp = pp_preprintID($row["Year"], $row["Report"]);
    $mailClass->send(uid2login($row["Id"]), "Preprint {$pp} reserved for you", mail_pp($row, $cn, $pp, $action) . pp_reservationMessage($row["RowId"]));
}