function echo_editable_html(PaperOptionValue $ov, $reqv, PaperTable $pt)
 {
     $reqv = $reqv === null ? $ov->value : $reqv;
     $reqv = isset($this->selector[$reqv]) ? $reqv : 0;
     $pt->echo_editable_option_papt($this);
     echo '<div class="papev">';
     if ($this->type === "selector") {
         echo Ht::select("opt{$this->id}", $this->selector, $reqv, ["onchange" => "hiliter(this)"]);
     } else {
         foreach ($this->selector as $val => $text) {
             echo Ht::radio("opt{$this->id}", $val, $val == $reqv, ["onchange" => "hiliter(this)"]), "&nbsp;", Ht::label(htmlspecialchars($text)), "<br />\n";
         }
     }
     echo "</div></div>\n\n";
 }
예제 #2
0
$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>';
echo '<table class="pltable" style="margin-top:1em"><tbody class="pltable pltable_alternate">';
echo '<tr><td class="pl pls">Roles</td><td class="pl">';
echo Ht::radio("pctype", "chair", $User->roles & Contact::ROLE_CHAIR), "&nbsp;", Ht::label("Course instructor"), "<br>";
echo Ht::radio("pctype", "pc", $User->roles & Contact::ROLE_PC && !($User->roles & Contact::ROLE_CHAIR)), "&nbsp;", Ht::label("Course staff"), "<br>";
echo Ht::radio("pctype", "no", !($User->roles & (Contact::ROLE_PC | Contact::ROLE_CHAIR))), "&nbsp;", Ht::label("Not on course staff"), "<br>";
echo "</td></tr>\n";
echo '</tbody></table>';
echo Ht::submit("update", "Save changes", array("value" => 1));
echo "</div></form>\n";
echo "<div class='clear'></div>\n";
$Conf->footer();
예제 #3
0
 public function echo_radio_table($name, $varr)
 {
     $x = $this->curv($name);
     if ($x === null || !isset($varr[$x])) {
         $x = 0;
     }
     echo "<table style=\"margin-top:0.25em\">\n";
     foreach ($varr as $k => $text) {
         echo '<tr><td class="nw">', Ht::radio($name, $k, $k == $x, $this->sjs($name, array("id" => "{$name}_{$k}"))), "&nbsp;</td><td>";
         if (is_array($text)) {
             echo $this->label($name, $text[0], true), "<br /><small>", $text[1], "</small>";
         } else {
             echo $this->label($name, $text, true);
         }
         echo "</td></tr>\n";
     }
     echo "</table>\n";
 }
예제 #4
0
파일: home.php 프로젝트: kohler/peteramati
    if ($Conf->opt("conferenceSite")) {
        echo " For general information about ", htmlspecialchars($Conf->short_name), ", see <a href=\"", htmlspecialchars($Conf->opt("conferenceSite")), "\">the conference site</a>.";
    }
    $passwordFocus = $email_class == "" && $password_class != "";
    echo "</div>\n<hr class='home' />\n<div class='homegrp' id='homeacct'>\n", Ht::form(hoturl_post("index")), "<div class='f-contain foldo fold2o' id='logingroup'>\n<input type='hidden' name='cookie' value='1' />\n<div class='f-ii'>\n  <div class='f-c", $email_class, "'><span class='fx2'>", $Conf->opt("ldapLogin") ? "Username" : "Email/username/HUID", "</span><span class='fn2'>Email</span></div>\n  <div class='f-e", $email_class, "'><input", $passwordFocus ? "" : " id='login_d'", " type='text' class='textlite' name='email' size='36' tabindex='1' ";
    if (isset($_REQUEST["email"])) {
        echo "value=\"", htmlspecialchars($_REQUEST["email"]), "\" ";
    }
    echo " /></div>\n</div>\n<div class='f-i fx'>\n  <div class='f-c", $password_class, "'>Password</div>\n  <div class='f-e'><input", $passwordFocus ? " id='login_d'" : "", " type='password' class='textlite' name='password' size='36' tabindex='1' value='' /></div>\n</div>\n";
    if ($Conf->opt("ldapLogin")) {
        echo "<input type='hidden' name='action' value='login' />\n";
    } else {
        echo "<div class='f-i'>\n  ", Ht::radio("action", "login", true, array("id" => "signin_action_login", "tabindex" => 2, "onclick" => "fold('logingroup',false);fold('logingroup',false,2);\$\$('signin').value='Sign in'")), "&nbsp;", Ht::label("<b>Sign me in</b>"), "<br />\n";
        echo Ht::radio("action", "forgot", false, array("tabindex" => 2, "onclick" => "fold('logingroup',true);fold('logingroup',false,2);\$\$('signin').value='Reset password'")), "&nbsp;", Ht::label("I forgot my password"), "<br />\n";
        if (!$Conf->opt("disableNewUsers")) {
            echo Ht::radio("action", "new", false, array("id" => "signin_action_new", "tabindex" => 2, "onclick" => "fold('logingroup',true);fold('logingroup',true,2);\$\$('signin').value='Create account'")), "&nbsp;", Ht::label("Create an account"), "<br />\n";
        }
        Ht::stash_script("jQuery('#homeacct input[name=action]:checked').click()");
        echo "\n</div>\n";
    }
    echo "<div class='f-i'>\n  <input class='b' type='submit' value='Sign in' name='signin' id='signin' tabindex='1' />\n</div>\n</div></form>\n<hr class='home' /></div>\n";
    Ht::stash_script("crpfocus(\"login\", null, 2)");
}
// Top: user info
if (!$Me->is_empty() && (!$Me->isPC || $User !== $Me)) {
    echo "<div id='homeinfo'>";
    $u = $Me->user_linkpart($User);
    if ($User !== $Me && !$User->is_anonymous && $User->contactImageId) {
        echo '<img class="bigface61" src="' . hoturl("face", array("u" => $Me->user_linkpart($User), "imageid" => $User->contactImageId)) . '" />';
    }
    echo '<h2 class="homeemail"><a class="q" href="', hoturl("index", array("u" => $u)), '">', htmlspecialchars($u), '</a>';
    $rev_opt[0] = "(Select a PC member)";
}
foreach ($pcm as $pc) {
    $rev_opt[$pc->contactId] = Text::name_html($pc) . " (" . plural(defval($rev_count, $pc->contactId, 0), "assignment") . ")";
}
echo "<table><tr><td><strong>PC member:</strong> &nbsp;</td>", "<td>", Ht::select("reviewer", $rev_opt, $reviewer, array("onchange" => "hiliter(this)")), "</td></tr>", "<tr><td colspan='2'><div class='g'></div></td></tr>\n";
// Paper selection
$q = $qreq->q == "" ? "(All)" : $qreq->q;
echo "<tr><td>Paper selection: &nbsp;</td><td>", Ht::entry_h("q", $q, array("id" => "manualassignq", "size" => 40, "placeholder" => "(All)", "title" => "Paper numbers or search terms")), " &nbsp;in &nbsp;";
if (count($tOpt) > 1) {
    echo Ht::select("t", $tOpt, $qreq->t, array("onchange" => "hiliter(this)"));
} else {
    echo join("", $tOpt);
}
echo "</td></tr>\n", "<tr><td colspan='2'><div class='g'></div>\n";
echo Ht::radio("kind", "a", $qreq->kind == "a", array("onchange" => "hiliter(this)")), "&nbsp;", Ht::label("Assign reviews and/or conflicts"), "<br />\n", Ht::radio("kind", "c", $qreq->kind == "c", array("onchange" => "hiliter(this)")), "&nbsp;", Ht::label("Assign conflicts only (and limit papers to potential conflicts)"), "</td></tr>\n";
echo "<tr><td colspan='2'><div class='aax' style='text-align:right'>", Ht::submit("Go", array("class" => "bb")), "</div></td></tr>\n", "</table>\n</div></form></div></td></tr></table>\n";
function make_match_preg($str)
{
    $a = $b = array();
    foreach (explode(" ", preg_quote($str)) as $word) {
        if ($word != "") {
            $a[] = Text::utf8_word_regex($word);
            if (!preg_match("/[€-ÿ]/", $word)) {
                $b[] = Text::word_regex($word);
            }
        }
    }
    $x = (object) array("preg_utf8" => join("|", $a));
    if (count($a) == count($b)) {
        $x->preg_raw = join("|", $b);
if (isset($_REQUEST["email"])) {
    echo "value=\"", htmlspecialchars($_REQUEST["email"]), "\" ";
}
?>
  /></td>
</tr>

<tr>
  <td class='caption'>Password</td>
  <td class='entry'><input type='password' name='password' size='50' /></td>
</tr>

<tr>
  <td class='caption'></td>
  <td class='entry'><?php 
echo Ht::radio("prefer", 0, true), "&nbsp;", Ht::label("Keep my current account (" . htmlspecialchars($Me->email) . ")"), "<br />\n", Ht::radio("prefer", 1), "&nbsp;", Ht::label("Keep the account named above and delete my current account");
?>
</td>
</tr>

<tr><td class='caption'></td><td class='entry'><?php 
echo Ht::submit("merge", "Merge accounts");
?>
</td></tr>
<tr class='last'><td class='caption'></td></tr>
</table>
</form>


<?php 
$Conf->footer();
예제 #7
0
    echo '<div class="f-ii">
  <div class="f-c', $email_class, '">', isset($Opt["ldapLogin"]) ? "Username" : "Email", '</div>
  <div class="f-e', $email_class, '">', Ht::entry("email", isset($_REQUEST["email"]) ? $_REQUEST["email"] : ($password_reset ? $password_reset->email : ""), ["size" => 36, "tabindex" => 1, "id" => "signin_email"]), '</div>
</div>
<div class="f-i fx">
  <div class="f-c', $password_class, '">Password</div>
  <div class="f-e">', Ht::password("password", "", array("size" => 36, "tabindex" => 1, "id" => "signin_password")), "</div>\n</div>\n";
    if ($password_reset) {
        $Conf->echoScript("jQuery(function(){jQuery(\"#signin_password\").val(" . json_encode($password_reset->password) . ")})");
    }
    if (isset($Opt["ldapLogin"])) {
        echo Ht::hidden("action", "login");
    } else {
        echo "<div class='f-i'>\n  ", Ht::radio("action", "login", true, array("tabindex" => 2, "id" => "signin_action_login")), "&nbsp;", Ht::label("<b>Sign me in</b>"), "<br />\n";
        echo Ht::radio("action", "forgot", false, array("tabindex" => 2)), "&nbsp;", Ht::label("I forgot my password"), "<br />\n";
        echo Ht::radio("action", "new", false, array("tabindex" => 2)), "&nbsp;", Ht::label("I’m a new user and want to create an account");
        echo "\n</div>\n";
        $Conf->footerScript("function login_type() {\n    var act = jQuery(\"#homeacct input[name=action]:checked\")[0] || jQuery(\"#signin_action_login\")[0];\n    fold(\"homeacct\", act.value != \"login\");\n    var felt = act.value != \"login\" || !jQuery(\"#signin_email\").val().length;\n    jQuery(\"#signin_\" + (felt ? \"email\" : \"password\"))[0].focus();\n    jQuery(\"#signin_signin\")[0].value = {\"login\":\"Sign in\",\"forgot\":\"Reset password\",\"new\":\"Create account\"}[act.value];\n}\njQuery(\"#homeacct input[name='action']\").on('click',login_type);jQuery(login_type)");
    }
    echo "<div class='f-i'>", Ht::submit("signin", "Sign in", array("tabindex" => 1, "id" => "signin_signin")), "</div></div></form>\n<hr class='home' /></div>\n";
    $Conf->footerScript("crpfocus(\"login\", null, 2)");
}
// Submissions
$papersub = $Conf->setting("papersub");
$homelist = $Me->privChair || $Me->isPC && $papersub || $Me->is_reviewer() && $papersub;
$home_hr = "<hr class=\"home\" />\n";
$nhome_hr = 0;
if ($homelist) {
    echo $nhome_hr ? $home_hr : "", '<div class="homegrp" id="homelist">';
    // Lists
    echo Ht::form_div(hoturl("search"), array("method" => "get")), '<h4><a class="qq" href="', hoturl("search"), '">Search</a>: &nbsp;&nbsp;</h4>';
예제 #8
0
            } else {
                $Acct->change_password($_REQUEST["upassword"], true);
                $Acct->log_activity("Reset password");
                $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" => $_REQUEST["upassword"]));
                go(hoturl("index"));
            }
        }
    }
    $password_class = " error";
}
$Conf->header("Reset Password", "resetpassword", null);
if (!isset($_REQUEST["autopassword"]) || trim($_REQUEST["autopassword"]) != $_REQUEST["autopassword"] || strlen($_REQUEST["autopassword"]) < 16 || !preg_match("/\\A[-0-9A-Za-z@_+=]*\\z/", $_REQUEST["autopassword"])) {
    $_REQUEST["autopassword"] = Contact::random_password();
}
if (!isset($_REQUEST["useauto"]) || $_REQUEST["useauto"] != "n") {
    $_REQUEST["useauto"] = "y";
}
$confname = $Opt["longName"];
if ($Opt["shortName"] && $Opt["shortName"] != $Opt["longName"]) {
    $confname .= " (" . $Opt["shortName"] . ")";
}
echo "<div class='homegrp'>\nWelcome to the ", htmlspecialchars($confname), " submissions site.";
if (isset($Opt["conferenceSite"])) {
    echo " For general information about ", htmlspecialchars($Opt["shortName"]), ", 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", $_REQUEST["resetcap"]), Ht::hidden("autopassword", $_REQUEST["autopassword"]), "<p>This form will reset the password for <b>", htmlspecialchars($Acct->email), "</b>. Use our suggested replacement password, or choose your own.</p>\n<table>\n  <tr><td>", Ht::radio("useauto", "y", null), "&nbsp;</td><td>", Ht::label("Use password <tt>" . htmlspecialchars($_REQUEST["autopassword"]) . "</tt>"), "</td></tr>\n  <tr><td>", Ht::radio("useauto", "n", null, array("id" => "usemy", "onclick" => "x=\$\$(\"login_d\");if(document.activeElement!=x)x.focus()")), "&nbsp;</td><td style='padding-top:1em'>", Ht::label("Use this password:"******"</td></tr>\n  <tr><td></td><td><div class='f-i'>\n  <div class='f-c", $password_class, "'>Password</div>\n  <div class='f-e'><input id='login_d' type='password' name='upassword' size='36' tabindex='1' value='' onkeypress='if(!((x=\$\$(\"usemy\")).checked)) x.click()' /></div>\n</div>\n<div class='f-i'>\n  <div class='f-c", $password_class, "'>Password (again)</div>\n  <div class='f-e'><input id='login_d' type='password' name='upassword2' size='36' tabindex='1' value='' /></div>\n</div></td></tr>\n<tr><td colspan='2' style='padding-top:1em'>\n<div class='f-i'>", Ht::submit("go", "Reset password", array("tabindex" => 1)), "</div></td>\n</tr></table>\n</div></form>\n<hr class='home' /></div>\n";
$Conf->footerScript("crpfocus(\"login\", null, 2)");
echo '<hr class="c" />', "\n";
$Conf->footer();
예제 #9
0
function doRadio($name, $value, $text, $extra = null)
{
    global $Qreq;
    if ($checked = !isset($Qreq[$name]) || $Qreq[$name] === $value) {
        $Qreq[$name] = $value;
    }
    $extra = $extra ? $extra : array();
    $extra["id"] = "{$name}_{$value}";
    echo Ht::radio($name, $value, $checked, $extra), "&nbsp;";
    if ($text !== "") {
        echo Ht::label($text, "{$name}_{$value}");
    }
}