コード例 #1
0
function formatRecord()
{
    global $t, $rec;
    $t->skipDuplicatedLines = True;
    $rec["uid"] = uid2gecos($rec["uid"]);
    $rec["ip"] = ip2name($rec["ip"]);
    $rec["time"] = $_GET["xsince_yesterday"] ? $t->x("i", eregi_replace(":[0-9][0-9]", ":00", date("Y-m-d H:i", $rec["time"]))) : $t->x("i", date("Y-m-d", $rec["time"]));
}
コード例 #2
0
<?php

// ============================================================================
// PREPRINTS/DELETE_PREPRINT.PHP
// ============================================================================
require_once "config.manage.php";
core_declare_input("rowId");
if (!$authClass->isAdmin()) {
    errorPage("Preprints may only be deleted by administrative staff");
}
$deleteRes = $dbClass->query("SELECT * FROM publications WHERE RowId='" . $rowId . "'");
$row = $dbClass->next_record($deleteRes);
$q = $dbClass->query("UPDATE publications SET " . "Status='free', Field='', Location='', Authors='', " . "Title='', PublIn='' WHERE RowId='" . $rowId . "'");
mail2secretary("Deleted");
logIt("delete", pp_preprintID($row["Year"], $row["Report"]), uid2gecos($row["Id"]));
if (file_exists($row["Location"])) {
    unlink($row["Location"]);
}
require "show_preprints.php";
コード例 #3
0
function show_preprint($rowId, $action, $showcancelButton = True)
{
    global $dbClass;
    $res = $dbClass->query("SELECT * FROM publications WHERE RowId='" . $rowId . "'");
    $row = $dbClass->next_record($res);
    $c = "class='align_right'";
    $t = new table("cellpadding='2'", "<form action='loader.php?rowId=" . $rowId . "&amp;action=" . $action . "' method='POST'>");
    if ($showcancelButton) {
        $missing = x("", "?");
    } else {
        $missing = False;
    }
    $field = nl2html($GLOBALS["NOR_fields"][$row["Field"]]);
    $authors = nl2html($row["Authors"], $missing);
    $title = nl2html($row["Title"], $missing);
    $location = nl2html($row["Location"], $missing);
    $journal = nl2html($row["PublIn"], $missing);
    $t->tro();
    $t->th($c, "Preprint :");
    $t->td("", pp_preprintID($row["Year"], $row["Report"]));
    $t->trc();
    $t->tro();
    $t->th($c, "Field :");
    $t->td("", $field);
    $t->trc();
    $t->tro();
    $t->th($c, "Authors :");
    $t->td("", $authors);
    $t->trc();
    if ($location) {
        $t->tro();
        $t->th($c, "Location :");
        $t->td("", $location);
        $t->trc();
    }
    if ($journal) {
        $t->tro();
        $t->th($c, "Published in :");
        $t->td("", $journal);
        $t->trc();
    }
    $t->tro();
    $t->th($c, "Entered by :");
    $t->td("", uid2gecos($row["Id"]));
    $t->trc();
    $buttons[] = "<input type='submit' value='continue' name='button'>";
    if ($showcancelButton) {
        $buttons[] = "<input type='submit' value='cancel' name='button'>" . "<input type='hidden' name='load' value='show_preprints.php'>";
    } else {
        $buttons[] = "<input type='submit' value='update information for this preprint' name='button'>" . "<input type='hidden' name='load' value='edit_preprints.php'>" . "<input type='hidden' name='nor_pp_mode' value='" . NOR_PP_MODE_EDIT . "'>";
    }
    $t->tro();
    $t->td();
    $t->td("", join("&nbsp;", $buttons));
    $t->trc();
    if (!$showcancelButton) {
        $t->tr("", "colspan='3'", x("i", "<br>When you have published this preprint in a Public Archive<br>" . "(i.e. you know the URL to the abstract)<br>please return and complete the form.<br><br>" . "If you want to publish _only_ at Nordita you can upload your paper now.<br>" . "Note, you can correct eventual typos at any time, and you may also cancel the preprint reservation."));
    }
    $t->close("</form>");
}
コード例 #4
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();
            }
        }
    }
}
コード例 #5
0
$t->th("", "PP#");
$t->th("", "Field");
if ($tabs->active == PP_PENDING || $authClass->isAdmin()) {
    $t->th("", "Entered by");
}
$t->th("", "Title &amp; Authors");
$t->th("", "Published in");
$t->trc();
$counter = array();
if ($tabs->active == PP_PENDING) {
    $pubs = $pendingHash;
} else {
    $pubs = $allHash;
}
while ($row = $dbClass->next_record($pubs)) {
    $gecos = uid2gecos($row["Id"]);
    if (eregi("log1", $cClass)) {
        $cr = "class='log2r' style='color:#cc0000'";
        $cClass = "class='log2'";
    } else {
        $cr = "class='log1r' style='color:#cc0000'";
        $cClass = "class='log1'";
    }
    $field = nl2html($row["Field"]);
    $authors = nl2html(@$row["Authors"]);
    $title = nl2html(@$row["Title"]);
    $journal = nl2html(@$row["PublIn"]);
    $location = trim(@$row["Location"]);
    $status = strtr($row["Status"], "a-z", "A-Z");
    $pp_id = x($location ? "a href='" . $location . "'" : "", $row[Year] . "-" . $row[Report]);
    switch ($row["Status"]) {
コード例 #6
0
function make_user_selection($res_uid = False)
{
    global $AUTH_login, $AUTH_uid, $AUTH_gecos, $authClass;
    if ($authClass->isAdmin()) {
        $txt = "<!-- {$AUTH_login} -->\n" . "<select name='res_UID'>\n";
        if ($owner = uid2gecos($res_uid)) {
            $txt .= x("option value='{$res_uid}' selected='selected'", $owner);
        }
        foreach (getAllValidUsers() as $gecos => $row) {
            if (!$owner && $row["username"] == $AUTH_login) {
                $s = "selected='selected'";
            } else {
                $s = "";
            }
            $txt .= x("option value='{$row['uid']}' {$s}", $gecos);
        }
        $txt .= "</select>\n";
        return $txt;
    } else {
        return "{$AUTH_gecos}<input type='hidden' name='res_UID' value='{$AUTH_uid}'>";
    }
}
コード例 #7
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"]));
}
コード例 #8
0
        default:
            errorExit("An unknown error occured during file upload.");
    }
}
$q = $dbClass->query("SELECT * FROM publications WHERE RowId=" . $dbClass->quote($rowId));
$row = $dbClass->next_record($q);
$status = $row["Status"];
if ($status == "reserved" && !(empty($location) && empty($journal)) && !empty($authors) && !empty($title)) {
    $status = "registered";
    mail2secretary("Registered");
    logIt("register", pp_preprintID($row["Year"], $row["Report"]), uid2gecos($res_UID));
    unset($pp_id);
}
$dbClass->query("UPDATE publications SET " . " Field=" . $dbClass->quote($field) . ",Location=" . $dbClass->quote($location) . ",Authors=" . $dbClass->quote($authors) . ",Title=" . $dbClass->quote($title) . ",PublIn=" . $dbClass->quote($journal) . ",Id=" . $dbClass->quote($res_UID) . ",Status=" . $dbClass->quote($status) . " WHERE RowId=" . $dbClass->quote($rowId));
if ($pp_id) {
    logIt("edit", $pp_id, uid2gecos($res_UID));
}
// ==========================================================================
/// @fn void  ( void )
///
/// ...
///
/// @global
/// @parameter ...
/// @return ...
/// @gobals[out] - none
/// @sideeffect  - none
///
/// @calledby ...
// ==========================================================================
function errorExit($text)
コード例 #9
0
<?php

// ============================================================================
// PREPRINTS/ACCEPT_PREPRINT.PHP
// ============================================================================
include_once "config.manage.php";
core_declare_input("rowId");
if (!$authClass->isAdmin()) {
    errorPage("Preprints may only be accepted by administrative staff");
}
$time = time();
$dbClass->query("update publications set Status='ok', Tm=" . $time . " where RowId=" . $rowId);
$res = $dbClass->query("select * from publications where RowId=" . $rowId);
while ($row = $dbClass->next_record($res)) {
    mail2secretary("Accepted");
    logIt("accept", pp_preprintID($row["Year"], $row["Report"]), uid2gecos($row["Id"]));
}
header("Location: show_preprints.php");