function authenticate() { global $db, $authRealm, $style; $rmt = $authRealm != false; $extAuth = externalAuth(); if (!$rmt || $extAuth === false) { // built-in authentication attempt if (empty($_REQUEST['u']) || !isset($_POST['p'])) { // simple logout return false; } $authData = array("user" => $_REQUEST['u'], "pass" => $_POST['p'], "email" => false); } else { // external authentication if (isset($_REQUEST['u']) && empty($_REQUEST['u'])) { // remote logout header('HTTP/1.0 401 Unauthorized'); header('WWW-Authenticate: Basic realm="' . $authRealm . '"'); includeTemplate("{$style}/include/rmtlogout.php"); return null; } $authData = $extAuth; } // verify if we have administration rights $DATA = userLogin($authData["user"], $authData["pass"], $rmt, $authData["email"]); // check if the external authenticator provides an email address if ($DATA !== false && empty($DATA["email"])) { $DATA['email'] = $authData["email"]; } return $DATA; }
function pageFooter($vars = array()) { global $act, $pages, $style, $entry, $auth, $adminPath, $helpPath; echo '<div id="footer">'; $first = true; foreach ($pages as $page => $title) { if ($entry[$page]['admin'] && !$auth['admin']) { continue; } if ($first) { $first = false; } else { echo ", "; } $title = htmlEntUTF8($title); if ($page == $act) { echo "<span>{$title}</span>"; } else { echo "<a href=\"" . pageLink($page) . "\">{$title}</a>"; } } echo ", <a href=\"{$adminPath}?u\">" . T_("Logout") . "</a>" . ", <a href=\"{$helpPath}\" target=\"_blank\">" . T_("Help") . "</a></div>"; includeTemplate("{$style}/include/footer.php", $vars); }
function menuSystem($body,$bodyclass="body") { global $menu; $title=includeTemplate("views/title.thtml"); $menu=showMenu2($menu); return div($title,"title").div($menu,"menu").div($body,$bodyclass).includeTemplate("views/bottom.thtml"); }
function view() { return menuSystem(includeTemplate("features/view.thtml")); }
<?php includeTemplate("{$style}/include/header.php", array('title' => $id === false ? T_("Invalid grant") : T_("Unknown grant"))); ?> <label class="description"> <?php if ($id === false) { printf(T_("Sorry, the grant is invalid.")); } else { printf(T_("Sorry, the grant %s does not exist or is expired."), "<span class=\"ticketid\">{$id}</span>"); } ?> </label> <?php includeTemplate("{$style}/include/footer.php");
function view() { return menuSystem(includeTemplate("contact/view.thtml")); }
<div class="tabsPageHeader"> <div class="tabsPageHeaderContent"><!-- 显示左右控制时添加 class="tabsPageHeaderMargin" --> <ul class="navTab-tab"> <li tabid="main" class="main"><a href="javascript:;"><span><span class="home_icon">我的主页</span></span></a></li> </ul> </div> <div class="tabsLeft">left</div><!-- 禁用只需要添加一个样式 class="tabsLeft tabsLeftDisabled" --> <div class="tabsRight">right</div><!-- 禁用只需要添加一个样式 class="tabsRight tabsRightDisabled" --> <div class="tabsMore">more</div> </div> <ul class="tabsMoreList"> <li><a href="javascript:;">我的主页</a></li> </ul> <div class="navTab-panel tabsPageContent layoutBox"> <div class="page unitBox"> <div class="accountInfo"> <p><span><?php echo $title; ?> </span></p> </div> <div class="pageFormContent" layoutH="80" style="margin-right:230px"> </div> </div> </div> </div> </div> <?php includeTemplate("common/foot.php");
?> <?php if (array_key_exists('valid', $form) && $form['valid'] === false) { ?> <div class="errors"> <?php renderFormErrors($form['fields']['email']); ?> <?php renderFormErrors($form['fields']['password']); ?> <?php renderFormErrors($form['fields']['_token']); ?> </div> <?php } ?> <?php includeTemplate('footer.php', $container); ?> </div> <?php endBlock($container); ?> <?php extendTemplate('base.html.php', $container);
return failUpload($tmpFile); } // fetch defaults $sql = "SELECT * FROM ticket WHERE id = " . $db->quote($id); $DATA = $db->query($sql)->fetch(); if (!empty($GRANT['pass'])) { $DATA['pass'] = $GRANT['pass']; } // trigger use hooks onGrantUse($GRANT, $DATA); return $DATA; } // handle the request $DATA = false; if (isset($_FILES["file"]) && is_uploaded_file($_FILES["file"]["tmp_name"]) && $_FILES["file"]["error"] == UPLOAD_ERR_OK) { if (!empty($_SESSION['g'][$id]['pass'])) { $GRANT['pass'] = $_SESSION['g'][$id]['pass']; } $DATA = handleUpload($GRANT, $_FILES["file"]); } // resulting page if ($DATA === false) { include "grants.php"; } else { unset($ref); includeTemplate("{$style}/include/grantr.php"); // kill the session ASAP if ($auth === false) { session_destroy(); } }
function view() { return menuSystem(includeTemplate("download/view.thtml")); }
function getNews($toponly=false) { return includeTemplate("news/view.thtml",array("output"=>getCurrentNews($toponly))); }
<?php // process a ticket require_once "ticketfuncs.php"; // try to fetch the ticket $id = $_REQUEST["t"]; if (!isTicketId($id)) { $id = false; $DATA = false; } else { $sql = "SELECT * FROM ticket WHERE id = " . $db->quote($id); $DATA = $db->query($sql)->fetch(); } $ref = "{$masterPath}?t={$id}"; if ($DATA === false || isTicketExpired($DATA)) { includeTemplate("{$style}/include/noticket.php", array('id' => $id)); exit; } // check for password if (hasPassHash($DATA) && !isset($_SESSION['t'][$id])) { if (!empty($_POST['p']) && checkPassHash('ticket', $DATA, $_POST['p'])) { // authorize the ticket for this session $_SESSION['t'][$id] = array('pass' => $_POST["p"]); } else { include "ticketp.php"; exit; } } // fix IE total crap by moving to a new location containing the resulting file // name in the URL (this could be improved for browsers known to work by // starting to send the file immediately)
function view() { return menuSystem(includeTemplate("screenshots/view.thtml"),"screenshotBody"); }