예제 #1
0
파일: bug.php 프로젝트: phpsource/web-bugs
    foreach ($p as $name => $revisions) {
        $obsolete = $patches->getObsoletingPatches($bug_id, $name, $revisions[0][0]);
        $style = !empty($obsolete) ? ' style="background-color: yellow; text-decoration: line-through;" ' : '';
        $url_name = urlencode($name);
        $clean_name = clean($name);
        $formatted_date = format_date($revisions[0][0]);
        $submitter = spam_protect($revisions[0][1]);
        echo <<<OUTPUT
<a href="patch-display.php?bug_id={$bug_id}&amp;patch={$url_name}&amp;revision=latest" {$style}>{$clean_name}</a>
(last revision {$formatted_date}) by {$submitter})
<br>
OUTPUT;
    }
    echo "<p><a href='patch-add.php?bug_id={$bug_id}'>Add a Patch</a></p>";
    require_once "{$ROOT_DIR}/include/classes/bug_ghpulltracker.php";
    $pulltracker = new Bug_Pulltracker();
    $pulls = $pulltracker->listPulls($bug_id);
    echo "<h2>Pull Requests</h2>\n";
    require "{$ROOT_DIR}/templates/listpulls.php";
    echo "<p><a href='gh-pull-add.php?bug_id={$bug_id}'>Add a Pull Request</a></p>";
}
// Display comments
$bug_comments = bugs_get_bug_comments($bug_id);
if ($show_bug_info && is_array($bug_comments) && count($bug_comments) && $bug['status'] !== 'Spam') {
    $history_tabs = array('type_all' => 'All', 'type_comment' => 'Comments', 'type_log' => 'Changes', 'type_svn' => 'Git/SVN commits', 'type_related' => 'Related reports');
    if (!isset($_COOKIE['history_tab']) || !isset($history_tabs[$_COOKIE['history_tab']])) {
        $active_history_tab = 'type_all';
    } else {
        $active_history_tab = $_COOKIE['history_tab'];
    }
    echo '<h2 style="border-bottom:2px solid #666;margin-bottom:0;padding:5px 0;">History</h2>', "<div id='comment_filter' class='controls comments'>";
예제 #2
0
bugs_authenticate($user, $pw, $logged_in, $user_flags);
$is_trusted_developer = $user_flags & BUGS_TRUSTED_DEV;
// captcha is not necessary if the user is logged in
if (!$logged_in) {
    require_once 'Text/CAPTCHA/Numeral.php';
    $numeralCaptcha = new Text_CAPTCHA_Numeral();
}
$show_bug_info = bugs_has_access($bug_id, $buginfo, $pw, $user_flags);
if (!$show_bug_info) {
    response_header('Private report');
    display_bug_error("The bug #{$bug_id} is not available to public");
    response_footer();
    exit;
}
require_once "{$ROOT_DIR}/include/classes/bug_ghpulltracker.php";
$pullinfo = new Bug_Pulltracker();
if (isset($_POST['addpull'])) {
    $errors = array();
    if (empty($_POST['repository'])) {
        $errors[] = 'No repository selected';
    }
    if (empty($_POST['pull_id'])) {
        $errors[] = 'No Pull request selected';
    }
    if (!$logged_in) {
        try {
            $email = isset($_POST['email']) ? $_POST['email'] : '';
            if (!is_valid_email($email, $logged_in)) {
                $errors[] = 'Email address must be valid!';
            }
            /**