示例#1
0
// 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;
}
if (!bugs_has_access($bug_id, $buginfo, $pw, $user_flags)) {
    response_header('Error :: No access to bug selected');
    display_bug_error("You have no access to bug #{$bug_id}");
    response_footer();
    exit;
}
$pseudo_pkgs = get_pseudo_packages(false);
if (isset($patch_name) && isset($revision)) {
    if ($revision == 'latest') {
        $revisions = $patchinfo->listRevisions($buginfo['id'], $patch_name);
示例#2
0
    $addon = '';
    if ($delete_comment) {
        delete_comment($bug_id, $delete_comment);
        $addon = '&thanks=1';
    }
    redirect("bug.php?id={$bug_id}&edit=1{$addon}");
}
// captcha is not necessary if the user is logged in
if (!$logged_in) {
    require_once 'Text/CAPTCHA/Numeral.php';
    $numeralCaptcha = new Text_CAPTCHA_Numeral();
}
$trytoforce = isset($_POST['trytoforce']) ? (int) $_POST['trytoforce'] : 0;
// fetch info about the bug into $bug
if (!isset($bug)) {
    $bug = bugs_get_bug($bug_id);
}
// DB error
if (is_object($bug)) {
    response_header('DB error');
    display_bug_error($bug);
    response_footer();
    exit;
}
// Bug not found with passed id
if (!$bug) {
    response_header('No Such Bug');
    display_bug_error("No such bug #{$bug_id}");
    response_footer();
    exit;
}