Example #1
0
// PREPRINTS/RESERVE_PPN.PHP
// ============================================================================
include_once "config.manage.php";
core_declare_input("res_UID");
core_declare_input("field");
core_declare_input("authors", "");
core_declare_input("title", "");
startPage("Reserve Preprint Number");
if (!$title) {
    errorPage("Preprint title is missing", "Submit Preprint", "Error");
}
if (!$authors) {
    errorPage("Authors list is missing", "Submit Preprint", "Error");
}
if (!($account = core_getpwuid($res_UID, $dbClass))) {
    bugPage("no account found for UID='{$res_UID}'");
}
$res_login = $account["name"];
if (!$authClass->isAdmin() && $res_login != $AUTH_login) {
    errorPage("Reserving of preprint nbrs for others is only " . "permitted for administrative staff.");
}
$res_gecos = $account["gecos"];
$res_ppn = pp_reserveNumber($nor_pp_year, $res_UID, $field, $authors, $title);
// reread back the record
$q = $dbClass->query("SELECT * FROM publications WHERE Year={$nor_pp_year} AND Report={$res_ppn} AND Field='{$field}'");
$row = $dbClass->next_record($q);
$_POST["rowId"] = $row["RowId"];
require "update_preprint.inc.php";
mail2secretary("Reserved");
mail_PPsubmitter("Reserved");
logIt("submit", pp_preprintID($nor_pp_year, $res_ppn), $res_gecos);
Example #2
0
                    $extra_ext = ".gz";
                }
            }
            $dest_file = sprintf("%s%02d%s", $year, $report, $ext);
            core_dbg("UPLOAD dest_file='" . PP_DB . "{$dest_dir}/{$dest_file}'");
            if (copy($_FILES["preprint"]["tmp_name"], PP_DB . "{$dest_dir}/{$dest_file}")) {
                if ($do_compress) {
                    if (system("gzip {$dest_file}")) {
                        nor_tech_warn("Could not gzip file.");
                        $extra_ext = "";
                    }
                }
                $location = PP_DB_URL . "{$dest_dir}/{$dest_file}{$extra_ext}";
                #system("ls -lrt ".PP_DB."$dest_dir/$dest_file 2>&1");
            } else {
                bugPage("Cannot copy " . $_FILES["preprint"]["tmp_name"] . " -> " . PP_DB . "{$dest_dir}/{$dest_file}");
            }
            break;
        case UPLOAD_ERR_NO_FILE:
            break;
        case UPLOAD_ERR_INI_SIZE:
        case UPLOAD_ERR_FORM_SIZE:
            errorExit("File exceeds maximum file size.");
        case UPLOAD_ERR_PARTIAL:
            errorExit("File upload was incomplete.");
        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);