Пример #1
0
<?php

session_start();
// Obtain common includes
require_once '../include/prepend.php';
if (!isset($_GET['bug_id']) && !isset($_GET['bug'])) {
    response_header('Error :: no bug selected');
    display_bug_error('No patch selected to view');
    response_footer();
    exit;
}
// Authenticate
bugs_authenticate($user, $pw, $logged_in, $user_flags);
$is_trusted_developer = $user_flags & BUGS_TRUSTED_DEV;
$canpatch = $logged_in == 'developer';
$revision = isset($_GET['revision']) ? $_GET['revision'] : null;
$patch_name = isset($_GET['patch']) ? $_GET['patch'] : null;
if ($patch_name) {
    $patch_name_url = urlencode($patch_name);
}
$bug_id = !empty($_GET['bug']) ? (int) $_GET['bug'] : 0;
if (empty($bug_id)) {
    $bug_id = (int) $_GET['bug_id'];
}
require "{$ROOT_DIR}/include/classes/bug_patchtracker.php";
$patchinfo = new Bug_Patchtracker();
if (!($buginfo = bugs_get_bug($bug_id))) {
    response_header('Error :: invalid bug selected');
    display_bug_error("Invalid bug #{$bug_id} selected");
    response_footer();
    exit;
Пример #2
0
<?php

session_start();
require_once '../include/prepend.php';
if (!empty($_SESSION['user'])) {
    header('location: index.php');
    exit;
}
response_header('Login');
if (isset($_POST['user'])) {
    $referer = $_POST['referer'];
    bugs_authenticate(&$user, &$pwd, &$logged_in, &$user_flags);
    if ($logged_in === 'developer') {
        if (!empty($_POST['referer']) && preg_match("/^{$site_method}:\\/\\/" . preg_quote($site_url) . '/i', $referer)) {
            header('location: ' . $referer);
            exit;
        }
        header('location: index.php');
        exit;
    } else {
        ?>
    <div style="background: #AB1616; padding: 3px; width: 300px; color: #FFF; margin: 3px;">Wrong username or password!</div>
<?php 
    }
} else {
    $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
}
?>

<form method="post" action="login.php">
<input type="hidden" name="referer" value="<?php