本文整理汇总了PHP中Conf::msg_error方法的典型用法代码示例。如果您正苦于以下问题:PHP Conf::msg_error方法的具体用法?PHP Conf::msg_error怎么用?PHP Conf::msg_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conf
的用法示例。
在下文中一共展示了Conf::msg_error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run(Contact $user, $qreq, $ssel)
{
global $Conf;
$o = cvtint($qreq->decision);
$decision_map = $Conf->decision_map();
if ($o === null || !isset($decision_map[$o])) {
return Conf::msg_error("Bad decision value.");
}
$result = Dbl::qe_raw($Conf->paperQuery($user, array("paperId" => $ssel->selection())));
$success = $fails = array();
while ($prow = PaperInfo::fetch($result, $user)) {
if ($user->can_set_decision($prow, true)) {
$success[] = $prow->paperId;
} else {
$fails[] = "#" . $prow->paperId;
}
}
if (count($fails)) {
Conf::msg_error("You cannot set paper decisions for " . pluralx($fails, "paper") . " " . commajoin($fails) . ".");
}
if (count($success)) {
Dbl::qe("update Paper set outcome={$o} where paperId ?a", $success);
$Conf->update_paperacc_setting($o > 0);
redirectSelf(array("atab" => "decide", "decision" => $o));
}
}
示例2: error_go
function error_go($url, $message)
{
if ($url === false) {
$url = hoturl("index");
}
Conf::msg_error($message);
go($url);
}
示例3: document_error
function document_error($status, $msg)
{
global $Conf;
header("HTTP/1.1 {$status}");
$Conf->header("Download", null, actionBar());
$msg && Conf::msg_error($msg);
$Conf->footer();
exit;
}
示例4: run
function run(Contact $user, $qreq, $ssel)
{
global $Conf, $Opt;
// maybe download preferences for someone else
$Rev = $user;
if (($cid = cvtint($qreq->reviewer)) > 0 && $user->privChair) {
if (!($Rev = Contact::find_by_id($cid))) {
return Conf::msg_error("No such reviewer");
}
}
if (!$Rev->isPC) {
return self::EPERM;
}
$q = $Conf->paperQuery($Rev, array("paperId" => $ssel->selection(), "topics" => 1, "reviewerPreference" => 1));
$result = Dbl::qe_raw($q);
$texts = array();
while ($prow = PaperInfo::fetch($result, $Rev)) {
$t = $prow->paperId . "," . CsvGenerator::quote($prow->title);
if ($prow->conflictType > 0) {
$t .= ",conflict";
} else {
$t .= "," . unparse_preference($prow);
}
$t .= "\n";
if ($this->extended) {
if ($Rev->can_view_authors($prow, false)) {
$t .= prefix_word_wrap("# Authors: ", $prow->pretty_text_author_list(), "# ");
}
$t .= prefix_word_wrap("# Abstract: ", rtrim($prow->abstract), "# ");
if ($prow->topicIds != "") {
$t .= prefix_word_wrap("# Topics: ", $prow->unparse_topics_text(), "# ");
}
$t .= "\n";
}
defappend($texts[$prow->paperId], $t);
}
downloadCSV(join("", $ssel->reorder($texts)), ["paper", "title", "preference"], "revprefs");
}
示例5: setReviewPreference
static function setReviewPreference($prow)
{
global $Conf, $Me, $Error, $OK;
$ajax = defval($_REQUEST, "ajax", false);
if (!$Me->allow_administer($prow) || ($contactId = cvtint(@$_REQUEST["reviewer"])) <= 0) {
$contactId = $Me->contactId;
}
if (isset($_REQUEST["revpref"]) && ($v = parse_preference($_REQUEST["revpref"]))) {
if (self::save_review_preferences(array(array($prow->paperId, $contactId, $v[0], $v[1])))) {
$Conf->confirmMsg($ajax ? "Saved" : "Review preference saved.");
} else {
$Error["revpref"] = true;
}
$v = unparse_preference($v);
} else {
$v = null;
Conf::msg_error($ajax ? "Bad preference" : "Bad preference “" . htmlspecialchars($_REQUEST["revpref"]) . "”.");
$Error["revpref"] = true;
}
if ($ajax) {
$Conf->ajaxExit(array("ok" => $OK && !@$Error["revpref"], "value" => $v));
}
}
示例6: handle_response
function handle_response()
{
global $Conf, $Me, $prow, $crow;
$rname = @trim($_REQUEST["response"]);
$rnum = $Conf->resp_round_number($rname);
if ($rnum === false && $rname) {
return Conf::msg_error("No such response round “" . htmlspecialchars($rname) . "”.");
}
$rnum = (int) $rnum;
if ($crow && @(int) $crow->commentRound !== $rnum) {
$Conf->warnMsg("Attempt to change response round ignored.");
$rnum = @+$crow->commentRound;
}
if (!($xcrow = $crow)) {
$xcrow = (object) array("commentType" => COMMENTTYPE_RESPONSE, "commentRound" => $rnum);
}
if ($whyNot = $Me->perm_respond($prow, $xcrow, true)) {
return Conf::msg_error(whyNotText($whyNot, "respond to reviews for"));
}
$text = @rtrim($_REQUEST["comment"]);
if ($text === "" && !$crow) {
return Conf::msg_error("Enter a response.");
}
save_comment($text, true, $rnum);
}
示例7: save_username
static function save_username(Contact $user, $username)
{
global $Me;
// does it contain odd characters?
$username = trim((string) $username);
if ($username === "") {
if ($Me->privChair) {
return $user->change_username("seascode", null);
}
return Conf::msg_error("Empty username.");
}
if (preg_match('_[@,;:~/\\[\\](){}\\<>&#=\\000-\\027]_', $username)) {
return Conf::msg_error("The username “" . htmlspecialchars($username) . "” contains funny characters. Remove them.");
}
// is it in use?
$x = $user->conf->fetch_value("select contactId from ContactInfo where seascode_username=?", $username);
if ($x && $x != $user->contactId) {
return Conf::msg_error("That username is already in use.");
}
// is it valid?
$htopt = array("timeout" => 5, "ignore_errors" => true);
$context = stream_context_create(array("http" => $htopt));
$userurl = self::MAINURL . "~" . htmlspecialchars($username);
$response_code = 509;
if ($stream = fopen($userurl, "r", false, $context)) {
if (($metadata = stream_get_meta_data($stream)) && ($w = get($metadata, "wrapper_data")) && is_array($w) && preg_match(',\\AHTTP/[\\d.]+\\s+(\\d+)\\s+(.+)\\z,', $w[0], $m)) {
$response_code = (int) $m[1];
}
fclose($stream);
}
if ($response_code == 404) {
return Conf::msg_error("That username doesn’t appear to exist. Check your spelling.");
} else {
if ($response_code != 200) {
return Conf::msg_error("Error contacting " . htmlspecialchars($userurl) . " (response code {$response_code}). Maybe try again?");
}
}
return $user->change_username("seascode", $username);
}
示例8: set_partner
function set_partner($pset, $partner)
{
global $ConfSitePATH;
$pset = is_object($pset) ? $pset->psetid : $pset;
// does it contain odd characters?
$partner = trim($partner);
$pc = $this->conf->user_by_whatever($partner);
if (!$pc && ($partner == "" || strcasecmp($partner, "none") == 0)) {
$pc = $this;
} else {
if (!$pc || !$pc->contactId) {
return Conf::msg_error("I can’t find someone with email/username " . htmlspecialchars($partner) . ". Check your spelling.");
}
}
foreach ($this->links(LINK_PARTNER, $pset) as $link) {
$this->conf->qe("delete from ContactLink where cid=? and type=? and pset=? and link=?", $link, LINK_BACKPARTNER, $pset, $this->contactId);
}
if ($pc->contactId == $this->contactId) {
return $this->clear_links(LINK_PARTNER, $pset);
} else {
return $this->set_link(LINK_PARTNER, $pset, $pc->contactId) && $this->conf->qe("insert into ContactLink set cid=?, type=?, pset=?, link=?", $pc->contactId, LINK_BACKPARTNER, $pset, $this->contactId);
}
}
示例9: report_errors
public function report_errors()
{
global $Conf;
if (count($this->errors_)) {
Conf::msg_error('Assignment errors: <div class="parseerr"><p>' . join("</p>\n<p>", $this->errors_html(true)) . '</p></div> Please correct these errors and try again.');
}
}
示例10: __construct
//.........这里部分代码省略.........
foreach ($Conf->decision_map() as $dnum => $dname) {
$k = "dec:{$dname}";
if ($dnum && (@$dec_pcount[$dnum] > 0 || $type == $k)) {
$by_dec[$k] = "Contact authors of " . htmlspecialchars($dname) . " papers";
}
}
if ($dec_tcount[1] > 0 || $type == "dec:yes") {
$by_dec["dec:yes"] = "Contact authors of accept-class papers";
}
if ($dec_tcount[-1] > 0 || $type == "dec:no") {
$by_dec["dec:no"] = "Contact authors of reject-class papers";
}
if ($dec_tcount[0] > 0 || $type == "dec:none") {
$by_dec["dec:none"] = "Contact authors of undecided papers";
}
if ($type == "dec:any") {
$by_dec["dec:any"] = "Contact authors of decided papers";
}
if (count($by_dec)) {
$this->sel["bydec_group"] = array("optgroup", "Contact authors by decision");
foreach ($by_dec as $k => $v) {
$this->defsel($k, $v);
}
$this->sel["bydec_group_end"] = array("optgroup");
}
$this->sel["rev_group"] = array("optgroup", "Reviewers");
$this->defsel("rev", "Reviewers");
$this->defsel("crev", "Reviewers with complete reviews");
$this->defsel("uncrev", "Reviewers with incomplete reviews");
$this->defsel("allcrev", "Reviewers with no incomplete reviews");
$this->defsel("pcrev", "PC reviewers");
$this->defsel("uncpcrev", "PC reviewers with incomplete reviews");
// new assignments query
// XXX this exposes information about PC review assignments
// for conflicted papers to the chair; not worth worrying about
$aq = "select PaperReview.paperId any_newpcrev from PaperReview";
if (!$contact->privChair) {
$aq .= " join Paper on (Paper.paperId=PaperReview.paperId and Paper.managerContactId=" . $contact->contactId . ")";
}
$aq .= "\n\twhere reviewType>=" . REVIEW_PC . " and reviewSubmitted is null and reviewNeedsSubmit!=0 and timeRequested>timeRequestNotified limit 1";
$bcq_manager = "";
if (!$contact->privChair) {
$bcq_manager = " and managerContactId=" . $contact->contactId;
}
$q = "select any_newpcrev, any_lead, any_shepherd\n\tfrom ({$aq}) a\n\tleft join (select paperId any_lead from Paper where timeSubmitted>0 and leadContactId!=0{$bcq_manager} limit 1) b on (true)\n\tleft join (select paperId any_shepherd from Paper where timeSubmitted>0 and shepherdContactId!=0{$bcq_manager} limit 1) c on (true)";
if ($row = Dbl::fetch_first_row($q)) {
list($any_newpcrev, $any_lead, $any_shepherd) = $row;
}
$this->defsel("newpcrev", "PC reviewers with new review assignments");
$this->defsel("extrev", "External reviewers");
$this->defsel("uncextrev", "External reviewers with incomplete reviews");
$this->sel["rev_group_end"] = array("optgroup");
}
$this->defsel_nm("myextrev", "Your requested reviewers");
$this->defsel_nm("uncmyextrev", "Your requested reviewers with incomplete reviews");
$this->sel["pc_group"] = array("optgroup", "Program committee");
if ($contact->is_manager()) {
if ($any_lead || $type == "lead") {
$this->defsel("lead", "Discussion leads");
}
if ($any_shepherd || $type == "shepherd") {
$this->defsel("shepherd", "Shepherds");
}
}
$this->defsel_nm("pc", "Program committee");
foreach (pcTags() as $t) {
if ($t != "pc") {
$this->defsel_nm("pc:{$t}", "PC members tagged “{$t}”");
}
}
$this->sel["pc_group_end"] = array("optgroup");
if ($contact->privChair) {
$this->defsel("all", "All users");
}
if (isset($this->sel[$type])) {
$this->type = $type;
} else {
if ($type == "myuncextrev" && isset($this->sel["uncmyextrev"])) {
$this->type = "uncmyextrev";
} else {
$this->type = key($this->sel);
}
}
$this->papersel = $papersel;
if ($this->type == "newpcrev") {
$t = @trim($newrev_since);
if (preg_match(',\\A(?:|n/a|[(]?all[)]?|0)\\z,i', $t)) {
$this->newrev_since = 0;
} else {
if (($this->newrev_since = $Conf->parse_time($t)) !== false) {
if ($this->newrev_since > $Now) {
$Conf->warnMsg("That time is in the future.");
}
} else {
Conf::msg_error("Invalid date.");
$this->error = true;
}
}
}
}
示例11: save_clickthrough
static function save_clickthrough($user)
{
global $Conf, $Now;
$confirmed = false;
if (@$_REQUEST["clickthrough_accept"] && @$_REQUEST["clickthrough_sha1"]) {
$user->merge_and_save_data(array("clickthrough" => array($_REQUEST["clickthrough_sha1"] => $Now)));
$confirmed = true;
} else {
if (@$_REQUEST["clickthrough_decline"]) {
Conf::msg_error("You can’t continue until you accept these terms.");
}
}
if (@$_REQUEST["ajax"]) {
$Conf->ajaxExit(array("ok" => $confirmed));
}
redirectSelf();
}
示例12: table_html
public function table_html($listname, $options = array())
{
global $Conf;
if (!$this->_prepare()) {
return null;
}
if (isset($options["fold"])) {
foreach ($options["fold"] as $n => $v) {
$this->viewmap->{$n} = $v;
}
}
if (isset($options["table_id"])) {
$this->viewmap->table_id = $options["table_id"];
}
// need tags for row coloring
if ($this->contact->can_view_tags(null)) {
$this->qopts["tags"] = 1;
}
$this->table_type = $listname;
// get column list, check sort
$field_list = $this->_list_columns($listname);
if (!$field_list) {
Conf::msg_error("There is no paper list query named “" . htmlspecialchars($listname) . "”.");
return null;
}
$field_list = $this->_columns($field_list, true);
$body_attr = $this->row_attr;
$rows = $this->_rows($field_list);
if ($rows === null) {
return null;
}
// return IDs if requested
if (empty($rows)) {
if ($altq = $this->search->alternate_query()) {
$altqh = htmlspecialchars($altq);
$url = $this->search->url_site_relative_raw($altq);
if (substr($url, 0, 5) == "search") {
$altqh = "<a href=\"" . htmlspecialchars(Navigation::siteurl() . $url) . "\">" . $altqh . "</a>";
}
return "No matching papers. Did you mean “{$altqh}”?";
} else {
return "No matching papers";
}
}
// get field array
$fieldDef = array();
$ncol = $titlecol = 0;
// folds: au:1, anonau:2, fullrow:3, aufull:4, force:5, rownum:6, [fields]
$next_fold = 7;
foreach ($field_list as $fdef) {
if ($fdef->view != Column::VIEW_NONE) {
$fieldDef[] = $fdef;
}
if ($fdef->view != Column::VIEW_NONE && $fdef->foldable) {
$fdef->foldable = $next_fold;
++$next_fold;
}
if ($fdef->name == "title") {
$titlecol = $ncol;
}
if ($fdef->view == Column::VIEW_COLUMN && !$fdef->is_folded) {
++$ncol;
}
}
// count non-callout columns
$skipcallout = 0;
foreach ($fieldDef as $fdef) {
if ($fdef->name != "id" && !isset($fdef->is_selector)) {
break;
} else {
++$skipcallout;
}
}
// create render state
$rstate = new PaperListRenderState($ncol, $titlecol, $skipcallout);
// collect row data
$body = array();
$lastheading = !empty($this->search->groupmap) ? -1 : -2;
$need_render = false;
foreach ($rows as $row) {
++$this->count;
if ($lastheading > -2) {
$lastheading = $this->_check_heading($this->_row_thenval($row), $rstate, $rows, $lastheading, $body);
}
$body[] = $this->_row_text($rstate, $row, $fieldDef);
if ($this->need_render && !$need_render) {
$Conf->footerScript('$(plinfo.render_needed)', 'plist_render_needed');
$need_render = true;
}
if ($this->need_render && $this->count % 16 == 15) {
$body[count($body) - 1] .= " <script>plinfo.render_needed()</script>\n";
$this->need_render = false;
}
}
if ($lastheading > -2 && $this->search->is_order_anno) {
while ($lastheading + 1 < count($this->search->groupmap)) {
$lastheading = $this->_check_heading($lastheading + 1, $rstate, $rows, $lastheading, $body);
}
}
// header cells
//.........这里部分代码省略.........
示例13: fileUploaded
function fileUploaded(&$var)
{
global $Conf;
if (!isset($var) || $var['error'] != UPLOAD_ERR_OK && !$Conf) {
return false;
}
switch ($var['error']) {
case UPLOAD_ERR_OK:
return is_uploaded_file($var['tmp_name']) || PHP_SAPI === "cli" && get($var, "tmp_name_safe");
case UPLOAD_ERR_NO_FILE:
return false;
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
Conf::msg_error("You tried to upload a file that’s too big for our system to accept. The maximum size is " . ini_get("upload_max_filesize") . "B.");
return false;
case UPLOAD_ERR_PARTIAL:
Conf::msg_error("You appear to have interrupted the upload process; I am not storing that file.");
return false;
default:
Conf::msg_error("Internal upload error " . $var['error'] . "!");
return false;
}
}
示例14: run
private function run()
{
global $Conf, $Opt, $Me, $Error, $subjectPrefix, $mailer_options;
$subject = trim(defval($_REQUEST, "subject", ""));
if (substr($subject, 0, strlen($subjectPrefix)) != $subjectPrefix) {
$subject = $subjectPrefix . $subject;
}
$emailBody = $_REQUEST["emailBody"];
$template = array("subject" => $subject, "body" => $emailBody);
$rest = array("cc" => $_REQUEST["cc"], "reply-to" => $_REQUEST["replyto"], "no_error_quit" => true);
$rest = array_merge($rest, $mailer_options);
// test whether this mail is paper-sensitive
$mailer = new HotCRPMailer($Me, null, $rest);
$prep = $mailer->make_preparation($template, $rest);
$paper_sensitive = preg_match('/%[A-Z0-9]+[(%]/', $prep->subject . $prep->body);
$q = $this->recip->query($paper_sensitive);
if (!$q) {
return Conf::msg_error("Bad recipients value");
}
$result = $Conf->qe($q);
if (!$result) {
return;
}
$recipients = defval($_REQUEST, "recipients", "");
if ($this->sending) {
$q = "recipients='" . sqlq($recipients) . "', cc='" . sqlq($_REQUEST["cc"]) . "', replyto='" . sqlq($_REQUEST["replyto"]) . "', subject='" . sqlq($_REQUEST["subject"]) . "', emailBody='" . sqlq($_REQUEST["emailBody"]) . "'";
if ($Conf->sversion >= 79) {
$q .= ", q='" . sqlq($_REQUEST["q"]) . "', t='" . sqlq($_REQUEST["t"]) . "'";
}
if ($log_result = Dbl::query_raw("insert into MailLog set {$q}")) {
$this->mailid_text = " #" . $log_result->insert_id;
}
$Me->log_activity("Sending mail{$this->mailid_text} \"{$subject}\"");
} else {
$rest["no_send"] = true;
}
$mailer = new HotCRPMailer();
$mailer->combination_type = $this->recip->combination_type($paper_sensitive);
$fake_prep = new HotCRPMailPreparation();
$fake_prep->fake = true;
$last_prep = $fake_prep;
$nrows_done = 0;
$nrows_left = edb_nrows($result);
$nwarnings = 0;
$preperrors = array();
$revinform = $recipients == "newpcrev" ? array() : null;
while ($row = PaperInfo::fetch($result, $Me)) {
++$nrows_done;
$contact = new Contact($row);
$rest["newrev_since"] = $this->recip->newrev_since;
$mailer->reset($contact, $row, $rest);
$prep = $mailer->make_preparation($template, $rest);
if ($prep->errors) {
foreach ($prep->errors as $lcfield => $hline) {
$reqfield = $lcfield == "reply-to" ? "replyto" : $lcfield;
$Error[$reqfield] = true;
$emsg = Mailer::$email_fields[$lcfield] . " destination isn’t a valid email list: <blockquote><tt>" . htmlspecialchars($hline) . "</tt></blockquote> Make sure email address are separated by commas; put names in \"quotes\" and email addresses in <angle brackets>.";
if (!isset($preperrors[$emsg])) {
Conf::msg_error($emsg);
}
$preperrors[$emsg] = true;
}
} else {
if ($this->process_prep($prep, $last_prep, $row)) {
if ((!$Me->privChair || @$Opt["chairHidePasswords"]) && !@$last_prep->sensitive) {
$srest = array_merge($rest, array("sensitivity" => "display"));
$mailer->reset($contact, $row, $srest);
$last_prep->sensitive = $mailer->make_preparation($template, $srest);
}
}
}
if ($nwarnings != $mailer->nwarnings() || $nrows_done % 5 == 0) {
$this->echo_mailinfo($nrows_done, $nrows_left);
}
if ($nwarnings != $mailer->nwarnings()) {
$this->echo_prologue();
$nwarnings = $mailer->nwarnings();
echo "<div id='foldmailwarn{$nwarnings}' class='hidden'><div class='warning'>", join("<br />", $mailer->warnings()), "</div></div>";
$Conf->echoScript("\$\$('mailwarnings').innerHTML = \$\$('foldmailwarn{$nwarnings}').innerHTML;");
}
if ($this->sending && $revinform !== null) {
$revinform[] = "(paperId={$row->paperId} and contactId={$row->contactId})";
}
}
$this->process_prep($fake_prep, $last_prep, (object) array("paperId" => -1));
$this->echo_mailinfo($nrows_done, $nrows_left);
if (!$this->started && !count($preperrors)) {
return Conf::msg_error("No users match “" . $this->recip->unparse() . "” for that search.");
} else {
if (!$this->started) {
return false;
} else {
if (!$this->sending) {
$this->echo_actions();
}
}
}
if ($revinform) {
$Conf->qe("update PaperReview set timeRequestNotified=" . time() . " where " . join(" or ", $revinform));
}
//.........这里部分代码省略.........
示例15: sendAccountInfo
function sendAccountInfo($sendtype, $sensitive)
{
global $Conf, $Opt;
assert(!$this->disabled);
$rest = array();
if ($sendtype == "create" && $this->prefer_contactdb_password()) {
$template = "@activateaccount";
} else {
if ($sendtype == "create") {
$template = "@createaccount";
} else {
if ($this->plaintext_password() && ($Opt["safePasswords"] <= 1 || $sendtype != "forgot")) {
$template = "@accountinfo";
} else {
if ($this->contactDbId && $this->prefer_contactdb_password()) {
$capmgr = $Conf->capability_manager("U");
} else {
$capmgr = $Conf->capability_manager();
}
$rest["capability"] = $capmgr->create(CAPTYPE_RESETPASSWORD, array("user" => $this, "timeExpires" => time() + 259200));
$Conf->log("Created password reset " . substr($rest["capability"], 0, 8) . "...", $this);
$template = "@resetpassword";
}
}
}
$mailer = new HotCRPMailer($this, null, $rest);
$prep = $mailer->make_preparation($template, $rest);
if ($prep->sendable || !$sensitive || get($Opt, "debugShowSensitiveEmail")) {
Mailer::send_preparation($prep);
return $template;
} else {
Conf::msg_error("Mail cannot be sent to " . htmlspecialchars($this->email) . " at this time.");
return false;
}
}