Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
Archivo: pages.php Proyecto: dg-wfk/dl
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);
}
Ejemplo n.º 3
0
	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");
	}
Ejemplo n.º 4
0
function view()
{
	return menuSystem(includeTemplate("features/view.thtml"));
}
Ejemplo n.º 5
0
<?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");
Ejemplo n.º 6
0
function view()
{
	return menuSystem(includeTemplate("contact/view.thtml"));
}
Ejemplo n.º 7
0
		<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");
Ejemplo n.º 8
0
?>

        <?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);
Ejemplo n.º 9
0
Archivo: grant.php Proyecto: dg-wfk/dl
        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();
    }
}
Ejemplo n.º 10
0
function view()
{
	return menuSystem(includeTemplate("download/view.thtml"));
}
Ejemplo n.º 11
0
function getNews($toponly=false)
{
	return includeTemplate("news/view.thtml",array("output"=>getCurrentNews($toponly)));
}
Ejemplo n.º 12
0
Archivo: ticket.php Proyecto: dg-wfk/dl
<?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)
Ejemplo n.º 13
0
function view()
{
	return menuSystem(includeTemplate("screenshots/view.thtml"),"screenshotBody");
}