示例#1
0
function output_note($com_id, $ts, $email, $comment, $comment_type, $comment_name, $is_hidden = false)
{
    global $edit, $bug_id, $dbh, $is_trusted_developer, $logged_in;
    $display = !$is_hidden ? '' : 'style="display:none;"';
    echo "<div class='comment type_{$comment_type}' {$display}>";
    echo '<a name="', urlencode($ts), '">&nbsp;</a>';
    echo "<strong>[", format_date($ts), "] ";
    echo link_to_people($email, spam_protect(htmlspecialchars($email))), "</strong>\n";
    switch ($comment_type) {
        case 'log':
            echo "<div class='log_note'>{$comment}</div>";
            break;
        default:
            // Delete comment action only for trusted developers
            echo $edit == 1 && $com_id !== 0 && $is_trusted_developer ? "<a href='bug.php?id={$bug_id}&amp;edit=1&amp;delete_comment={$com_id}'>[delete]</a>\n" : '';
            $comment = make_ticket_links(addlinks($comment));
            echo "<pre class='note'>{$comment}\n</pre>\n";
    }
    echo '</div>';
}
示例#2
0
文件: bug.php 项目: stof/pearweb
function output_note($com_id, $ts, $email, $comment, $showemail = 1, $handle = null, $comment_name = null, $registered)
{
    global $edit, $id, $user, $dbh;
    echo '<div class="comment">';
    echo '<a name="' . urlencode($ts) . '">&nbsp;</a>';
    echo "<strong>[", format_date($ts), "] ";
    if (!$registered) {
        echo 'User who submitted this comment has not confirmed identity</strong>';
        if (!auth_check('pear.dev')) {
            echo '<pre class="note">If you submitted this note, check your email.';
            echo 'If you do not have a message, <a href="resend-request-email.php?' . 'handle=' . urlencode($handle) . "\">click here to re-send</a>\n", 'MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to <a href="mailto:' . PEAR_DEV_EMAIL . '">' . PEAR_DEV_EMAIL . '</a>' . "\n", "to request the confirmation link.  All bugs/comments/patches associated with this\n\nemail address will be deleted within 48 hours if the account request is not confirmed!";
            echo "</pre>\n</div>";
            return;
        }
    } else {
        if ($handle) {
            echo '<a href="/user/' . $handle . '">' . $handle . "</a></strong>\n";
        } else {
            require_once 'bugs/pear-bugs-utils.php';
            $pbu = new PEAR_Bugs_Utils();
            echo $pbu->spamProtect(htmlspecialchars($email)) . "</strong>\n";
        }
    }
    if ($comment_name && $registered) {
        echo '(' . htmlspecialchars($comment_name) . ')';
    }
    if ($edit === 1 && $com_id !== 0 && auth_check('pear.dev')) {
        echo "&nbsp<a href=\"bug.php?id={$id}&amp;edit=1&amp;hide_comment={$com_id}\">[delete]</a>\n";
    }
    echo '<div class="note" style="white-space: pre-wrap; width: 60em; overflow: auto; max-height: 20em; padding: 1.0em; margin: 1.0em; background-color: rgb(240, 240, 240)">';
    // This has to be done so we don't wordwrap the changeset part again
    $fix = $comment;
    $status = "";
    $search = "</div>";
    $needle = strrpos($comment, $search);
    if ($needle !== false) {
        $fix = substr($comment, $needle + strlen($search));
        // Get from last div until end of string
        $status = substr($comment, 0, $needle) . $search;
    }
    $comment = make_ticket_links(addlinks(clean($fix)));
    $comment = $status . $comment;
    echo $comment;
    echo "</div>\n";
    echo '</div>' . "\n";
}