/*redirectSelf()*/
}
$Conf->header("Assignments &nbsp;&#x2215;&nbsp; <strong>Bulk update</strong>", "bulkassign", actionBar());
echo '<div class="psmode">', '<div class="papmode"><a href="', hoturl("autoassign"), '">Automatic</a></div>', '<div class="papmode"><a href="', hoturl("manualassign"), '">Manual</a></div>', '<div class="papmodex"><a href="', hoturl("bulkassign"), '">Bulk update</a></div>', '</div><hr class="c" />';
// Help list
echo "<div class='helpside'><div class='helpinside'>\nAssignment methods:\n<ul><li><a href='", hoturl("autoassign"), "'>Automatic</a></li>\n <li><a href='", hoturl("manualassign"), "'>Manual by PC member</a></li>\n <li><a href='", hoturl("assign"), "'>Manual by paper</a></li>\n <li><a href='", hoturl("bulkassign"), "' class='q'><strong>Bulk update</strong></a></li>\n</ul>\n<hr class='hr' />\nTypes of PC review:\n<dl><dt>" . review_type_icon(REVIEW_PRIMARY) . " Primary</dt><dd>Mandatory, may not be delegated</dd>\n  <dt>" . review_type_icon(REVIEW_SECONDARY) . " Secondary</dt><dd>Mandatory, may be delegated to external reviewers</dd>\n  <dt>" . review_type_icon(REVIEW_PC) . " Optional</dt><dd>May be declined</dd></dl>\n</div></div>";
// upload review form action
if (isset($_POST["bulkentry"]) && trim($_POST["bulkentry"]) === "Enter assignments") {
    unset($_POST["bulkentry"]);
}
if (isset($_GET["upload"]) && check_post() && (isset($_POST["bulkentry"]) && $_POST["bulkentry"] || fileUploaded($_FILES["bulk"]))) {
    flush();
    while (@ob_end_flush()) {
        /* do nothing */
    }
    if (fileUploaded($_FILES["bulk"])) {
        $text = file_get_contents($_FILES["bulk"]["tmp_name"]);
        $filename = $_FILES["bulk"]["name"];
    } else {
        $text = $_POST["bulkentry"];
        $filename = "";
    }
    if ($text === false) {
        Conf::msg_error("Internal error: cannot read file.");
    } else {
        $assignset = new AssignmentSet($Me, false);
        $defaults = assignment_defaults();
        $text = convert_to_utf8($text);
        $assignset->parse($text, $filename, $defaults, "keep_browser_alive");
        finish_browser_alive();
        if ($assignset->has_errors()) {
示例#2
0
 static function file_upload_json($upload)
 {
     if (is_string($upload) && $upload) {
         $upload = $_FILES[$upload];
     }
     if (!$upload || !is_array($upload) || !fileUploaded($upload) || !isset($upload["tmp_name"])) {
         return set_error_html($doc, "Upload error. Please try again.");
     }
     $doc = new Filer_UploadJson($upload);
     if ($doc->content === false || strlen($doc->content) == 0) {
         return set_error_html($doc, "The uploaded file was empty. Please try again.");
     }
     return $doc;
 }
    }
}
if (isset($_REQUEST["ls"])) {
    $form_params[] = "ls=" . urlencode($_REQUEST["ls"]);
}
if ($newProfile) {
    echo '<div id="foldbulk" class="fold9' . (@$_REQUEST["bulkregister"] ? "o" : "c") . '"><div class="fn9">';
}
echo Ht::form(hoturl_post("profile", join("&amp;", $form_params)), array("id" => "accountform", "autocomplete" => "off")), '<div class="aahc profiletext', $need_highlight ? " alert" : "", "\">\n", Ht::password("chromefooler", "", array("style" => "display:none")), Ht::hidden("profile_contactid", $Acct->contactId);
if (isset($_REQUEST["redirect"])) {
    echo Ht::hidden("redirect", $_REQUEST["redirect"]);
}
if ($Me->privChair) {
    echo Ht::hidden("whichpassword", "");
}
echo '<div id="foldaccount" class="form foldc ', $pcrole == "no" ? "fold1c " : "fold1o ", fileUploaded($_FILES["bulk"]) ? "fold2o" : "fold2c", '">';
if ($newProfile) {
    create_modes(false);
}
echo '<div class="f-contain">', "\n\n";
if (!isset($Opt["ldapLogin"]) && !isset($Opt["httpAuthLogin"])) {
    echofield(0, "uemail", "Email", textinput("uemail", contact_value("uemail", "email"), 52, "account_d"));
} else {
    if (!$newProfile) {
        echofield(0, "uemail", "Username", contact_value("uemail", "email"));
        echofield(0, "preferredEmail", "Email", textinput("preferredEmail", contact_value("preferredEmail"), 52, "account_d"));
    } else {
        echofield(0, "uemail", "Username", textinput("newUsername", contact_value("newUsername", false), 52, "account_d"));
        echofield(0, "preferredEmail", "Email", textinput("preferredEmail", contact_value("preferredEmail"), 52));
    }
}
                    } else {
                        $errors[] = "<span class='lineno'>{$printFilename}:{$lineno}:</span> too many syntax errors, giving up";
                        break;
                    }
                }
            }
        }
    }
    if (count($errors) > 0) {
        Conf::msg_error("There were some errors while parsing the uploaded preferences file. <div class='parseerr'><p>" . join("</p>\n<p>", $errors) . "</p></div>");
    }
    if ($successes > 0) {
        savePreferences($new_qreq);
    }
}
if ($Qreq->fn === "uploadpref" && fileUploaded($_FILES["uploadedFile"]) && check_post()) {
    parseUploadedPreferences($_FILES["uploadedFile"]["tmp_name"], $_FILES["uploadedFile"]["name"], $reviewer);
} else {
    if ($Qreq->fn === "uploadpref") {
        Conf::msg_error("Select a preferences file to upload.");
    }
}
// Search actions
if ($Qreq->fn === "get" && $SSel && !$SSel->is_empty()) {
    include "search.php";
    exit;
}
// set options to view
if (isset($_REQUEST["redisplay"])) {
    $pfd = " ";
    foreach ($_REQUEST as $k => $v) {
示例#5
0
        } else {
            $_REQUEST["update"] = $_GET["update"] = $_POST["update"] = 1;
        }
    } else {
        if (isset($_REQUEST["submitreview"])) {
            $_REQUEST["update"] = $_REQUEST["ready"] = $_POST["update"] = $_POST["ready"] = 1;
        } else {
            if (isset($_REQUEST["savedraft"])) {
                $_REQUEST["update"] = $_POST["update"] = 1;
                unset($_REQUEST["ready"], $_POST["ready"]);
            }
        }
    }
}
// upload review form action
if (isset($_REQUEST["uploadForm"]) && fileUploaded($_FILES['uploadedFile']) && check_post()) {
    // parse form, store reviews
    $tf = $rf->beginTextForm($_FILES['uploadedFile']['tmp_name'], $_FILES['uploadedFile']['name']);
    if (!($req = $rf->parseTextForm($tf))) {
        /* error already reported */
    } else {
        if (isset($req['paperId']) && $req['paperId'] != $prow->paperId) {
            $rf->tfError($tf, true, "This review form is for paper #" . $req['paperId'] . ", not paper #{$prow->paperId}; did you mean to upload it here?  I have ignored the form.<br /><a class='button_small' href='" . hoturl("review", "p=" . $req['paperId']) . "'>Review paper #" . $req['paperId'] . "</a> <a class='button_small' href='" . hoturl("offline") . "'>General review upload site</a>");
        } else {
            if ($whyNot = $Me->perm_submit_review($prow, $paperTable->editrrow)) {
                $rf->tfError($tf, true, whyNotText($whyNot, "review"));
            } else {
                $req["paperId"] = $prow->paperId;
                if ($rf->checkRequestFields($req, $paperTable->editrrow, $tf)) {
                    $rf->save_review($req, $paperTable->editrrow, $prow, $Me, $tf);
                }
function setTagIndexes()
{
    global $Conf, $Me, $Error;
    $filename = null;
    if (isset($_REQUEST["upload"]) && fileUploaded($_FILES["file"])) {
        if (($text = file_get_contents($_FILES["file"]["tmp_name"])) === false) {
            Conf::msg_error("Internal error: cannot read file.");
            return;
        }
        $filename = @$_FILES["file"]["name"];
    } else {
        if (!($text = defval($_REQUEST, "data"))) {
            Conf::msg_error("Choose a file first.");
            return;
        }
    }
    $RealMe = $Me;
    $tagger = new Tagger();
    if ($tag = defval($_REQUEST, "tag")) {
        $tag = $tagger->check($tag, Tagger::NOVALUE);
    }
    $curIndex = 0;
    $lineno = 1;
    $settings = $titles = $linenos = $errors = array();
    foreach (explode("\n", rtrim(cleannl($text))) as $l) {
        if (substr($l, 0, 4) == "Tag:" || substr($l, 0, 6) == "# Tag:") {
            if (!$tag) {
                $tag = $tagger->check(trim(substr($l, $l[0] == "#" ? 6 : 4)), Tagger::NOVALUE);
            }
            ++$lineno;
            continue;
        } else {
            if ($l == "" || $l[0] == "#") {
                ++$lineno;
                continue;
            }
        }
        if (preg_match('/\\A\\s*?([Xx=]|>*|\\([-\\d]+\\))\\s+(\\d+)\\s*(.*?)\\s*\\z/', $l, $m)) {
            if (isset($settings[$m[2]])) {
                $errors[$lineno] = "Paper #{$m['2']} already given on line " . $linenos[$m[2]];
            }
            if ($m[1] == "X" || $m[1] == "x") {
                $settings[$m[2]] = null;
            } else {
                if ($m[1] == "" || $m[1] == ">") {
                    $settings[$m[2]] = $curIndex = $curIndex + 1;
                } else {
                    if ($m[1][0] == "(") {
                        $settings[$m[2]] = $curIndex = substr($m[1], 1, -1);
                    } else {
                        if ($m[1] == "=") {
                            $settings[$m[2]] = $curIndex;
                        } else {
                            $settings[$m[2]] = $curIndex = $curIndex + strlen($m[1]);
                        }
                    }
                }
            }
            $titles[$m[2]] = $m[3];
            $linenos[$m[2]] = $lineno;
        } else {
            if ($RealMe->privChair && preg_match('/\\A\\s*<\\s*([^<>]*?(|<[^<>]*>))\\s*>\\s*\\z/', $l, $m)) {
                if (count($settings) && $Me) {
                    saveTagIndexes($tag, $filename, $settings, $titles, $linenos, $errors);
                }
                $ret = ContactSearch::make_pc($m[1], $RealMe);
                $Me = null;
                if (count($ret->ids) == 1) {
                    $Me = $ret->contact(0);
                } else {
                    if (count($ret->ids) == 0) {
                        $errors[$lineno] = htmlspecialchars($m[1]) . " matches no PC member";
                    } else {
                        $errors[$lineno] = htmlspecialchars($m[1]) . " matches more than one PC member, give a full email address to disambiguate";
                    }
                }
            } else {
                if (trim($l) !== "") {
                    $errors[$lineno] = "Syntax error";
                }
            }
        }
        ++$lineno;
    }
    if (count($settings) && $Me) {
        saveTagIndexes($tag, $filename, $settings, $titles, $linenos, $errors);
    }
    $Me = $RealMe;
    if (count($errors)) {
        ksort($errors);
        if ($filename) {
            foreach ($errors as $lineno => &$error) {
                $error = '<span class="lineno">' . htmlspecialchars($filename) . ':' . $lineno . ':</span> ' . $error;
            }
        }
        $Error["tags"] = '<div class="parseerr"><p>' . join("</p>\n<p>", $errors) . '</p></div>';
    }
    if (isset($Error["tags"])) {
        Conf::msg_error($Error["tags"]);
    } else {
        if (isset($_REQUEST["setvote"])) {
            $Conf->confirmMsg("Votes saved.");
        } else {
            $Conf->confirmMsg("Ranking saved.  To view it, <a href='" . hoturl("search", "q=order:" . urlencode($tag)) . "'>search for &ldquo;order:{$tag}&rdquo;</a>.");
        }
    }
}