function render($sv)
 {
     global $Conf, $Opt;
     echo '<div class="f-c">', $sv->label("opt.shortName", "Conference abbreviation"), "</div>\n";
     $sv->echo_entry("opt.shortName");
     echo '<div class="f-h">Examples: “HotOS XIV”, “NSDI \'14”</div>';
     echo "<div class=\"g\"></div>\n";
     if ($sv->oldv("opt.longName") == $sv->oldv("opt.shortName")) {
         $sv->set_oldv("opt.longName", "");
     }
     echo "<div class='f-c'>", $sv->label("opt.longName", "Conference name"), "</div>\n";
     $sv->echo_entry("opt.longName");
     echo '<div class="f-h">Example: “14th Workshop on Hot Topics in Operating Systems”</div>';
     echo "<div class=\"g\"></div>\n";
     echo "<div class='f-c'>", $sv->label("opt.conferenceSite", "Conference URL"), "</div>\n";
     $sv->echo_entry("opt.conferenceSite");
     echo '<div class="f-h">Example: “http://yourconference.org/”</div>';
     echo '<div class="lg"></div>', "\n";
     echo '<div class="f-c">', $sv->label("opt.contactName", "Name of site contact"), "</div>\n";
     $sv->echo_entry("opt.contactName");
     echo '<div class="g"></div>', "\n";
     echo "<div class='f-c'>", $sv->label("opt.contactEmail", "Email of site contact"), "</div>\n";
     $sv->echo_entry("opt.contactEmail");
     echo '<div class="f-h">The site contact is the contact point for users if something goes wrong. It defaults to the chair.</div>';
     echo '<div class="lg"></div>', "\n";
     echo '<div class="f-c">', $sv->label("opt.emailReplyTo", "Reply-To field for email"), "</div>\n";
     $sv->echo_entry("opt.emailReplyTo");
     echo '<div class="g"></div>', "\n";
     echo '<div class="f-c">', $sv->label("opt.emailCc", "Default Cc for reviewer email"), "</div>\n";
     $sv->echo_entry("opt.emailCc");
     echo '<div class="f-h">This applies to email sent to reviewers and email sent using the <a href="', hoturl("mail"), '">mail tool</a>. It doesn’t apply to account-related email or email sent to submitters.</div>';
 }
Esempio n. 2
0
function error_go($url, $message)
{
    if ($url === false) {
        $url = hoturl("index");
    }
    Conf::msg_error($message);
    go($url);
}
Esempio n. 3
0
function error_go($url, $message)
{
    global $Conf;
    if ($url === false) {
        $url = hoturl("index");
    }
    $Conf->errorMsg($message);
    go($url);
}
Esempio n. 4
0
 function run(Contact $user, $qreq, $ssel)
 {
     $r = in_array($qreq->recipients, ["au", "rev"]) ? $qreq->recipients : "all";
     if ($ssel->equals_search(new PaperSearch($user, $qreq))) {
         $x = "q=" . urlencode($qreq->q) . "&plimit=1";
     } else {
         $x = "p=" . join("+", $ssel->selection());
     }
     go(hoturl("mail", $x . "&t=" . urlencode($qreq->t) . "&recipients={$r}"));
 }
Esempio n. 5
0
 function render($sv)
 {
     global $Me;
     if ($sv->curv("acct_addr")) {
         $sv->echo_checkbox("acct_addr", "Collect users’ addresses and phone numbers");
     }
     echo "<h3 class=\"settings g\">Program committee &amp; system administrators</h3>";
     echo "<p><a href='", hoturl("profile", "u=new&amp;role=pc"), "' class='button'>Create PC account</a> &nbsp;|&nbsp; ", "Select a user’s name to edit a profile.</p>\n";
     $pl = new ContactList($Me, false);
     echo $pl->table_html("pcadminx", hoturl("users", "t=pcadmin"));
 }
Esempio n. 6
0
function loadRows()
{
    global $prow, $rrows, $Conf, $Me;
    $Conf->paper = $prow = PaperTable::paperRow($whyNot);
    if (!$prow) {
        errorMsgExit(whyNotText($whyNot, "view"));
    }
    if ($whyNot = $Me->perm_request_review($prow, false)) {
        $wnt = whyNotText($whyNot, "request reviews for");
        error_go(hoturl("paper", array("p" => $prow->paperId, "ls" => @$_REQUEST["ls"])), $wnt);
    }
    $rrows = $Conf->reviewRow(array('paperId' => $prow->paperId, 'array' => 1), $whyNot);
}
Esempio n. 7
0
function output($User)
{
    global $Me;
    $u = $Me->user_linkpart($User);
    echo '<div class="facebook61">', '<a href="', hoturl("index", ["u" => $u]), '">', '<img class="bigface61" src="' . hoturl("face", ["u" => $u, "imageid" => $User->contactImageId ?: 0]) . '" border="0" />', '</a>', '<h2 class="infacebook61"><a class="q" href="', hoturl("index", ["u" => $u]), '">', htmlspecialchars($u), '</a>';
    if ($Me->privChair) {
        echo "&nbsp;", become_user_link($User);
    }
    echo '</h2>';
    if ($User !== $Me) {
        echo '<h3 class="infacebook61">', Text::user_html($User), '</h3>';
    }
    echo '</div>';
}
Esempio n. 8
0
function show_pset_table($pset)
{
    global $Conf, $Me, $Now, $Profile, $LastPsetFix;
    echo '<div id="', $pset->urlkey, '">';
    echo "<h3>", htmlspecialchars($pset->title), "</h3>";
    if ($Me->privChair) {
        show_pset_actions($pset);
    }
    if ($pset->disabled) {
        echo "</div>\n";
        return;
    }
    $t0 = $Profile ? microtime(true) : 0;
    // load students
    if ($Conf->opt("restrictRepoView")) {
        $view = "l2.link repoviewable";
        $viewjoin = "left join ContactLink l2 on (l2.cid=c.contactId and l2.type=" . LINK_REPOVIEW . " and l2.link=l.link)\n";
    } else {
        $view = "4 repoviewable";
        $viewjoin = "";
    }
    $result = Dbl::qe("select c.contactId, c.firstName, c.lastName, c.email,\n\tc.huid, c.github_username, c.seascode_username, c.anon_username, c.extension, c.disabled, c.dropped, c.roles, c.contactTags,\n\tgroup_concat(pl.link) pcid, group_concat(rpl.link) rpcid,\n\tr.repoid, r.cacheid, r.heads, r.url, r.open, r.working, r.lastpset, r.snapcheckat, {$view},\n\trg.gradehash, rg.gradercid, rg.placeholder, rg.placeholder_at\n\tfrom ContactInfo c\n\tleft join ContactLink l on (l.cid=c.contactId and l.type=" . LINK_REPO . " and l.pset={$pset->id})\n\t{$viewjoin}\n\tleft join Repository r on (r.repoid=l.link)\n\tleft join ContactLink pl on (pl.cid=c.contactId and pl.type=" . LINK_PARTNER . " and pl.pset={$pset->id})\n\tleft join ContactLink rpl on (rpl.cid=c.contactId and rpl.type=" . LINK_BACKPARTNER . " and rpl.pset={$pset->id})\n\tleft join RepositoryGrade rg on (rg.repoid=r.repoid and rg.pset={$pset->id})\n\twhere (c.roles&" . Contact::ROLE_PCLIKE . ")=0\n\tand (rg.repoid is not null or not c.dropped)\n\tgroup by c.contactId, r.repoid");
    $t1 = $Profile ? microtime(true) : 0;
    $anonymous = $pset->anonymous;
    if (req("anonymous") !== null && $Me->privChair) {
        $anonymous = !!req("anonymous");
    }
    $students = array();
    while ($result && ($s = Contact::fetch($result))) {
        $s->set_anonymous($anonymous);
        Contact::set_sorter($s, req("sort"));
        $students[$s->contactId] = $s;
        // maybe lastpset links are out of order
        if ($s->lastpset < $pset) {
            $LastPsetFix = true;
        }
    }
    uasort($students, "Contact::compare");
    $checkbox = $Me->privChair || !$pset->gitless && $pset->runners;
    $rows = array();
    $max_ncol = 0;
    $incomplete = array();
    $pcmembers = pcMembers();
    $jx = [];
    foreach ($students as $s) {
        if (!$s->visited) {
            $row = (object) ["student" => $s, "text" => "", "ptext" => []];
            $j = render_pset_row($pset, $students, $s, $row, $pcmembers, $anonymous);
            if ($s->pcid) {
                foreach (array_unique(explode(",", $s->pcid)) as $pcid) {
                    if (isset($students[$pcid])) {
                        $jj = render_pset_row($pset, $students, $students[$pcid], $row, $pcmembers, $anonymous);
                        $j["partners"][] = $jj;
                    }
                }
            }
            if ($row->sortprefix) {
                $j["boring"] = true;
            }
            $jx[$row->sortprefix . $s->sorter] = $j;
            $max_ncol = max($max_ncol, $row->ncol);
            if ($s->incomplete) {
                $u = $Me->user_linkpart($s);
                $incomplete[] = '<a href="' . hoturl("pset", array("pset" => $pset->urlkey, "u" => $u, "sort" => req("sort"))) . '">' . htmlspecialchars($u) . '</a>';
            }
        }
    }
    if (count($incomplete)) {
        echo '<div id="incomplete_pset', $pset->id, '" style="display:none" class="merror">', '<strong>', htmlspecialchars($pset->title), '</strong>: ', 'Your grading is incomplete. Missing grades: ', join(", ", $incomplete), '</div>', '<script>jQuery("#incomplete_pset', $pset->id, '").remove().show().appendTo("#incomplete_notices")</script>';
    }
    if ($checkbox) {
        echo Ht::form_div(hoturl_post("index", array("pset" => $pset->urlkey, "save" => 1)));
    }
    $sort_key = $anonymous ? "anon_username" : "username";
    usort($jx, function ($a, $b) use($sort_key) {
        if (get($a, "boring") != get($b, "boring")) {
            return get($a, "boring") ? 1 : -1;
        }
        return strcmp($a[$sort_key], $b[$sort_key]);
    });
    echo '<table class="s61', $anonymous ? " s61anonymous" : "", '" id="pa-pset' . $pset->id . '"></table>';
    $jd = ["checkbox" => $checkbox, "anonymous" => $anonymous, "grade_keys" => array_keys($pset->grades), "gitless" => $pset->gitless, "gitless_grades" => $pset->gitless_grades, "urlpattern" => hoturl("pset", ["pset" => $pset->urlkey, "u" => "@", "sort" => req("sort")])];
    $i = $nintotal = $last_in_total = 0;
    foreach ($pset->grades as $ge) {
        if (!$ge->no_total) {
            ++$nintotal;
            $last_in_total = $ge->name;
        }
        ++$i;
    }
    if ($nintotal > 1) {
        $jd["need_total"] = true;
    } else {
        if ($nintotal == 1) {
            $jd["total_key"] = $last_in_total;
        }
    }
    echo Ht::unstash(), '<script>pa_render_pset_table(', $pset->id, ',', json_encode($jd), ',', json_encode(array_values($jx)), ')</script>';
    if ($Me->privChair && !$pset->gitless_grades) {
        echo "<div class='g'></div>";
        $sel = array("none" => "N/A");
        foreach (pcMembers() as $pcm) {
            $sel[$pcm->email] = Text::name_html($pcm);
        }
        $sel["__random__"] = "Random";
        echo '<span class="nb" style="padding-right:2em">', Ht::select("grader", $sel, "none"), Ht::submit("setgrader", "Set grader"), '</span>';
    }
    if (!$pset->gitless) {
        $sel = array();
        foreach ($pset->runners as $r) {
            if ($Me->can_run($pset, $r)) {
                $sel[$r->name] = htmlspecialchars($r->title);
            }
        }
        if (count($sel)) {
            echo '<span class="nb" style="padding-right:2em">', Ht::select("runner", $sel), Ht::submit("runmany", "Run all"), '</span>';
        }
    }
    if ($checkbox) {
        echo "</div></form>\n";
    }
    if ($Profile) {
        $t2 = microtime(true);
        echo sprintf("<div>Δt %.06f DB, %.06f total</div>", $t1 - $t0, $t2 - $t0);
    }
    echo "</div>\n";
}
Esempio n. 9
0
 function render($sv)
 {
     global $Conf;
     // Tags
     $tagger = new Tagger();
     echo "<h3 class=\"settings\">Tags</h3>\n";
     echo "<table class=\"secondary-settings\"><tbody>";
     $sv->set_oldv("tag_chair", join(" ", array_keys(TagInfo::chair_tags())));
     $sv->echo_entry_row("tag_chair", "Chair-only tags", "PC members can view these tags, but only administrators can change them.");
     $sv->set_oldv("tag_sitewide", join(" ", array_keys(TagInfo::sitewide_tags())));
     if ($sv->newv("tag_sitewide") || $Conf->has_any_manager()) {
         $sv->echo_entry_row("tag_sitewide", "Site-wide tags", "Chairs and administrators can view and change these tags for every paper.");
     }
     $sv->set_oldv("tag_approval", join(" ", array_keys(TagInfo::approval_tags())));
     $sv->echo_entry_row("tag_approval", "Approval voting tags", "<a href=\"" . hoturl("help", "t=votetags") . "\">What is this?</a>");
     $x = [];
     foreach (TagInfo::vote_tags() as $n => $v) {
         $x[] = "{$n}#{$v}";
     }
     $sv->set_oldv("tag_vote", join(" ", $x));
     $sv->echo_entry_row("tag_vote", "Allotment voting tags", "“vote#10” declares an allotment of 10 votes per PC member. <span class=\"barsep\">·</span> <a href=\"" . hoturl("help", "t=votetags") . "\">What is this?</a>");
     $sv->set_oldv("tag_rank", $Conf->setting_data("tag_rank", ""));
     $sv->echo_entry_row("tag_rank", "Ranking tag", "The <a href='" . hoturl("offline") . "'>offline reviewing page</a> will expose support for uploading rankings by this tag. <span class='barsep'>·</span> <a href='" . hoturl("help", "t=ranking") . "'>What is this?</a>");
     echo "</tbody></table>";
     echo "<div class='g'></div>\n";
     $sv->echo_checkbox('tag_seeall', "PC can see tags for conflicted papers");
     preg_match_all('_(\\S+)=(\\S+)_', $Conf->setting_data("tag_color", ""), $m, PREG_SET_ORDER);
     $tag_colors = array();
     foreach ($m as $x) {
         $tag_colors[TagInfo::canonical_color($x[2])][] = $x[1];
     }
     $tag_colors_rows = array();
     foreach (explode("|", TagInfo::BASIC_COLORS) as $k) {
         if ($sv->use_req()) {
             $v = defval($sv->req, "tag_color_{$k}", "");
         } else {
             if (isset($tag_colors[$k])) {
                 $v = join(" ", $tag_colors[$k]);
             } else {
                 $v = "";
             }
         }
         $tag_colors_rows[] = "<tr class='k0 {$k}tag'><td class='lxcaption'></td><td class='lxcaption taghl'>{$k}</td><td class='lentry' style='font-size: 10.5pt'><input type='text' name='tag_color_{$k}' value=\"" . htmlspecialchars($v) . "\" size='40' /></td></tr>";
         /* MAINSIZE */
     }
     preg_match_all('_(\\S+)=(\\S+)_', $Conf->setting_data("tag_badge", ""), $m, PREG_SET_ORDER);
     $tag_badges = array();
     foreach ($m as $x) {
         $tag_badges[$x[2]][] = $x[1];
     }
     foreach (["black" => "black label", "red" => "red label", "green" => "green label", "blue" => "blue label", "white" => "white label"] as $k => $desc) {
         if ($sv->use_req()) {
             $v = defval($sv->req, "tag_badge_{$k}", "");
         } else {
             if (isset($tag_badges[$k])) {
                 $v = join(" ", $tag_badges[$k]);
             } else {
                 $v = "";
             }
         }
         $tag_colors_rows[] = "<tr class='k0'><td class='lxcaption'></td><td class='lxcaption'><span class='badge {$k}badge' style='margin:0'>{$desc}</span><td class='lentry' style='font-size:10.5pt'><input type='text' name='tag_badge_{$k}' value=\"" . htmlspecialchars($v) . "\" size='40' /></td></tr>";
         /* MAINSIZE */
     }
     echo Ht::hidden("has_tag_color", 1), '<h3 class="settings g">Styles and colors</h3>', "<div class='hint'>Papers and PC members tagged with a style name, or with one of the associated tags, will appear in that style in lists.</div>", "<div class='smg'></div>", "<table id='foldtag_color'><tr><th colspan='2'>Style name</th><th>Tags</th></tr>", join("", $tag_colors_rows), "</table>\n";
     echo '<h3 class="settings g">Tracks</h3>', "\n";
     echo "<div class='hint'>Tracks control the PC members allowed to view or review different sets of papers. <span class='barsep'>·</span> <a href=\"" . hoturl("help", "t=tracks") . "\">What is this?</a></div>", Ht::hidden("has_tracks", 1), "<div class=\"smg\"></div>\n";
     $this->do_track($sv, "", 0);
     $tracknum = 2;
     $trackj = $Conf->setting_json("tracks") ?: (object) array();
     // existing tracks
     foreach ($trackj as $trackname => $x) {
         if ($trackname !== "_") {
             $this->do_track($sv, $trackname, $tracknum);
             ++$tracknum;
         }
     }
     // new tracks (if error prevented saving)
     if ($sv->use_req()) {
         for ($i = 1; isset($sv->req["name_track{$i}"]); ++$i) {
             $trackname = trim($sv->req["name_track{$i}"]);
             if (!isset($trackj->{$trackname})) {
                 $this->do_track($sv, $trackname, $tracknum);
                 ++$tracknum;
             }
         }
     }
     // catchall track
     $this->do_track($sv, "_", 1);
     echo Ht::button("Add track", array("onclick" => "settings_add_track()"));
 }
Esempio n. 10
0
function admin_home_messages()
{
    global $Opt, $Conf;
    $m = array();
    $errmarker = "<span class=\"error\">Error:</span> ";
    if (preg_match("/^(?:[1-4]\\.|5\\.[012])/", phpversion())) {
        $m[] = $errmarker . "HotCRP requires PHP version 5.3 or higher.  You are running PHP version " . htmlspecialchars(phpversion()) . ".";
    }
    if (get_magic_quotes_gpc()) {
        $m[] = $errmarker . "The PHP <code>magic_quotes_gpc</code> feature is on, which is a bad idea.  Check that your Web server is using HotCRP’s <code>.htaccess</code> file.  You may also want to disable <code>magic_quotes_gpc</code> in your <code>php.ini</code> configuration file.";
    }
    if (get_magic_quotes_runtime()) {
        $m[] = $errmarker . "The PHP <code>magic_quotes_runtime</code> feature is on, which is a bad idea.  Check that your Web server is using HotCRP’s <code>.htaccess</code> file.  You may also want to disable <code>magic_quotes_runtime</code> in your <code>php.ini</code> configuration file.";
    }
    if (defined("JSON_HOTCRP")) {
        $m[] = "Your PHP was built without JSON functionality. HotCRP is using its built-in replacements; the native functions would be faster.";
    }
    if ((int) $Opt["globalSessionLifetime"] < $Opt["sessionLifetime"]) {
        $m[] = "PHP’s systemwide <code>session.gc_maxlifetime</code> setting, which is " . htmlspecialchars($Opt["globalSessionLifetime"]) . " seconds, is less than HotCRP’s preferred session expiration time, which is " . $Opt["sessionLifetime"] . " seconds.  You should update <code>session.gc_maxlifetime</code> in the <code>php.ini</code> file or users may be booted off the system earlier than you expect.";
    }
    if (!function_exists("imagecreate")) {
        $m[] = $errmarker . "This PHP installation lacks support for the GD library, so HotCRP cannot generate score charts (as backup for browsers that don’t support &lt;canvas&gt;). You should update your PHP installation. For example, on Ubuntu Linux, install the <code>php5-gd</code> package.";
    }
    $result = $Conf->qx("show variables like 'max_allowed_packet'");
    $max_file_size = ini_get_bytes("upload_max_filesize");
    if (($row = edb_row($result)) && $row[1] < $max_file_size && !@$Opt["dbNoPapers"]) {
        $m[] = $errmarker . "MySQL’s <code>max_allowed_packet</code> setting, which is " . htmlspecialchars($row[1]) . "&nbsp;bytes, is less than the PHP upload file limit, which is {$max_file_size}&nbsp;bytes.  You should update <code>max_allowed_packet</code> in the system-wide <code>my.cnf</code> file or the system may not be able to handle large papers.";
    }
    // Conference names
    if (@$Opt["shortNameDefaulted"]) {
        $m[] = "<a href=\"" . hoturl("settings", "group=msg") . "\">Set the conference abbreviation</a> to a short name for your conference, such as “OSDI ’14”.";
    } else {
        if (simplify_whitespace($Opt["shortName"]) != $Opt["shortName"]) {
            $m[] = "The <a href=\"" . hoturl("settings", "group=msg") . "\">conference abbreviation</a> setting has a funny value. To fix it, remove leading and trailing spaces, use only space characters (no tabs or newlines), and make sure words are separated by single spaces (never two or more).";
        }
    }
    $site_contact = Contact::site_contact();
    if (!$site_contact->email || $site_contact->email == "*****@*****.**") {
        $m[] = "<a href=\"" . hoturl("settings", "group=msg") . "\">Set the conference contact’s name and email</a> so submitters can reach someone if things go wrong.";
    }
    // Backwards compatibility
    if (@$Conf->setting_data("clickthrough_submit")) {
        // delete 12/2014
        $m[] = "You need to recreate the <a href=\"" . hoturl("settings", "group=msg") . "\">clickthrough submission terms</a>.";
    }
    // Weird URLs?
    foreach (array("conferenceSite", "paperSite") as $k) {
        if (isset($Opt[$k]) && $Opt[$k] && !preg_match('`\\Ahttps?://(?:[-.~\\w:/?#\\[\\]@!$&\'()*+,;=]|%[0-9a-fA-F][0-9a-fA-F])*\\z`', $Opt[$k])) {
            $m[] = $errmarker . "The <code>\$Opt[\"{$k}\"]</code> setting, ‘<code>" . htmlspecialchars($Opt[$k]) . "</code>’, is not a valid URL.  Edit the <code>conf/options.php</code> file to fix this problem.";
        }
    }
    // Double-encoding bugs found?
    if ($Conf->setting("bug_doubleencoding")) {
        $m[] = "Double-encoded URLs have been detected. Incorrect uses of Apache’s <code>mod_rewrite</code>, and other middleware, can encode URL parameters twice. This can cause problems, for instance when users log in via links in email. (“<code>a@b.com</code>” should be encoded as “<code>a%40b.com</code>”; a double encoding will produce “<code>a%2540b.com</code>”.) HotCRP has tried to compensate, but you really should fix the problem. For <code>mod_rewrite</code> add <a href='http://httpd.apache.org/docs/current/mod/mod_rewrite.html'>the <code>[NE]</code> option</a> to the relevant RewriteRule. <a href=\"" . hoturl_post("index", "clearbug=doubleencoding") . "\">(Clear&nbsp;this&nbsp;message)</a>";
    }
    // Unnotified reviews?
    if ($Conf->setting("pcrev_assigntime", 0) > $Conf->setting("pcrev_informtime", 0)) {
        $assigntime = $Conf->setting("pcrev_assigntime");
        $result = $Conf->qe("select paperId from PaperReview where reviewType>" . REVIEW_PC . " and timeRequested>timeRequestNotified and reviewSubmitted is null and reviewNeedsSubmit!=0 limit 1");
        if (edb_nrows($result)) {
            $m[] = "PC review assignments have changed. You may want to <a href=\"" . hoturl("mail", "template=newpcrev") . "\">send mail about the new assignments</a>. <a href=\"" . hoturl_post("index", "clearnewpcrev={$assigntime}") . "\">(Clear&nbsp;this&nbsp;message)</a>";
        } else {
            $Conf->save_setting("pcrev_informtime", $assigntime);
        }
    }
    if (count($m)) {
        $Conf->warnMsg("<div>" . join('</div><div style="margin-top:0.5em">', $m) . "</div>");
    }
}
Esempio n. 11
0
if ($User->seascode_username && $Me->isPC) {
    // links to next/prev users
    $links = user_prev_next($User, $Pset);
    if ($links[0] || $links[1]) {
        $userkey = $User->is_anonymous ? "anon_username" : "seascode_username";
        echo "<div style=\"color:gray;float:right\"><h3 style=\"margin-top:0\">";
        if ($links[0]) {
            $u = $Me->user_linkpart($links[0], $User->is_anonymous);
            echo '<a href="', hoturl("pset", array("pset" => $Pset->urlkey, "u" => $u, "sort" => @$_REQUEST["sort"])), '">« ', htmlspecialchars($u), '</a>';
        }
        if ($links[0] && $links[1]) {
            echo ' · ';
        }
        if ($links[1]) {
            $u = $Me->user_linkpart($links[1], $User->is_anonymous);
            echo '<a href="', hoturl("pset", array("pset" => $Pset->urlkey, "u" => $u, "sort" => @$_REQUEST["sort"])), '">', htmlspecialchars($u), ' »</a>';
        }
        echo "</h3></div>";
    }
}
ContactView::echo_heading($User);
$u = $Me->user_linkpart($User);
// Per-pset
function diff_line_code($t)
{
    global $TABWIDTH;
    while (($p = strpos($t, "\t")) !== false) {
        $t = substr($t, 0, $p) . str_repeat(" ", $TABWIDTH - $p % $TABWIDTH) . substr($t, $p + 1);
    }
    return str_replace("  ", " &nbsp;", htmlspecialchars($t));
}
Esempio n. 12
0
 function crosscheck($sv)
 {
     if (($sv->has_interest("options") || $sv->has_interest("sub_blind")) && $sv->newv("options") && $sv->newv("sub_blind") == Conf::BLIND_ALWAYS) {
         $options = json_decode($sv->newv("options"));
         foreach ((array) $options as $id => $o) {
             if (get($o, "visibility") === "nonblind") {
                 $sv->set_warning("optp{$id}", "The “" . htmlspecialchars($o->name) . "” option is “visible if authors are visible,” but authors are not visible. You may want to change <a href=\"" . hoturl("settings", "group=sub") . "\">Settings &gt; Submissions</a> &gt; Blind submission to “Blind until review.”");
             }
         }
     }
 }
function saveAssignments($qreq, $reviewer)
{
    global $Conf, $Me, $Now, $pcm;
    $reviewer_contact = $pcm[$reviewer];
    $round_number = null;
    if (!count($qreq->assrev)) {
        return;
    }
    $result = Dbl::qe_raw($Conf->paperQuery($Me, array("paperId" => array_keys($qreq->assrev), "reviewer" => $reviewer)));
    $lastPaperId = -1;
    $del = $ins = "";
    while ($row = PaperInfo::fetch($result, $Me)) {
        if ($row->paperId == $lastPaperId || !$Me->can_administer($row) || $row->reviewerConflictType >= CONFLICT_AUTHOR || !isset($qreq->assrev[$row->paperId])) {
            continue;
        }
        $lastPaperId = $row->paperId;
        $type = $qreq->assrev[$row->paperId];
        if ($type >= 0 && $row->reviewerConflictType > 0 && $row->reviewerConflictType < CONFLICT_AUTHOR) {
            $del .= " or paperId={$row->paperId}";
        }
        if ($type < 0 && $row->reviewerConflictType < CONFLICT_CHAIRMARK) {
            $ins .= ", ({$row->paperId}, {$reviewer}, " . CONFLICT_CHAIRMARK . ")";
        }
        if ($qreq->kind == "a" && $type != $row->reviewerReviewType && ($type <= 0 || $reviewer_contact->can_accept_review_assignment_ignore_conflict($row))) {
            if ($type > 0 && $round_number === null) {
                $round_number = $Conf->round_number($qreq->rev_roundtag, true);
            }
            $Me->assign_review($row->paperId, $reviewer, $type, array("round_number" => $round_number));
        }
    }
    if ($ins) {
        $Conf->qe("insert into PaperConflict (paperId, contactId, conflictType) values " . substr($ins, 2) . " on duplicate key update conflictType=greatest(conflictType,values(conflictType))");
    }
    if ($del) {
        $Conf->qe("delete from PaperConflict where contactId={$reviewer} and (" . substr($del, 4) . ")");
    }
    $Conf->update_rev_tokens_setting(false);
    if ($Conf->setting("pcrev_assigntime") == $Now) {
        $Conf->confirmMsg("Assignments saved! You may want to <a href=\"" . hoturl("mail", "template=newpcrev") . "\">send mail about the new assignments</a>.");
    }
    redirectSelf(["kind" => $qreq->kind]);
}
Esempio n. 14
0
    $dt = HotCRPDocument::parse_dtype(@$_REQUEST["dt"]);
    if ($dt === null) {
        $dt = @$_REQUEST["final"] ? DTYPE_FINAL : DTYPE_SUBMISSION;
    }
    if ($Conf->setting("sub_banal{$dt}")) {
        $format = $Conf->setting_data("sub_banal{$dt}", "");
    } else {
        $format = $Conf->setting_data("sub_banal", "");
    }
    $status = $cf->analyzePaper($prow->paperId, $dt, $format);
    // chairs get a hint message about multiple checking
    if ($Me->privChair) {
        $nbanal = $Conf->session("nbanal", 0) + 1;
        $Conf->save_session("nbanal", $nbanal);
        if ($nbanal >= 3 && $nbanal <= 6) {
            $cf->msg("info", "To run the format checker for many papers, use Download &gt; Format check on the <a href='" . hoturl("search", "q=") . "'>search page</a>.");
        }
    }
    $cf->reportMessages();
    if ($ajax) {
        $Conf->ajaxExit(array("status" => $status), true);
    }
}
// withdraw and revive actions
if (isset($_REQUEST["withdraw"]) && !$newPaper && check_post()) {
    if (!($whyNot = $Me->perm_withdraw_paper($prow))) {
        $reason = defval($_REQUEST, "reason", "");
        if ($reason == "" && $Me->privChair && defval($_REQUEST, "doemail") > 0) {
            $reason = defval($_REQUEST, "emailNote", "");
        }
        Dbl::qe("update Paper set timeWithdrawn={$Now}, timeSubmitted=if(timeSubmitted>0,-100,0), withdrawReason=? where paperId={$prow->paperId}", $reason != "" ? $reason : null);
 private function normalize($cj, $old_user)
 {
     // Errors prevent saving
     global $Conf, $Me, $Now;
     // Canonicalize keys
     foreach (array("preferredEmail" => "preferred_email", "institution" => "affiliation", "voicePhoneNumber" => "phone", "addressLine1" => "address", "zipCode" => "zip", "postal_code" => "zip") as $x => $y) {
         if (isset($cj->{$x}) && !isset($cj->{$y})) {
             $cj->{$y} = $cj->{$x};
         }
     }
     // Stringiness
     foreach (array("firstName", "lastName", "email", "preferred_email", "affiliation", "phone", "old_password", "new_password", "city", "state", "zip", "country") as $k) {
         if (isset($cj->{$k}) && !is_string($cj->{$k})) {
             $this->set_error($k, "Format error [{$k}]");
             unset($cj->{$k});
         }
     }
     // Email
     if (!get($cj, "email") && $old_user) {
         $cj->email = $old_user->email;
     } else {
         if (!get($cj, "email")) {
             $this->set_error("email", "Email is required.");
         } else {
             if (!isset($this->errf["email"]) && !validate_email($cj->email) && (!$old_user || $old_user->email !== $cj->email)) {
                 $this->set_error("email", "Invalid email address “" . htmlspecialchars($cj->email) . "”.");
             }
         }
     }
     // ID
     if (get($cj, "id") === "new") {
         if (get($cj, "email") && Contact::id_by_email($cj->email)) {
             $this->set_error("email", "Email address “" . htmlspecialchars($cj->email) . "” is already in use.");
             $this->errf["email_inuse"] = true;
         }
     } else {
         if (!get($cj, "id") && $old_user && $old_user->contactId) {
             $cj->id = $old_user->contactId;
         }
         if (get($cj, "id") && !is_int($cj->id)) {
             $this->set_error("id", "Format error [id]");
         }
         if ($old_user && get($cj, "email") && strtolower($old_user->email) !== strtolower($cj->email) && Contact::id_by_email($cj->email)) {
             $this->set_error("email", "Email address “" . htmlspecialchars($cj->email) . "” is already in use. You may want to <a href=\"" . hoturl("mergeaccounts") . "\">merge these accounts</a>.");
         }
     }
     // Contactdb information
     if ($old_user && !$old_user->contactId) {
         if (!isset($cj->firstName) && !isset($cj->lastName)) {
             $cj->firstName = $old_user->firstName;
             $cj->lastName = $old_user->lastName;
         }
         if (!isset($cj->affiliation)) {
             $cj->affiliation = $old_user->affiliation;
         }
         if (!isset($cj->collaborators)) {
             $cj->collaborators = $old_user->collaborators;
         }
     }
     // Preferred email
     if (get($cj, "preferred_email") && !isset($this->errf["preferred_email"]) && !validate_email($cj->preferred_email) && (!$old_user || $old_user->preferredEmail !== $cj->preferred_email)) {
         $this->set_error("preferred_email", "Invalid email address “" . htmlspecialchars($cj->preferred_email) . "”");
     }
     // Address
     $address = array();
     if (is_array(get($cj, "address"))) {
         $address = $cj->address;
     } else {
         if (is_string(get($cj, "address"))) {
             $address[] = $cj->address;
         } else {
             if (get($cj, "address")) {
                 $this->set_error("address", "Format error [address]");
             }
         }
         if (is_string(get($cj, "address2"))) {
             $address[] = $cj->address2;
         } else {
             if (is_string(get($cj, "addressLine2"))) {
                 $address[] = $cj->addressLine2;
             } else {
                 if (get($cj, "address2") || get($cj, "addressLine2")) {
                     $this->set_error("address2", "Format error [address2]");
                 }
             }
         }
     }
     foreach ($address as $a) {
         if (!is_string($a)) {
             $this->set_error("address", "Format error [address]");
         }
     }
     if (count($address)) {
         $cj->address = $address;
     }
     // Collaborators
     if (is_array(get($cj, "collaborators"))) {
         foreach ($cj->collaborators as $c) {
             if (!is_string($c)) {
                 $this->set_error("collaborators", "Format error [collaborators]");
             }
         }
     }
     if (is_array(get($cj, "collaborators")) && !isset($this->errf["collaborators"])) {
         $cj->collaborators = join("\n", $cj->collaborators);
     }
     if (get($cj, "collaborators") && !is_string($cj->collaborators) && !isset($this->errf["collaborators"])) {
         $this->set_error("collaborators", "Format error [collaborators]");
     }
     // Disabled
     if (isset($cj->disabled)) {
         if (($x = friendly_boolean($cj->disabled)) !== null) {
             $cj->disabled = $x;
         } else {
             $this->set_error("disabled", "Format error [disabled]");
         }
     }
     // Follow
     if (isset($cj->follow)) {
         $cj->follow = $this->make_keyed_object($cj->follow, "follow");
         $cj->bad_follow = array();
         foreach ((array) $cj->follow as $k => $v) {
             if ($v && $k !== "reviews" && $k !== "allreviews" && $k !== "allfinal") {
                 $cj->bad_follow[] = $k;
             }
         }
     }
     // Roles
     if (isset($cj->roles)) {
         $cj->roles = $this->make_keyed_object($cj->roles, "roles");
         $cj->bad_roles = array();
         foreach ((array) $cj->roles as $k => $v) {
             if ($v && $k !== "pc" && $k !== "chair" && $k !== "sysadmin" && $k !== "no") {
                 $cj->bad_roles[] = $k;
             }
         }
         if ($this->no_deprivilege_self && $Me && $old_user && $old_user->contactId == $Me->contactId && Contact::parse_roles_json($cj->roles) < $Me->roles) {
             unset($cj->roles);
             $this->set_warning("roles", "Ignoring request to drop your privileges.");
         }
     }
     // Tags
     if (isset($cj->tags)) {
         $cj->tags = $this->make_tags_array($cj->tags, "tags");
     }
     if (isset($cj->add_tags) || isset($cj->remove_tags)) {
         // collect old tags as map by base
         if (!isset($cj->tags) && $old_user) {
             $cj->tags = preg_split("/[\\s,]+/", $old_user->contactTags);
         } else {
             if (!isset($cj->tags)) {
                 $cj->tags = array();
             }
         }
         $old_tags = array();
         foreach ($cj->tags as $t) {
             if ($t !== "") {
                 list($tag, $index) = TagInfo::split_index($t);
                 $old_tags[$tag] = $index;
             }
         }
         // process removals, then additions
         foreach ($this->make_tags_array(get($cj, "remove_tags"), "remove_tags") as $t) {
             list($tag, $index) = TagInfo::split_index($t);
             if ($index === false || get($old_tags, $tag) == $index) {
                 unset($old_tags[$tag]);
             }
         }
         foreach ($this->make_tags_array($cj->add_tags, "add_tags") as $t) {
             list($tag, $index) = TagInfo::split_index($t);
             $old_tags[$tag] = $index;
         }
         // collect results
         $cj->tags = array();
         foreach ($old_tags as $tag => $index) {
             $cj->tags[] = $tag . "#" . (double) $index;
         }
     }
     // Topics
     if (isset($cj->topics)) {
         $topics = $this->make_keyed_object($cj->topics, "topics");
         $topic_map = $Conf->topic_map();
         $cj->topics = (object) array();
         $cj->bad_topics = array();
         foreach ((array) $topics as $k => $v) {
             if (get($topic_map, $k)) {
                 /* OK */
             } else {
                 if (($x = array_search($k, $topic_map, true)) !== false) {
                     $k = $x;
                 } else {
                     $cj->bad_topics[] = $k;
                     continue;
                 }
             }
             if ($v === "mlow" || $v === "medium-low") {
                 $v = -1;
             } else {
                 if ($v === true || $v === "mhigh" || $v === "medium-high") {
                     $v = 2;
                 } else {
                     if ($v === "low") {
                         $v = -2;
                     } else {
                         if ($v === "high") {
                             $v = 4;
                         } else {
                             if ($v === "medium" || $v === "none" || $v === false) {
                                 $v = 0;
                             } else {
                                 if (is_numeric($v)) {
                                     $v = (int) $v;
                                 } else {
                                     $this->set_error("topics", "Topic interest format error");
                                     continue;
                                 }
                             }
                         }
                     }
                 }
             }
             $k = (string) $k;
             $cj->topics->{$k} = $v;
         }
     }
 }
Esempio n. 16
0
function exit_to_paper()
{
    global $prow;
    go(hoturl("paper", array("p" => $prow ? $prow->paperId : @$_REQUEST["p"], "c" => @$_REQUEST["c"], "ls" => @$_REQUEST["ls"])));
}
Esempio n. 17
0
        }
        echo '$(function () { hotcrp_graphs.', $gtype, "(hotgraph_info) });\n</script>";
    } else {
        echo "<h2>Formulas</h2>\n";
    }
    echo Ht::form_div(hoturl("graph", "g=formula"), array("method" => "get"));
    echo '<table>';
    // X axis
    echo '<tr><td class="lcaption"><label for="fx">X axis</label></td>', '<td class="lentry">', Ht::entry("fx", (string) @$_REQUEST["fx"] !== "" ? $_REQUEST["fx"] : "", array("id" => "fx", "size" => 32, "class" => $fg && @$fg->errf["fx"] ? "setting_error" : "")), '<span class="hint" style="padding-left:2em"><a href="', hoturl("help", "t=formulas"), '">Formula</a> or “search”</span>', '</td></tr>';
    // Y axis
    echo '<tr><td class="lcaption"><label for="fy">Y axis</label></td>', '<td class="lentry" style="padding-bottom:0.8em">', Ht::entry("fy", (string) @$_REQUEST["fy"] !== "" ? $_REQUEST["fy"] : "", array("id" => "fy", "size" => 32, "class" => $fg && @$fg->errf["fy"] ? "setting_error" : "")), '<span class="hint" style="padding-left:2em"><a href="', hoturl("help", "t=formulas"), '">Formula</a> or “cdf”, “count”, “fraction”, “box <em>formula</em>”, “bar <em>formula</em>”</span>', '</td></tr>';
    // Series
    echo '<tr><td class="lcaption"><label for="q">Search</label></td>', '<td class="lentry"><table><tbody id="qcontainer" data-row-template="', htmlspecialchars(formulas_qrow('$', "", "by-tag", false)), '">';
    for ($i = 0; $i < count($styles); ++$i) {
        echo formulas_qrow($i + 1, $queries[$i], $styles[$i], $fg && @$fg->errf["q{$i}"]);
    }
    echo "</tbody></table>\n";
    echo '<tr><td></td><td class="lentry">', Ht::js_button("Add search", "hotcrp_graphs.formulas_add_qrow()"), '</td></tr>';
    echo '</table>';
    echo '<div class="g"></div>';
    echo Ht::submit(null, "Graph");
    echo '</div></form>';
}
echo '<div style="margin:2em 0"><strong>More graphs:</strong>&nbsp; ';
$ghtml = array();
foreach ($Graphs as $g => $gname) {
    $ghtml[] = '<a' . ($g == $Graph ? ' class="q"' : '') . ' href="' . hoturl("graph", "g={$g}") . '">' . htmlspecialchars($gname) . '</a>';
}
echo join(' <span class="barsep">·</span> ', $ghtml), '</div>';
echo "<hr class=\"c\" />\n";
$Conf->footer();
Esempio n. 18
0
 static function create($reg, $send = false)
 {
     global $Conf, $Me, $Opt, $Now;
     if (is_array($reg)) {
         $reg = (object) $reg;
     }
     assert(is_string($reg->email));
     $email = trim($reg->email);
     assert($email !== "");
     // look up account first
     if ($acct = self::find_by_email($email)) {
         return $acct;
     }
     // validate email, check contactdb
     if (!get($reg, "no_validate_email") && !validate_email($email)) {
         return null;
     }
     $cdbu = Contact::contactdb_find_by_email($email);
     if (get($reg, "only_if_contactdb") && !$cdbu) {
         return null;
     }
     $cj = (object) array();
     foreach (array("firstName", "lastName", "email", "affiliation", "collaborators", "preferredEmail") as $k) {
         if ($v = $cdbu && $cdbu->{$k} ? $cdbu->{$k} : get($reg, $k)) {
             $cj->{$k} = $v;
         }
     }
     if ($v = $cdbu && $cdbu->voicePhoneNumber ? $cdbu->voicePhoneNumber : get($reg, "voicePhoneNumber")) {
         $cj->phone = $v;
     }
     if ($cdbu && $cdbu->disabled || get($reg, "disabled")) {
         $cj->disabled = true;
     }
     $acct = new Contact();
     if ($acct->save_json($cj, null, $send)) {
         if ($Me && $Me->privChair) {
             $type = $acct->disabled ? "disabled " : "";
             $Conf->infoMsg("Created {$type}account for <a href=\"" . hoturl("profile", "u=" . urlencode($acct->email)) . "\">" . Text::user_html_nolink($acct) . "</a>.");
         }
         return $acct;
     } else {
         $Conf->log("Account {$email} creation failure", $Me);
         return null;
     }
 }
Esempio n. 19
0
 private function echo_prologue()
 {
     global $Conf, $Me;
     if ($this->started) {
         return;
     }
     echo Ht::form_div(hoturl_post("mail"));
     foreach (array("recipients", "subject", "emailBody", "cc", "replyto", "q", "t", "plimit", "newrev_since") as $x) {
         if (isset($_REQUEST[$x])) {
             echo Ht::hidden($x, $_REQUEST[$x]);
         }
     }
     if (!$this->group) {
         echo Ht::hidden("ungroup", 1);
     }
     $recipients = defval($_REQUEST, "recipients", "");
     if ($this->sending) {
         echo "<div id='foldmail' class='foldc fold2c'>", "<div class='fn fx2 merror'>In the process of sending mail.  <strong>Do not leave this page until this message disappears!</strong><br /><span id='mailcount'></span></div>", "<div id='mailwarnings'></div>", "<span id='mailinfo'></span>", "<div class='fx'><div class='confirm'>Sent mail as follows.</div>", "<div class='aa'>", Ht::submit("go", "Prepare more mail"), "</div></div>", "<div class='fn2 warning'>Sending mail. <strong>Do not leave this page until it finishes rendering!</strong></div>", "</div>";
     } else {
         if (isset($_REQUEST["emailBody"]) && $Me->privChair && (strpos($_REQUEST["emailBody"], "%REVIEWS%") || strpos($_REQUEST["emailBody"], "%COMMENTS%"))) {
             if (!$Conf->timeAuthorViewReviews()) {
                 echo "<div class='warning'>Although these mails contain reviews and/or comments, authors can’t see reviews or comments on the site. (<a href='", hoturl("settings", "group=dec"), "' class='nw'>Change this setting</a>)</div>\n";
             } else {
                 if (!$Conf->timeAuthorViewReviews(true)) {
                     echo "<div class='warning'>Mails to users who have not completed their own reviews will not include reviews or comments. (<a href='", hoturl("settings", "group=dec"), "' class='nw'>Change the setting</a>)</div>\n";
                 }
             }
         }
         if (isset($_REQUEST["emailBody"]) && $Me->privChair && substr($recipients, 0, 4) == "dec:") {
             if (!$Conf->timeAuthorViewDecision()) {
                 echo "<div class='warning'>You appear to be sending an acceptance or rejection notification, but authors can’t see paper decisions on the site. (<a href='", hoturl("settings", "group=dec"), "' class='nw'>Change this setting</a>)</div>\n";
             }
         }
         echo "<div id='foldmail' class='foldc fold2c'>", "<div class='fn fx2 warning'>In the process of preparing mail.  You will be able to send the prepared mail once this message disappears.<br /><span id='mailcount'></span></div>", "<div id='mailwarnings'></div>", "<div class='fx info'>Verify that the mails look correct, then select “Send” to send the checked mails.<br />", "Mailing to:&nbsp;", $this->recip->unparse(), "<span id='mailinfo'></span>";
         if (!preg_match('/\\A(?:pc\\z|pc:|all\\z)/', $recipients) && defval($_REQUEST, "plimit") && $_REQUEST["q"] !== "") {
             echo "<br />Paper selection:&nbsp;", htmlspecialchars($_REQUEST["q"]);
         }
         echo "</div>";
         $this->echo_actions(" fx");
         // This next is only displayed when Javascript is off
         echo '<div class="fn2 warning">Scroll down to send the prepared mail once the page finishes loading.</div>', "</div>\n";
     }
     $Conf->echoScript("fold('mail',0,2)");
     $this->started = true;
 }
Esempio n. 20
0
}
if (!$Sv->warnings_reported) {
    SettingGroup::crosscheck($Sv, $Group);
    $Sv->report();
}
$Conf->header("Settings &nbsp;&#x2215;&nbsp; <strong>" . SettingGroup::$all[$Group]->description . "</strong>", "settings", actionBar());
$Conf->echoScript("");
// clear out other script references
echo $Conf->make_script_file("scripts/settings.js"), "\n";
echo Ht::form(hoturl_post("settings", "group={$Group}"), array("id" => "settingsform"));
echo '<div class="leftmenu_menucontainer"><div class="leftmenu_list">';
foreach (SettingGroup::all() as $g) {
    if ($g->name === $Group) {
        echo '<div class="leftmenu_item_on">', $g->description, '</div>';
    } else {
        echo '<div class="leftmenu_item">', '<a href="', hoturl("settings", "group={$g->name}"), '">', $g->description, '</a></div>';
    }
}
echo "</div></div>\n", '<div class="leftmenu_content_container"><div class="leftmenu_content">', '<div class="leftmenu_body">';
Ht::stash_script("jQuery(\".leftmenu_item\").click(divclick)");
function doActionArea($top)
{
    echo "<div class='aa'>", Ht::submit("update", "Save changes", array("class" => "bb")), " &nbsp;", Ht::submit("cancel", "Cancel"), "</div>";
}
echo "<div class='aahc'>";
doActionArea(true);
echo "<div>";
$Sv->interesting_groups[$Group] = true;
SettingGroup::$all[$Group]->render($Sv);
echo "</div>";
doActionArea(false);
Esempio n. 21
0
function whyNotText($whyNot, $action)
{
    global $Conf, $Now;
    if (!is_array($whyNot)) {
        $whyNot = array($whyNot => 1);
    }
    $paperId = isset($whyNot['paperId']) ? $whyNot['paperId'] : -1;
    $reviewId = isset($whyNot['reviewId']) ? $whyNot['reviewId'] : -1;
    $thisPaper = $paperId < 0 ? "this paper" : "paper #{$paperId}";
    $text = '';
    if (isset($whyNot['invalidId'])) {
        $x = $whyNot['invalidId'] . "Id";
        $xid = isset($whyNot[$x]) ? " \"" . $whyNot[$x] . "\"" : "";
        $text .= "Invalid " . $whyNot['invalidId'] . " number" . htmlspecialchars($xid) . ". ";
    }
    if (isset($whyNot['noPaper'])) {
        $text .= "No such paper" . ($paperId < 0 ? "" : " #{$paperId}") . ". ";
    }
    if (isset($whyNot['noReview'])) {
        $text .= "No such review" . ($reviewId < 0 ? "" : " #{$reviewId}") . ". ";
    }
    if (isset($whyNot["dbError"])) {
        $text .= $whyNot["dbError"] . " ";
    }
    if (isset($whyNot["permission"])) {
        $text .= "You don’t have permission to {$action} {$thisPaper}. ";
    }
    if (isset($whyNot["signin"])) {
        $text .= "You must sign in to {$action} {$thisPaper}. ";
    }
    if (isset($whyNot["withdrawn"])) {
        $text .= ucfirst($thisPaper) . " has been withdrawn. ";
    }
    if (isset($whyNot['notWithdrawn'])) {
        $text .= ucfirst($thisPaper) . " has not been withdrawn. ";
    }
    if (isset($whyNot['notSubmitted'])) {
        $text .= ucfirst($thisPaper) . " is not submitted. ";
    }
    if (isset($whyNot["rejected"])) {
        $text .= ucfirst($thisPaper) . " was not accepted for publication. ";
    }
    if (isset($whyNot["decided"])) {
        $text .= "The review process for {$thisPaper} has completed. ";
    }
    if (isset($whyNot['updateSubmitted'])) {
        $text .= ucfirst($thisPaper) . " has already been submitted and can no longer be updated. ";
    }
    if (isset($whyNot['notUploaded'])) {
        $text .= ucfirst($thisPaper) . " can’t be submitted because you haven’t yet uploaded the paper itself. Upload the paper and try again. ";
    }
    if (isset($whyNot['reviewNotSubmitted'])) {
        $text .= "This review is not yet ready for others to see. ";
    }
    if (isset($whyNot['reviewNotComplete'])) {
        $text .= "Your own review for {$thisPaper} is not complete, so you can’t view other people’s reviews. ";
    }
    if (isset($whyNot['responseNotReady'])) {
        $text .= "The authors’ response for {$thisPaper} is not yet ready for reviewers to view. ";
    }
    if (isset($whyNot['reviewsOutstanding'])) {
        $text .= "You will get access to the reviews once you complete <a href=\"" . hoturl("search", "q=&amp;t=r") . "\">your assigned reviews for other papers</a>.  If you can’t complete your reviews, please let the conference organizers know via the “Refuse review” links. ";
    }
    if (isset($whyNot['reviewNotAssigned'])) {
        $text .= "You are not assigned to review {$thisPaper}. ";
    }
    if (isset($whyNot['deadline'])) {
        $dname = $whyNot['deadline'];
        if ($dname[0] == "s") {
            $start = $Conf->setting("sub_open", -1);
        } else {
            if ($dname[0] == "p" || $dname[0] == "e") {
                $start = $Conf->setting("rev_open", -1);
            } else {
                $start = 1;
            }
        }
        $end = $Conf->setting($dname, -1);
        if ($start <= 0 || $start == $end) {
            $text .= "You can’t {$action} {$thisPaper} yet. ";
        } else {
            if ($start > 0 && $Now < $start) {
                $text .= "You can’t {$action} {$thisPaper} until " . $Conf->printableTime($start, "span") . ". ";
            } else {
                if ($end > 0 && $Now > $end) {
                    if ($dname == "sub_reg") {
                        $text .= "The paper registration deadline has passed. ";
                    } else {
                        if ($dname == "sub_update") {
                            $text .= "The deadline to update papers has passed. ";
                        } else {
                            if ($dname == "sub_sub") {
                                $text .= "The paper submission deadline has passed. ";
                            } else {
                                if ($dname == "extrev_hard") {
                                    $text .= "The external review deadline has passed. ";
                                } else {
                                    if ($dname == "pcrev_hard") {
                                        $text .= "The PC review deadline has passed. ";
                                    } else {
                                        if ($dname == "final_done") {
                                            $text .= "The deadline to update final versions has passed. ";
                                        } else {
                                            $text .= "The deadline to {$action} {$thisPaper} has passed. ";
                                        }
                                    }
                                }
                            }
                        }
                    }
                    $text .= "It was " . $Conf->printableTime($end, "span") . ". ";
                } else {
                    if ($dname == "au_seerev") {
                        if ($Conf->au_seerev == Conf::AUSEEREV_UNLESSINCOMPLETE) {
                            $text .= "Authors who are also reviewers can’t see reviews for their papers while they still have <a href='" . hoturl("search", "t=rout&amp;q=") . "'>incomplete reviews</a> of their own. ";
                        } else {
                            $text .= "Authors can’t view paper reviews at the moment. ";
                        }
                    } else {
                        $text .= "You can’t {$action} {$thisPaper} at the moment. ";
                    }
                }
            }
        }
        $text .= "(<a class='nw' href='" . hoturl("deadlines") . "'>View deadlines</a>) ";
    }
    if (isset($whyNot["override"])) {
        $text .= "“Override deadlines” can override this restriction. ";
    }
    if (isset($whyNot['blindSubmission'])) {
        $text .= "Submission to this conference is blind. ";
    }
    if (isset($whyNot['author'])) {
        $text .= "You aren’t a contact for {$thisPaper}. ";
    }
    if (isset($whyNot['conflict'])) {
        $text .= "You have a conflict with {$thisPaper}. ";
    }
    if (isset($whyNot['externalReviewer'])) {
        $text .= "External reviewers may not view other reviews for the papers they review. ";
    }
    if (isset($whyNot['differentReviewer'])) {
        $text .= "You didn’t write this review, so you can’t change it. ";
    }
    if (isset($whyNot['reviewToken'])) {
        $text .= "If you know a valid review token, enter it above to edit that review. ";
    }
    if (isset($whyNot["clickthrough"])) {
        $text .= "You can’t do that until you agree to the current terms. ";
    }
    if (isset($whyNot["otherTwiddleTag"])) {
        $text .= "Tag “#" . htmlspecialchars($whyNot["tag"]) . "” doesn’t belong to you. ";
    }
    if (isset($whyNot["chairTag"])) {
        $text .= "Tag “#" . htmlspecialchars($whyNot["tag"]) . "” can only be set by administrators. ";
    }
    if (isset($whyNot["voteTag"])) {
        $text .= "The voting tag “#" . htmlspecialchars($whyNot["tag"]) . "” shouldn’t be changed directly. To vote for this paper, change the “#~" . htmlspecialchars($whyNot["tag"]) . "” tag. ";
    }
    if (isset($whyNot["voteTagNegative"])) {
        $text .= "Negative votes aren’t allowed. ";
    }
    // finish it off
    if (isset($whyNot["chairMode"])) {
        $text .= "(<a class='nw' href=\"" . selfHref(array("forceShow" => 1)) . "\">" . ucfirst($action) . " the paper anyway</a>) ";
    }
    if (isset($whyNot["forceShow"]) && $whyNot["forceShow"] === true) {
        $text .= "(As an administrator, you can override your conflict.) ";
    } else {
        if (isset($whyNot["forceShow"])) {
            $text .= "(<a class='nw' href=\"" . selfHref(array("forceShow" => 1)) . "\">Override conflict</a>) ";
        }
    }
    if ($text && $action == "view") {
        $text .= "Enter a paper number above, or <a href='" . hoturl("search", "q=") . "'>list the papers you can view</a>. ";
    }
    return rtrim($text);
}
Esempio n. 22
0
        $kiosk = kiosk_lookup($key);
    }
}
if ($kiosk) {
    $Me->tracker_kiosk_state = $kiosk->show_papers ? 2 : 1;
    $show_papers = $kiosk->show_papers;
}
// user
if (!$Me->isPC && !$Me->tracker_kiosk_state) {
    $Me->escape();
}
// header and script
$no_discussion = '<div><h2>No discussion<\\/h2>';
// <div> is CSS-styled
if ($Me->privChair) {
    $no_discussion .= '<p>To start a discussion, <a href=\\"' . hoturl("search") . '\\">search<\\/a> for a list, go to a paper in that list, and use the “&#9759;” button.<\\/p>';
}
$no_discussion .= '</div>';
Ht::stash_script('var buzzer_status = "open", buzzer_muted = false, showpapers = ' . json_encode($show_papers) . ', tracker_has_format;
function trackertable_paper_row(hc, idx, paper) {
    var pcconf;
    if (paper.pc_conflicts) {
        pcconf = [];
        for (var i = 0; i < paper.pc_conflicts.length; ++i)
            pcconf.push(text_to_html(paper.pc_conflicts[i].name));
        pcconf = "<em class=\\"plx\\">PC conflicts:</em> " +
            (pcconf.length ? "<span class=\\"nb\\">" + pcconf.join(",</span> <span class=\\"nb\\">") + "</span>" : "None");
    }

    hc.push("<tr class=\\"trackertable" + idx + (showpapers && pcconf ? " t" : " t b") + "\\">", "<\\/tr>");
    hc.push("<td class=\\"trackertable trackerdesc\\">", "<\\/td>");
Esempio n. 23
0
 private static function login()
 {
     global $Conf, $Now, $email_class, $password_class;
     $external_login = $Conf->external_login();
     // In all cases, we need to look up the account information
     // to determine if the user is registered
     if (!isset($_REQUEST["email"]) || ($_REQUEST["email"] = trim($_REQUEST["email"])) == "") {
         $email_class = " error";
         if ($Conf->opt("ldapLogin")) {
             return Conf::msg_error("Enter your LDAP username.");
         } else {
             return Conf::msg_error("Enter your email address.");
         }
     }
     // Check for the cookie
     if (isset($_SESSION["testsession"])) {
         /* Session cookie set */
     } else {
         if (!isset($_REQUEST["testsession"])) {
             // set a cookie to test that their browser supports cookies
             $_SESSION["testsession"] = true;
             $url = "testsession=1";
             foreach (array("email", "password", "action", "go", "signin") as $a) {
                 if (isset($_REQUEST[$a])) {
                     $url .= "&{$a}=" . urlencode($_REQUEST[$a]);
                 }
             }
             Navigation::redirect("?" . $url);
         } else {
             return Conf::msg_error("You appear to have disabled cookies in your browser, but this site needs to set cookies to function.  Google has <a href='http://www.google.com/cookies.html'>an informative article on how to enable them</a>.");
         }
     }
     // do LDAP login before validation, since we might create an account
     if ($Conf->opt("ldapLogin")) {
         $_REQUEST["action"] = "login";
         if (!self::ldap_login()) {
             return null;
         }
     }
     // look up user in our database
     if (strpos($_REQUEST["email"], "@") === false) {
         self::unquote_double_quoted_request();
     }
     $user = $Conf->user_by_whatever($_REQUEST["email"]);
     // look up or create user in contact database
     $cdb_user = null;
     if (opt("contactdb_dsn")) {
         if ($user) {
             $cdb_user = $user->contactdb_user();
         } else {
             $cdb_user = Contact::contactdb_find_by_email($_REQUEST["email"]);
         }
     }
     // create account if requested
     if ($_REQUEST["action"] == "new") {
         if (!($user = self::create_account($user, $cdb_user))) {
             return null;
         }
         $_REQUEST["password"] = $user->password_plaintext;
     }
     // auto-create account if external login
     if (!$user && $external_login) {
         $reg = Contact::safe_registration($_REQUEST);
         $reg->no_validate_email = true;
         if (!($user = Contact::create($Conf, $reg))) {
             return Conf::msg_error($Conf->db_error_html(true, "while adding your account"));
         }
         if ($Conf->setting("setupPhase", false)) {
             return self::first_user($user, $msg);
         }
     }
     // if no user found, then fail
     if (!$user && (!$cdb_user || !$cdb_user->allow_contactdb_password())) {
         $email_class = " error";
         return Conf::msg_error("No account for " . htmlspecialchars($_REQUEST["email"]) . ". Did you enter the correct email address?");
     }
     // if user disabled, then fail
     if ($user && $user->disabled) {
         return Conf::msg_error("Your account is disabled. Contact the site administrator for more information.");
     }
     // maybe reset password
     $xuser = $user ?: $cdb_user;
     if ($_REQUEST["action"] == "forgot") {
         $worked = $xuser->sendAccountInfo("forgot", true);
         if ($worked == "@resetpassword") {
             $Conf->confirmMsg("A password reset link has been emailed to " . htmlspecialchars($_REQUEST["email"]) . ". When you receive that email, follow its instructions to create a new password.");
         } else {
             if ($worked) {
                 $Conf->confirmMsg("Your password has been emailed to " . htmlspecialchars($_REQUEST["email"]) . ".  When you receive that email, return here to sign in.");
                 $Conf->log("Sent password", $xuser);
             }
         }
         return null;
     }
     // check password
     if (!$external_login) {
         if (($password = trim(req_s("password"))) === "") {
             $password_class = " error";
             return Conf::msg_error("Enter your password. If you’ve forgotten it, enter your email address and use the “I forgot my password” option.");
         }
         if (!$xuser->check_password($password)) {
             $password_class = " error";
             return Conf::msg_error("That password doesn’t match. If you’ve forgotten your password, enter your email address and use the “I forgot my password” option.");
         }
     }
     // mark activity
     $xuser->mark_login();
     // activate and redirect
     $user = $xuser->activate();
     unset($_SESSION["testsession"]);
     $_SESSION["trueuser"] = (object) array("email" => $user->email);
     $Conf->save_session("freshlogin", true);
     $Conf->save_session("password_reset", null);
     if (isset($_REQUEST["go"])) {
         $where = $_REQUEST["go"];
     } else {
         if (isset($_SESSION["login_bounce"]) && $_SESSION["login_bounce"][0] == $Conf->dsn) {
             $where = $_SESSION["login_bounce"][1];
         } else {
             $where = hoturl("index");
         }
     }
     go($where);
     exit;
 }
Esempio n. 24
0
 function hoturl($base, $args = null)
 {
     return hoturl($base, $this->hoturl_args($args));
 }
Esempio n. 25
0
 function _paperLink($row)
 {
     global $Conf;
     $pt = $this->_paper_link_page ? $this->_paper_link_page : "paper";
     $pl = "p=" . $row->paperId;
     $doreview = isset($row->reviewId) && isset($row->reviewFirstName);
     if ($doreview) {
         $rord = unparseReviewOrdinal($row);
         if ($pt == "paper" && $row->reviewSubmitted > 0) {
             $pl .= "#r" . $rord;
         } else {
             $pl .= "&amp;r=" . $rord;
             if ($row->reviewSubmitted > 0) {
                 $pl .= "&amp;m=r";
             }
         }
     } else {
         if ($pt === "review") {
             $pt = "paper";
         }
     }
     return hoturl($pt, $pl);
 }
Esempio n. 26
0
 function run(Contact $user, $qreq, $ssel)
 {
     global $Conf;
     $mt = $qreq->assignfn;
     $mpc = (string) $qreq->markpc;
     $pc = null;
     if ($mpc != "" && $mpc != "0") {
         $pc = Contact::find_by_email($mpc);
     }
     if ($mt == "auto") {
         $t = in_array($qreq->t, array("acc", "s")) ? $qreq->t : "all";
         $q = join("+", $ssel->selection());
         go(hoturl("autoassign", "pap={$q}&t={$t}&q={$q}"));
     } else {
         if ($mt == "lead" || $mt == "shepherd") {
             if ($user->assign_paper_pc($ssel->selection(), $mt, $pc)) {
                 $Conf->confirmMsg(ucfirst(pluralx($ssel->selection(), $mt)) . " set.");
             } else {
                 if ($OK) {
                     $Conf->confirmMsg("No changes.");
                 }
             }
         } else {
             if (!$pc) {
                 Conf::msg_error("“" . htmlspecialchars($mpc) . "” is not a PC member.");
             } else {
                 if ($mt == "conflict" || $mt == "unconflict") {
                     if ($mt == "conflict") {
                         Dbl::qe("insert into PaperConflict (paperId, contactId, conflictType) (select paperId, ?, ? from Paper where paperId" . $ssel->sql_predicate() . ") on duplicate key update conflictType=greatest(conflictType, values(conflictType))", $pc->contactId, CONFLICT_CHAIRMARK);
                         $user->log_activity("Mark conflicts with {$mpc}", $ssel->selection());
                     } else {
                         Dbl::qe("delete from PaperConflict where PaperConflict.conflictType<? and contactId=? and (paperId" . $ssel->sql_predicate() . ")", CONFLICT_AUTHOR, $pc->contactId);
                         $user->log_activity("Remove conflicts with {$mpc}", $ssel->selection());
                     }
                 } else {
                     if (substr($mt, 0, 6) == "assign" && ($asstype = substr($mt, 6)) && isset(ReviewForm::$revtype_names[$asstype])) {
                         Dbl::qe_raw("lock tables PaperConflict write, PaperReview write, PaperReviewRefused write, Paper write, ActionLog write, Settings write");
                         $result = Dbl::qe_raw("select Paper.paperId, reviewId, reviewType, reviewModified, conflictType from Paper left join PaperReview on (Paper.paperId=PaperReview.paperId and PaperReview.contactId=" . $pc->contactId . ") left join PaperConflict on (Paper.paperId=PaperConflict.paperId and PaperConflict.contactId=" . $pc->contactId . ") where Paper.paperId" . $ssel->sql_predicate());
                         $conflicts = array();
                         $assigned = array();
                         $nworked = 0;
                         while ($row = PaperInfo::fetch($result, $user)) {
                             if ($asstype && $row->conflictType > 0) {
                                 $conflicts[] = $row->paperId;
                             } else {
                                 if ($asstype && $row->reviewType >= REVIEW_PC && $asstype != $row->reviewType) {
                                     $assigned[] = $row->paperId;
                                 } else {
                                     $user->assign_review($row->paperId, $pc->contactId, $asstype);
                                     $nworked++;
                                 }
                             }
                         }
                         if (count($conflicts)) {
                             Conf::msg_error("Some papers were not assigned because of conflicts (" . join(", ", $conflicts) . ").  If these conflicts are in error, remove them and try to assign again.");
                         }
                         if (count($assigned)) {
                             Conf::msg_error("Some papers were not assigned because the PC member already had an assignment (" . join(", ", $assigned) . ").");
                         }
                         if ($nworked) {
                             $Conf->confirmMsg($asstype == 0 ? "Unassigned reviews." : "Assigned reviews.");
                         }
                         Dbl::qe_raw("unlock tables");
                         $Conf->update_rev_tokens_setting(false);
                     }
                 }
             }
         }
     }
 }
Esempio n. 27
0
            $roles |= Contact::ROLE_PC;
        }
    }
    if (@$_POST["sysadmin"]) {
        $roles |= Contact::ROLE_ADMIN;
    }
    $ck[] = "roles={$roles}";
    Dbl::qe_apply("update ContactInfo set " . join($ck, ",") . " where contactId=" . $User->contactId, $cv);
    redirectSelf();
}
$Conf->header("Profile", "profile");
$xsep = " <span class='barsep'>&nbsp;|&nbsp;</span> ";
echo "<div id='homeinfo'>";
echo "<h2 class='homeemail'>", Text::user_html($User), "</h2>";
if ($User->seascode_username || $User->huid) {
    echo '<h3><a href="', hoturl("index", array("u" => $Me->user_linkpart($User))), '">', htmlspecialchars($User->seascode_username ?: $User->huid), '</a>';
    if ($Me->privChair) {
        echo "&nbsp;", become_user_link($User);
    }
    echo "</h3>";
}
if ($User->dropped) {
    ContactView::echo_group("", '<strong class="err">You have dropped the course.</strong> If this is incorrect, contact us.');
}
echo Ht::form(hoturl_post("profile", array("u" => $User->email))), "<div>";
if ($User->disabled || $User->password == "") {
    echo Ht::submit("enable", "Enable user", array("value" => 1));
} else {
    echo Ht::submit("disable", "Disable user", array("value" => 1));
}
echo '<hr>';
Esempio n. 28
0
if ($User->username && $Me->isPC) {
    // links to next/prev users
    $links = user_prev_next($User, $Pset);
    if ($links[0] || $links[1]) {
        $sort = req("sort");
        echo "<div style=\"color:gray;float:right\"><h3 style=\"margin-top:0\">";
        if ($links[0]) {
            $u = $Me->user_linkpart($links[0], $User->is_anonymous);
            echo '<a href="', hoturl("pset", ["pset" => $Pset->urlkey, "u" => $u, "sort" => $sort]), '">« ', htmlspecialchars($u), '</a>';
        }
        if ($links[0] && $links[1]) {
            echo ' · ';
        }
        if ($links[1]) {
            $u = $Me->user_linkpart($links[1], $User->is_anonymous);
            echo '<a href="', hoturl("pset", ["pset" => $Pset->urlkey, "u" => $u, "sort" => $sort]), '">', htmlspecialchars($u), ' »</a>';
        }
        echo "</h3></div>";
    }
}
ContactView::echo_heading($User);
$u = $Me->user_linkpart($User);
// Per-pset
function diff_line_code($t)
{
    global $TABWIDTH;
    while (($p = strpos($t, "\t")) !== false) {
        $t = substr($t, 0, $p) . str_repeat(" ", $TABWIDTH - $p % $TABWIDTH) . substr($t, $p + 1);
    }
    return str_replace("  ", " &nbsp;", htmlspecialchars($t));
}
Esempio n. 29
0
            if (!Contact::valid_password($_POST["password"])) {
                Conf::msg_error("Invalid password.");
            } else {
                $flags = 0;
                if ($_POST["password"] === get($_POST, "autopassword")) {
                    $flags |= Contact::CHANGE_PASSWORD_PLAINTEXT;
                }
                $Acct->change_password(null, $_POST["password"], $flags);
                if (!$iscdb || !($log_acct = $Conf->user_by_email($Acct->email))) {
                    $log_acct = $Acct;
                }
                $log_acct->log_activity("Password reset via " . substr($resetcap, 0, 8) . "...");
                $Conf->confirmMsg("Your password has been changed. You may now sign in to the conference site.");
                $capmgr->delete($capdata);
                $Conf->save_session("password_reset", (object) array("time" => $Now, "email" => $Acct->email, "password" => $_POST["password"]));
                go(hoturl("index"));
            }
        }
    }
    $password_class = " error";
}
$Conf->header("Reset password", "resetpassword", null);
if (!isset($_POST["autopassword"]) || trim($_POST["autopassword"]) != $_POST["autopassword"] || strlen($_POST["autopassword"]) < 16 || !preg_match("/\\A[-0-9A-Za-z@_+=]*\\z/", $_POST["autopassword"])) {
    $_POST["autopassword"] = Contact::random_password();
}
echo "<div class='homegrp'>\nWelcome to the ", htmlspecialchars($Conf->full_name()), " submissions site.";
if (opt("conferenceSite")) {
    echo " For general information about ", htmlspecialchars($Conf->short_name), ", see <a href=\"", htmlspecialchars(opt("conferenceSite")), "\">the conference site</a>.";
}
echo "</div>\n<hr class='home' />\n<div class='homegrp' id='homereset'>\n", Ht::form(hoturl_post("resetpassword")), '<div class="f-contain">', Ht::hidden("resetcap", $resetcap), Ht::hidden("autopassword", $_POST["autopassword"]), "<p>Use this form to reset your password. You may want to use the random password we’ve chosen.</p>";
echo '<table style="margin-bottom:2em">', '<tr><td class="lcaption">Your email</td><td>', htmlspecialchars($Acct->email), '</td></tr>
Esempio n. 30
0
 function mark_create($send_email, $message_chair)
 {
     global $Me;
     if ($Me && $Me->privChair && $message_chair) {
         $this->conf->infoMsg("Created account for <a href=\"" . hoturl("profile", "u=" . urlencode($this->email)) . "\">" . Text::user_html_nolink($this) . "</a>.");
     }
     if ($send_email) {
         $this->sendAccountInfo("create", false);
     }
     if ($Me && $Me->has_email() && $Me->email !== $this->email) {
         $this->conf->log("Created account ({$Me->email})", $this);
     } else {
         $this->conf->log("Created account", $this);
     }
 }