Esempio n. 1
0
function ensure_session()
{
    if (session_id() !== "") {
        return true;
    }
    if (!($sn = make_session_name(opt("sessionName")))) {
        return false;
    }
    // maybe upgrade from an old session name to this one
    if (!isset($_COOKIE[$sn]) && ($upgrade_sn = opt("sessionUpgrade")) && ($upgrade_sn = make_session_name($upgrade_sn)) && isset($_COOKIE[$upgrade_sn])) {
        session_id($_COOKIE[$upgrade_sn]);
        setcookie($upgrade_sn, "", time() - 3600, "/", opt("sessionUpgradeDomain", opt("sessionDomain", "")), opt("sessionSecure", false));
    }
    $secure = opt("sessionSecure");
    $domain = opt("sessionDomain");
    if ($secure !== null || $domain !== null) {
        $params = session_get_cookie_params();
        if ($secure !== null) {
            $params["secure"] = !!$secure;
        }
        if ($domain !== null) {
            $params["domain"] = $domain;
        }
        session_set_cookie_params($params["lifetime"], $params["path"], $params["domain"], $params["secure"]);
    }
    session_name($sn);
    session_cache_limiter("");
    if (isset($_COOKIE[$sn]) && !preg_match(';\\A[-a-zA-Z0-9,]{1,128}\\z;', $_COOKIE[$sn])) {
        error_log("unexpected session ID <" . $_COOKIE[$sn] . ">");
        unset($_COOKIE[$sn]);
    }
    session_start();
    return true;
}
Esempio n. 2
0
/**
 * Editor
 *
 * @param array $attr
 * @param array $item
 *
 * @return string
 */
function editor(array $attr, array $item) : string
{
    if (!in_array('edit', $attr['actions'])) {
        return '';
    }
    $item[$attr['id']] = $item[$attr['id']] ?? $attr['val'];
    $attr['opt'] = opt($attr);
    $attr['context'] = 'edit';
    $attr['html']['id'] = html_id($attr, $item);
    $attr['html']['name'] = html_name($attr, $item);
    $attr['html']['data-type'] = $attr['type'];
    if ($attr['required'] && !ignorable($attr, $item)) {
        $attr['html']['required'] = true;
    }
    if (!empty($attr['multiple'])) {
        $attr['html']['multiple'] = true;
    }
    if (!empty($item['_error'][$attr['id']])) {
        $attr['html']['class'] = empty($attr['html']['class']) ? 'invalid' : $attr['html']['class'] . ' invalid';
    }
    $html = '';
    $callback = fqn('editor_' . $attr['type']);
    if (is_callable($callback)) {
        $html = $callback($attr, $item);
    } else {
        // @todo
        switch ($attr['frontend']) {
            case 'select':
                $html = editor_select($attr, $item);
                break;
            case 'checkbox':
            case 'radio':
                $html = editor_opt($attr, $item);
                break;
            case 'color':
            case 'email':
            case 'url':
                $html = editor_text($attr, $item);
                break;
            case 'number':
            case 'range':
                $html = editor_int($attr, $item);
                break;
            case 'date':
            case 'time':
                $html = editor_datetime($attr, $item);
                break;
            case 'file':
                $html = editor_file($attr, $item);
                break;
            case 'textarea':
                $html = editor_textarea($attr, $item);
                break;
        }
    }
    return $html ? html_label($attr, $item) . $html . html_message($attr, $item) : '';
}
Esempio n. 3
0
function select_year($d)
{
    $content = '<option value="0">Year</option>';
    $x = date('Y');
    for ($i = date('Y'); $i > 1950; $i--) {
        //$x -= $i;
        $content .= opt($i);
    }
    return $content;
}
Esempio n. 4
0
 public function format_comparator($cmp, $other_expr = null)
 {
     if ($this->format_ && $this->format_ instanceof ReviewField && $this->format_->option_letter && !opt("smartScoreCompare") && (!$other_expr || $other_expr->format() === $this->format_)) {
         if ($cmp[0] == "<") {
             return ">" . substr($cmp, 1);
         }
         if ($cmp[0] == ">") {
             return "<" . substr($cmp, 1);
         }
     }
     return $cmp;
 }
Esempio n. 5
0
/**
 * Viewer
 *
 * @param array $attr
 * @param array $item
 *
 * @return string
 */
function viewer(array $attr, array $item) : string
{
    $attr['context'] = $attr['context'] ?? 'view';
    if (!in_array($attr['context'], $attr['actions'])) {
        return '';
    }
    $attr['opt'] = opt($attr);
    $callback = fqn('viewer_' . $attr['type']);
    if (is_callable($callback)) {
        return $callback($attr, $item);
    }
    // @todo
    if (in_array($attr['frontend'], ['checkbox', 'radio', 'select'])) {
        return viewer_opt($attr, $item);
    }
    return $item[$attr['id']] ? encode($item[$attr['id']]) : (string) $item[$attr['id']];
}
Esempio n. 6
0
 private static function load()
 {
     global $ConfSitePATH, $Opt;
     self::$messages = array();
     self::load_one("{$ConfSitePATH}/src/messages.csv");
     if ($lang = opt("lang")) {
         self::load_one("{$ConfSitePATH}/src/messages.{$lang}.csv");
     }
     self::load_one("{$ConfSitePATH}/conf/messages-local.csv");
     if ($lang) {
         self::load_one("{$ConfSitePATH}/conf/messages-local.{$lang}.csv");
     }
     if (opt("messages_include")) {
         foreach (expand_includes($Opt["messages_include"], ["lang" => $lang]) as $f) {
             self::load_one($f);
         }
     }
 }
Esempio n. 7
0
/**
 * Validator
 *
 * @param array $attr
 * @param array $item
 *
 * @return bool
 */
function validator(array $attr, array &$item) : bool
{
    if (!in_array('edit', $attr['actions'])) {
        return true;
    }
    $item[$attr['id']] = cast($attr, $item[$attr['id']] ?? null);
    if ($item[$attr['id']] === null && !empty($attr['nullable'])) {
        return true;
    }
    $attr['opt'] = opt($attr);
    $valid = true;
    $callback = fqn('validator_' . $attr['type']);
    if (is_callable($callback)) {
        $valid = $callback($attr, $item);
    } else {
        // @todo
        switch ($attr['frontend']) {
            case 'checkbox':
            case 'radio':
            case 'select':
                $valid = validator_opt($attr, $item);
                break;
            case 'password':
            case 'textarea':
                $valid = validator_text($attr, $item);
                break;
            case 'date':
            case 'time':
                $valid = validator_datetime($attr, $item);
                break;
            case 'file':
                $valid = validator_file($attr, $item);
                break;
        }
    }
    return $valid && validator_uniq($attr, $item) && validator_required($attr, $item) && validator_boundary($attr, $item);
}
Esempio n. 8
0
function createUserWithOptions($user, $options = [])
{
    $people = Model::People()->firstOrCreate($user);
    if (!empty($options)) {
        foreach ($people as $key => $option) {
            opt($people)->set($key, $option);
        }
    }
    return opt($people)->all();
}
 function execute($verbose = false)
 {
     global $Conf, $Now, $Opt;
     if (count($this->errors_) || !count($this->assigners)) {
         if ($verbose && count($this->errors_)) {
             $this->report_errors();
         } else {
             if ($verbose) {
                 $Conf->warnMsg("Nothing to assign.");
             }
         }
         return count($this->errors_) == 0;
         // true means no errors
     }
     // mark activity now to avoid DB errors later
     $this->contact->mark_activity();
     // create new contacts outside the lock
     $locks = array("ContactInfo" => "read", "Paper" => "read", "PaperConflict" => "read");
     $Conf->save_logs(true);
     foreach ($this->assigners as $assigner) {
         if ($assigner->contact && $assigner->contact->contactId < 0) {
             $assigner->contact = $this->cmap->register_contact($assigner->contact);
             $assigner->cid = $assigner->contact->contactId;
         }
         $assigner->add_locks($locks);
     }
     // execute assignments
     $tables = array();
     foreach ($locks as $t => $type) {
         $tables[] = "{$t} {$type}";
     }
     Dbl::qe("lock tables " . join(", ", $tables));
     foreach ($this->assigners as $assigner) {
         $assigner->execute($this);
     }
     Dbl::qe("unlock tables");
     $Conf->save_logs(false);
     // confirmation message
     if ($verbose) {
         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>.");
         } else {
             $Conf->confirmMsg("Assignments saved!");
         }
     }
     // clean up
     $Conf->update_rev_tokens_setting(false);
     $Conf->update_paperlead_setting();
     $pids = array();
     foreach ($this->assigners as $assigner) {
         $assigner->cleanup($this);
         if ($assigner->pid > 0 && $assigner->notify_tracker()) {
             $pids[$assigner->pid] = true;
         }
     }
     if (count($pids) && opt("trackerCometSite")) {
         MeetingTracker::contact_tracker_comet(array_keys($pids));
     }
     return true;
 }
Esempio n. 10
0
if ($Me->has_email() && (!check_post() || strcasecmp($Me->email, trim($Qreq->email)) == 0)) {
    unset($_REQUEST["signin"]);
}
if (!isset($_REQUEST["email"]) || !isset($_REQUEST["action"])) {
    unset($_REQUEST["signin"]);
}
// signout
if (isset($_REQUEST["signout"])) {
    LoginHelper::logout(true);
} else {
    if (isset($_REQUEST["signin"]) && !opt("httpAuthLogin")) {
        LoginHelper::logout(false);
    }
}
// signin
if (opt("httpAuthLogin")) {
    LoginHelper::check_http_auth();
} else {
    if (isset($_REQUEST["signin"])) {
        LoginHelper::check_login();
    } else {
        if ((isset($_REQUEST["signin"]) || isset($_REQUEST["signout"])) && isset($_REQUEST["post"])) {
            redirectSelf();
        }
    }
}
// set interesting user
$User = null;
if (isset($_REQUEST["u"]) && !($User = ContactView::prepare_user($_REQUEST["u"]))) {
    redirectSelf(array("u" => null));
}
Esempio n. 11
0
 private static function check_password_encryption($hash, $iscdb)
 {
     $safe = opt($iscdb ? "contactdb_safePasswords" : "safePasswords");
     if ($safe < 1 || ($method = self::password_hash_method()) === false || $hash !== "" && $safe == 1 && $hash[0] !== " ") {
         return false;
     } else {
         if ($hash === "" || $hash[0] !== " ") {
             return true;
         } else {
             if (is_int($method)) {
                 return $hash[1] !== "\$" || password_needs_rehash(substr($hash, 2), $method);
             } else {
                 $prefix = " " . $method . " " . self::preferred_password_keyid($iscdb) . " ";
                 return !str_starts_with($hash, $prefix);
             }
         }
     }
 }
Esempio n. 12
0
function buildln($num, $commands)
{
    // build the text area and dropdown line
    $cnum = "num" . $num;
    $ccommand = "command" . $num;
    $ctimes = "times" . $num;
    $nvalue = "";
    $nvalue2 = "";
    $tvalue = 1;
    $ovalue = "ability";
    if (isset($_POST['build'])) {
        //loads the string with the previous option
        $nvalue = trim($_POST[$cnum]);
        $nvalue2 = trim($_POST["2" . $cnum]);
        if (is_numeric(trim($_POST[$ctimes]))) {
            $tvalue = trim($_POST[$ctimes]);
        }
        $ovalue = $_POST["command" . $num];
    }
    echo "<tr><td><select name='" . $ccommand . "'  id='ip'>";
    //dropdown begin
    opt($commands, $ovalue);
    echo "</select></td>";
    //drop down ends
    echo "<td><center><input id='ip' type=text name='" . $cnum . "' value='" . $nvalue . "' size=3><input  id='ip' type=text name='2" . $cnum . "' value='" . $nvalue2 . "' size=3></center></td>";
    //value boxs 1&2
    echo "<td><input  id='ip' type=text name='" . $ctimes . "' value='" . $tvalue . "' size=3></td></tr>";
    //times box
}
Esempio n. 13
0
 public static function password_storage_cleartext()
 {
     return opt("safePasswords") < 1;
 }
 public function stash_hotcrp_pc(Contact $user)
 {
     if (!Ht::mark_stash("hotcrp_pc")) {
         return;
     }
     $sortbylast = opt("sortByLastName");
     $hpcj = $list = [];
     foreach (pcMembers() as $pcm) {
         $hpcj[$pcm->contactId] = $j = (object) ["name" => $user->name_html_for($pcm), "email" => $pcm->email];
         if ($color_classes = $user->reviewer_color_classes_for($pcm)) {
             $j->color_classes = $color_classes;
         }
         if ($sortbylast && $pcm->lastName) {
             $r = Text::analyze_name($pcm);
             if (strlen($r->lastName) !== strlen($r->name)) {
                 $j->lastpos = strlen(htmlspecialchars($r->firstName)) + 1;
             }
             if ($r->nameAmbiguous && $r->name && $r->email) {
                 $j->emailpos = strlen(htmlspecialchars($r->name)) + 1;
             }
         }
         $list[] = $pcm->contactId;
     }
     $hpcj["__order__"] = $list;
     if ($sortbylast) {
         $hpcj["__sort__"] = "last";
     }
     Ht::stash_script("hotcrp_pc=" . json_encode($hpcj) . ";");
 }
Esempio n. 15
0
function update_paper($pj, $opj, $qreq, $action, $diffs)
{
    global $Conf, $Me, $Opt, $OK, $Error, $prow;
    // XXX lock tables
    $ps = new PaperStatus($Me);
    $saved = $ps->save_paper_json($pj);
    if (!$saved && !$prow && count($qreq->_FILES)) {
        $ps->set_error_html("paper", "<strong>Your uploaded files were ignored.</strong>");
    }
    if (!get($pj, "collaborators") && $Conf->setting("sub_collab")) {
        $field = $Conf->setting("sub_pcconf") ? "Other conflicts" : "Potential conflicts";
        $ps->set_warning_html("collaborators", "Please enter the authors’ potential conflicts in the {$field} field. If none of the authors have potential conflicts, just enter “None”.");
    }
    $Error = $ps->error_fields();
    if (!$saved) {
        $emsg = $ps->error_html();
        Conf::msg_error("There were errors in saving your paper. Please fix them and try again." . (count($emsg) ? "<ul><li>" . join("</li><li>", $emsg) . "</li></ul>" : ""));
        return false;
    }
    // note differences in contacts
    $contacts = $ocontacts = [];
    foreach (get($pj, "contacts", []) as $v) {
        $contacts[] = strtolower(is_string($v) ? $v : $v->email);
    }
    if ($opj && get($opj, "contacts")) {
        foreach ($opj->contacts as $v) {
            $ocontacts[] = strtolower($v->email);
        }
    }
    sort($contacts);
    sort($ocontacts);
    if (json_encode($contacts) !== json_encode($ocontacts)) {
        $diffs["contacts"] = true;
    }
    // submit paper if no error so far
    $_REQUEST["paperId"] = $_GET["paperId"] = $qreq->paperId = $pj->pid;
    loadRows();
    if ($action === "final") {
        $submitkey = "timeFinalSubmitted";
        $storekey = "finalPaperStorageId";
    } else {
        $submitkey = "timeSubmitted";
        $storekey = "paperStorageId";
    }
    $wasSubmitted = $opj && get($opj, "submitted");
    if (get($pj, "submitted") || $Conf->can_pc_see_all_submissions()) {
        $Conf->update_papersub_setting(true);
    }
    if ($wasSubmitted != get($pj, "submitted")) {
        $diffs["submission"] = 1;
    }
    // confirmation message
    if ($action == "final") {
        $actiontext = "Updated final version of";
        $template = "@submitfinalpaper";
    } else {
        if (get($pj, "submitted") && !$wasSubmitted) {
            $actiontext = "Submitted";
            $template = "@submitpaper";
        } else {
            if (!$opj) {
                $actiontext = "Registered new";
                $template = "@registerpaper";
            } else {
                $actiontext = "Updated";
                $template = "@updatepaper";
            }
        }
    }
    // additional information
    $notes = array();
    if ($action == "final") {
        if ($prow->{$submitkey} === null || $prow->{$submitkey} <= 0) {
            $notes[] = "The final version has not yet been submitted.";
        }
        $deadline = $Conf->printableTimeSetting("final_soft", "span");
        if ($deadline != "N/A" && $Conf->deadlinesAfter("final_soft")) {
            $notes[] = "<strong>The deadline for submitting final versions was {$deadline}.</strong>";
        } else {
            if ($deadline != "N/A") {
                $notes[] = "You have until {$deadline} to make further changes.";
            }
        }
    } else {
        if (get($pj, "submitted")) {
            $notes[] = "You will receive email when reviews are available.";
        } else {
            if ($prow->size == 0 && !opt("noPapers")) {
                $notes[] = "The submission has not yet been uploaded.";
            } else {
                if ($Conf->setting("sub_freeze") > 0) {
                    $notes[] = "The submission has not yet been completed.";
                } else {
                    $notes[] = "The submission is marked as not ready for review.";
                }
            }
        }
        $deadline = $Conf->printableTimeSetting("sub_update", "span");
        if ($deadline != "N/A" && ($prow->timeSubmitted <= 0 || $Conf->setting("sub_freeze") <= 0)) {
            $notes[] = "Further updates are allowed until {$deadline}.";
        }
        $deadline = $Conf->printableTimeSetting("sub_sub", "span");
        if ($deadline != "N/A" && $prow->timeSubmitted <= 0) {
            $notes[] = "<strong>If the submission " . ($Conf->setting("sub_freeze") > 0 ? "is not completed" : "is not ready for review") . " by {$deadline}, it will not be considered.</strong>";
        }
    }
    $notes = join(" ", $notes);
    $webnotes = "";
    if (count($ps->error_html())) {
        $webnotes .= " <ul><li>" . join("</li><li>", $ps->error_html()) . "</li></ul>";
    }
    if (!count($diffs)) {
        $Conf->warnMsg("There were no changes to submission #{$prow->paperId}. " . $notes . $webnotes);
        return true;
    }
    // HTML confirmation
    if ($prow->{$submitkey} > 0) {
        $Conf->confirmMsg($actiontext . " submission #{$prow->paperId}. " . $notes . $webnotes);
    } else {
        $Conf->warnMsg($actiontext . " submission #{$prow->paperId}. " . $notes . $webnotes);
    }
    // mail confirmation to all contact authors
    if (!$Me->privChair || $qreq->doemail > 0) {
        $options = array("infoNames" => 1);
        if ($Me->privChair && $prow->conflictType < CONFLICT_AUTHOR) {
            $options["adminupdate"] = true;
        }
        if ($Me->privChair && isset($qreq->emailNote)) {
            $options["reason"] = $qreq->emailNote;
        }
        if ($notes !== "") {
            $options["notes"] = preg_replace(",</?(?:span.*?|strong)>,", "", $notes) . "\n\n";
        }
        HotCRPMailer::send_contacts($template, $prow, $options);
    }
    // other mail confirmations
    if ($action == "final" && $OK && !count($Error)) {
        $prow->notify(WATCHTYPE_FINAL_SUBMIT, "final_submit_watch_callback", $Me);
    }
    $Me->log_activity($actiontext, $prow->paperId);
    return true;
}
Esempio n. 16
0
    echo '@ColorFirst : ' . "#" . opt('colorFirst', '') . ";\n";
    $ColorFirst = '@ColorFirst';
    echo '@ColorSecond : ' . "#" . opt('colorSecond', '') . ";\n";
    $ColorSecond = '@ColorSecond';
    echo '@LineColor : ' . "#" . opt('colorLine', '') . ";\n";
    $LineColor = '@LineColor';
    echo '@TextColor : ' . "#" . opt('colorText', '') . ";\n";
    $TextColor = '@TextColor';
    echo '@BackgroundColor : ' . "#" . opt('colorBackground', '') . ";\n";
    $BackgroundColor = '@BackgroundColor';
    echo '@PasifButtonBg : ' . "#" . opt('colorPasifButtonBg', '') . ";\n";
    $PasifButtonBg = '@PasifButtonBg';
    echo '@ThemePrefix : "' . opt('theme_style', '') . "\";\n";
    $ThemePrefix = '@{ThemePrefix}';
    $NormalFont = "'" . opt('contentFont', '') . "', sans-serif";
    $HeaderFont = "'" . opt('headerFont', '') . "', sans-serif";
}
?>
/*
Theme Name: RightNow
Theme URI: http://www.renklibeyaz.com/rightnowwp/
Description: RightNow HTML
Author: RenkliBeyaz - Salih Ozovali
Version: 1.0
*/

/* REF: Please Dont Change this styles */
#REF_ColorFirst{color:<?php 
echo $ColorFirst;
?>
; display:none; }
Esempio n. 17
0
 private static function create_account($user, $cdb_user)
 {
     global $Conf, $email_class;
     // check for errors
     if ($user && $user->has_database_account() && $user->activity_at > 0) {
         $email_class = " error";
         return Conf::msg_error("An account already exists for " . htmlspecialchars($_REQUEST["email"]) . ". To retrieve your password, select “I forgot my password.”");
     } else {
         if ($cdb_user && $cdb_user->allow_contactdb_password() && $cdb_user->activity_at > 0) {
             $desc = opt("contactdb_description") ?: "HotCRP";
             $email_class = " error";
             return Conf::msg_error("An account already exists for " . htmlspecialchars($_REQUEST["email"]) . " on {$desc}. Sign in using your {$desc} password or select “I forgot my password.”");
         } else {
             if (!validate_email($_REQUEST["email"])) {
                 $email_class = " error";
                 return Conf::msg_error("“" . htmlspecialchars($_REQUEST["email"]) . "” is not a valid email address.");
             }
         }
     }
     // create database account
     if (!$user || !$user->has_database_account()) {
         if (!($user = Contact::create($Conf, Contact::safe_registration($_REQUEST)))) {
             return Conf::msg_error($Conf->db_error_html(true, "while adding your account"));
         }
     }
     $user->sendAccountInfo("create", true);
     $msg = "Successfully created an account for " . htmlspecialchars($_REQUEST["email"]) . ".";
     // handle setup phase
     if ($Conf->setting("setupPhase", false)) {
         return self::first_user($user, $msg);
     }
     if (Mailer::allow_send($user->email)) {
         $msg .= " A password has been emailed to you.  Return here when you receive it to complete the registration process.  If you don’t receive the email, check your spam folders and verify that you entered the correct address.";
     } else {
         if (opt("sendEmail")) {
             $msg .= " The email address you provided seems invalid.";
         } else {
             $msg .= " The conference system is not set up to mail passwords at this time.";
         }
         $msg .= " Although an account was created for you, you need help to retrieve your password. Contact " . Text::user_html($Conf->site_contact()) . ".";
     }
     if (isset($_REQUEST["password"]) && trim($_REQUEST["password"]) != "") {
         $msg .= " Note that the password you supplied on the login screen was ignored.";
     }
     $Conf->confirmMsg($msg);
     return null;
 }
Esempio n. 18
0
function hotcrp_random_password($length = 14)
{
    $bytes = random_bytes($length + 10);
    if ($bytes === false) {
        $bytes = "";
        while (strlen($bytes) < $length) {
            $bytes .= sha1(opt("conferenceKey") . pack("V", mt_rand()));
        }
    }
    $l = "a e i o u y a e i o u y a e i o u y a e i o u y a e i o u y b c d g h j k l m n p r s t u v w trcrbrfrthdrchphwrstspswprslcl2 3 4 5 6 7 8 9 - @ _ + = ";
    $pw = "";
    $nvow = 0;
    for ($i = 0; $i < strlen($bytes) && strlen($pw) < $length + max(0, ($nvow - 3) / 3); ++$i) {
        $x = ord($bytes[$i]) % (strlen($l) / 2);
        if ($x < 30) {
            ++$nvow;
        }
        $pw .= rtrim(substr($l, 2 * $x, 2));
    }
    return $pw;
}
Esempio n. 19
0
					</td>
				</tr>
				<tr>
					<td>字体颜色<br/><br/>自定义设定字体颜色<br/>可以防止默认字体在某些背景下看不清的问题<br/>留空则为恢复默认<br/><br/>请填写颜色值(包括#):<a href="http://rgb.phpddt.com/" title="获取颜色值" target="_blank">获取颜色值</a><br/>或者填写css支持的英文颜色单词<br/>例如:<a href="http://rgb.phpddt.com/#english_color" title="获取英文颜色单词" target="_blank">red</a></td>
					<td>
						普通字体颜色:<input name="c_putong" type="text" class="form-control" <?php 
opt('input', 'c_putong');
?>
><br/>
						左侧菜单栏字体颜色<input name="c_zuoce" type="text" class="form-control" <?php 
opt('input', 'c_zuoce');
?>
><br/>
						顶部导航栏字体颜色<input name="c_dingbu" type="text" class="form-control" <?php 
opt('input', 'c_dingbu');
?>
><br/>
						输入框字体颜色<input name="c_shurukuang" type="text" class="form-control" <?php 
opt('input', 'c_shurukuang');
?>
>
					</td>
				</tr>
			</tbody>
		</table>
		<input type="submit" class="btn btn-primary" value="提交更改">
	</form>
</div>

<?php 
loadfoot();
 public function load_content($doc)
 {
     global $Conf;
     $ok = false;
     $result = null;
     if (!opt("dbNoPapers") && get_i($doc, "paperStorageId") > 1) {
         $result = Dbl::q("select paper, compression from PaperStorage where paperStorageId=" . $doc->paperStorageId);
     }
     if (!$result || !($row = edb_row($result)) || $row[0] === null) {
         $doc->content = "";
     } else {
         if ($row[1] == 1) {
             $doc->content = gzinflate($row[0]);
             $ok = true;
         } else {
             $doc->content = $row[0];
             $ok = true;
         }
     }
     if (!$ok && ($s3 = self::s3_document()) && ($filename = self::s3_filename($doc))) {
         $filename = self::s3_filename($doc);
         $content = $s3->load($filename);
         if ($content !== "" && $content !== null) {
             $doc->content = $content;
             $ok = true;
         } else {
             if ($s3->status != 200) {
                 error_log("S3 error: GET {$filename}: {$s3->status} {$s3->status_text} " . json_encode($s3->response_headers));
             }
         }
     }
     if (!$ok) {
         $num = get($doc, "paperId") ? " #{$doc->paperId}" : "";
         $doc->error = true;
         if ($this->dtype == DTYPE_SUBMISSION) {
             $doc->error_text = "Paper{$num} has not been uploaded.";
         } else {
             if ($this->dtype == DTYPE_FINAL) {
                 $doc->error_text = "Paper{$num}’s final copy has not been uploaded.";
             }
         }
     }
     $doc->size = strlen($doc->content);
     $this->store_filestore($doc, true);
     // silently does nothing if error || !filestore
     return $ok;
 }
Esempio n. 21
0
		<!-- END: Audio List -->
	</div>
	<div id="playListCloseIcon"><?php 
_e('CLOSE', 'rb');
?>
</div>
</div>
<!-- END: Music Player -->

<!-- BEGIN: First Loading; Please don't remove this element -->
<div id="bodyLoading">
	<div id="loading">
		<!-- You can change loading logo  -->
		
		<?php 
$llogoURL = opt('loading_logo_url', '');
if (strpos($llogoURL, 'http') === false) {
    $llogoURL = $tmpurl . '/' . $llogoURL;
}
?>
		<img src="<?php 
echo $llogoURL;
?>
" title="<?php 
bloginfo('name');
?>
" border="0"/>
	</div>
</div>
<!-- END: First Loading -->
Esempio n. 22
0
function eopt($v, $def)
{
    echo opt($v, $def);
}
Esempio n. 23
0
                $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>
<tr><td class="lcaption">Suggested password</td><td>', htmlspecialchars($_POST["autopassword"]), '</td></tr></table>';
echo '<div class="f-i">
  <div class="f-c', $password_class, '">New password</div>
  <div class="f-e">', Ht::password("password", "", array("id" => "login_d", "tabindex" => 1, "size" => 36)), '</div>
</div>
<div class="f-i">
  <div class="f-c', $password_class, '">New password (again)</div>
  <div class="f-e">', Ht::password("password2", "", array("tabindex" => 1, "size" => 36)), '</div>
</div>
<div class="f-i" style="margin-top:2em">', Ht::submit("go", "Reset password", array("tabindex" => 1)), "</div>\n</div></form>\n<hr class='home' /></div>\n";
Ht::stash_script("crpfocus(\"login\", null, 2)");
echo '<hr class="c" />', "\n";
Esempio n. 24
0
function sh_box($attr, $content = null)
{
    $style = 'padding:20px; margin:10px 0; ';
    $style_in = '';
    if (!empty($attr['width'])) {
        $style .= 'width:' . $attr['width'] . '; ';
    } else {
        $style .= '';
    }
    if (!empty($attr['height'])) {
        $style .= 'height:' . $attr['height'] . '; ';
    } else {
        $style .= '';
    }
    if (!empty($attr['align'])) {
        if ($attr['align'] == 'center') {
            $style .= 'margin:0 auto 0 auto; ';
        } elseif ($attr['align'] == 'right') {
            $style .= 'margin:10px 0 10px auto; ';
        }
    }
    if (!empty($attr['textcolor'])) {
        $style_in .= 'color:' . $attr['textcolor'] . '; ';
    } else {
        $style_in .= 'color:#' . opt('colorFont', "") . '; ';
    }
    if (empty($attr['border'])) {
        if (!empty($attr['bordercolor'])) {
            $style .= 'border:1px solid ' . $attr['bordercolor'] . '; ';
        }
    } else {
        // advanced usage
        $style .= $attr['border'] . '; ';
    }
    if (empty($attr['background'])) {
        if (!empty($attr['bgcolor'])) {
            $style .= 'background-color:' . $attr['bgcolor'] . '; ';
        }
    } else {
        // advanced usage
        $style .= 'background:' . $attr['background'] . '; ';
    }
    $boxinsideClass = 'boxinside';
    if (!empty($attr['icon'])) {
        $style_in .= 'padding-left:70px; ';
        $style_in .= 'background:url(\'' . get_template_directory_uri() . '/icons/' . $attr['icon'] . '.png\') no-repeat left top; ';
    } else {
        $boxinsideClass = 'boxinsideNoicon';
    }
    $cornerData = '';
    $cornerClass = '';
    if (!empty($attr['corner'])) {
        $cornerData = 'data-corner="' . $attr['corner'] . '"';
        $cornerClass = ' corner ';
    }
    return '<div ' . $cornerData . ' class="box ' . $cornerClass . ' " style="' . $style . '"><div class="' . $boxinsideClass . '" style="' . $style_in . '">' . do_shortcode($content) . '<div class="clearfix"></div></div></div>';
}