Example #1
0
 }
 $report = '';
 $report .= 'From:             ' . $_POST['in']['handle'] . "\n";
 $report .= 'Operating system: ' . $_POST['in']['php_os'] . "\n";
 $report .= 'Package version:  ' . $_POST['in']['package_version'] . "\n";
 $report .= 'PHP version:      ' . $_POST['in']['php_version'] . "\n";
 $report .= 'Package:          ' . $_POST['in']['package_name'] . "\n";
 $report .= 'Bug Type:         ' . $_POST['in']['bug_type'] . "\n";
 $report .= 'Bug description:  ';
 $fdesc = $fdesc;
 $sdesc = $_POST['in']['sdesc'];
 $ascii_report = "{$report}{$sdesc}\n\n" . wordwrap($fdesc);
 $ascii_report .= "\n-- \nEdit bug report at ";
 $ascii_report .= PEARWEB_PROTOCOL . PEAR_CHANNELNAME . "/bugs/bug.php?id={$cid}&edit=";
 include_once 'bugs/pear-bugs-utils.php';
 $pbu = new PEAR_Bugs_Utils();
 list($mailto, $mailfrom) = $pbu->getPackageMail($_POST['in']['package_name']);
 $email = $_POST['in']['email'];
 require_once 'bugs/pear-bugs-utils.php';
 $protected_email = '"' . PEAR_Bugs_Utils::spamProtect($email, 'text') . '"';
 $protected_email .= ' <' . $mailfrom . '>';
 $extra_headers = 'From: ' . $protected_email . "\n";
 $extra_headers .= 'X-PHP-BugTracker: PEARbug' . "\n";
 $extra_headers .= 'X-PHP-Bug: ' . $cid . "\n";
 $extra_headers .= 'X-PHP-Type: ' . $_POST['in']['bug_type'] . "\n";
 $extra_headers .= 'X-PHP-PackageVersion: ' . $_POST['in']['package_version'] . "\n";
 $extra_headers .= 'X-PHP-Version: ' . $_POST['in']['php_version'] . "\n";
 $extra_headers .= 'X-PHP-Category: ' . $_POST['in']['package_name'] . "\n";
 $extra_headers .= 'X-PHP-OS: ' . $_POST['in']['php_os'] . "\n";
 $extra_headers .= 'X-PHP-Status: Open' . "\n";
 $extra_headers .= 'Message-ID: <bug-' . $cid . '@' . PEAR_CHANNELNAME . '>';
Example #2
0
 if (isset($_GET['noteId'])) {
     $noteId = (int) $_GET['noteId'];
     $note = $manualNotes->getSingleCommentById($noteId);
     $registered = 1;
     $package = getPackageNameForId($note['page_url']);
     $package_name = is_null($package) ? 'Documentation' : $package;
     $bug_type = 'Documentation Problem';
     $email = $auth_user->email;
     $handle = $auth_user->handle;
     $sdesc = 'User note that is a documentation problem';
     $ldesc = 'Manual page: ' . $note['page_url'] . "\n" . 'Note submitter:' . "\n";
     if (!empty($note['user_handle'])) {
         $ldesc .= user_link($note['user_handle'], true);
     } else {
         include_once 'bugs/pear-bugs-utils.php';
         $ldesc .= PEAR_Bugs_Utils::spamProtect($note['user_name'], 'text');
     }
     $ldesc .= "\n\n" . str_replace('<br />', '', $dbh->escapeSimple(html_entity_decode($note['note_text'])));
     $package_version = null;
     $php_version = 'Irrelevant';
     $php_os = 'Irrelevant';
     $status = 'Open';
     $passwd = null;
     $reporter_name = $auth_user->name;
     $sql = "\n                INSERT INTO bugdb (\n                    registered,\n                    package_name,\n                    bug_type,\n                    email,\n                    handle,\n                    sdesc,\n                    ldesc,\n                    package_version,\n                    php_version,\n                    php_os,\n                    status,\n                    ts1,\n                    passwd,\n                    reporter_name\n                ) VALUES (\n                    ?, ?, ?, ?, ?,\n                    ?, ?, null, ?, ?,\n                    ?, NOW(), null, ?\n                )\n            ";
     $args = array($registered, $package_name, $bug_type, $email, $handle, $sdesc, $ldesc, $php_version, $php_os, $status, $reporter_name);
     $dbh->query($sql, $args);
     // TODO: add error handling
     $id = mysqli_insert_id($dbh->connection);
     $manualNotes->deleteSingleComment($noteId);
     // TODO: add error handling
Example #3
0
$success = '';
$bug_id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
if (!empty($bug_id)) {
    // Try to find the email and the password
    $query = "SELECT email, passwd FROM bugdb WHERE id = '" . $bug_id . "'";
    // Run the query
    $row = $dbh->getRow($query, null, DB_FETCHMODE_ASSOC);
    if (is_null($row)) {
        $errors[] = 'Invalid bug id provided: #' . $bug_id;
    } else {
        if (empty($row['passwd'])) {
            $errors[] = "No password found for #{$bug_id} bug report, sorry.";
        } else {
            $resp = mail($row['email'], 'Password for ' . SITE_BIG . ' bug report #' . $bug_id, 'The password for ' . SITE_BIG . ' bug report #' . $bug_id . ' is ' . $row['passwd'] . '.', 'From: ' . PEAR_BOUNCE_EMAIL);
            if ($resp) {
                $success = 'The password for bug report #' . $bug_id . ' has been sent to ' . PEAR_Bugs_Utils::spamProtect($row['email'], 'text');
            } else {
                $errors[] = 'Sorry. Mail can not be sent at this time. Please try again later.';
            }
        }
    }
} else {
    $errors[] = 'Invalid bug id provided';
}
response_header('Bug Report Password Finder');
echo "<h1>Bug Report Password Finder</h1>\n";
report_error($errors);
if ($success) {
    report_success($success);
}
?>
Example #4
0
echo "    <title>" . SITE_BIG . " Bug Search Results</title>\n";
echo '    <link>http://' . htmlspecialchars(PEAR_CHANNELNAME . '/bugs/search.php?' . http_build_query($_GET)) . "</link>\n";
echo "    <description>Search Results</description>\n";
echo "    <dc:language>en-us</dc:language>\n";
echo "    <dc:creator>" . PEAR_WEBMASTER_EMAIL . "</dc:creator>\n";
echo "    <dc:publisher>" . PEAR_WEBMASTER_EMAIL . "</dc:publisher>\n";
echo "    <admin:generatorAgent rdf:resource=\"http://" . PEAR_CHANNELNAME . "/bugs\"/>\n";
echo "    <sy:updatePeriod>hourly</sy:updatePeriod>\n";
echo "    <sy:updateFrequency>1</sy:updateFrequency>\n";
echo "    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>\n";
echo '    <items>
     <rdf:Seq>
';
if ($total_rows > 0) {
    require_once 'bugs/pear-bugs-utils.php';
    $pbu = new PEAR_Bugs_Utils();
    $i = 0;
    $items = array();
    while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
        $i++;
        $bug = $row;
        $desc = "{$row['package_name']} {$row['bug_type']}\nReported by ";
        if ($bug['handle']) {
            $desc .= "{$row['handle']}\n";
        } else {
            $desc .= substr($row['email'], 0, strpos($row['email'], '@')) . "@...\n";
        }
        $desc .= date(DATE_ATOM, $row['ts1a']) . "\n";
        $desc .= "PHP: {$row['php_version']} OS: {$row['php_os']} Package Version: {$row['package_version']}\n\n";
        $desc .= $row['ldesc'];
        $desc = '<pre>' . utf8_encode(htmlspecialchars($desc)) . '</pre>';
Example #5
0
 function sendBugEmail($buginfo)
 {
     $report = '';
     $report .= 'From:             ' . $this->handle . "\n";
     $report .= 'Operating system: ' . $buginfo['php_os'] . "\n";
     $report .= 'Package version:  ' . $buginfo['package_version'] . "\n";
     $report .= 'PHP version:      ' . $buginfo['php_version'] . "\n";
     $report .= 'Package:          ' . $buginfo['package_name'] . "\n";
     $report .= 'Bug Type:         ' . $buginfo['bug_type'] . "\n";
     $report .= 'Bug description:  ';
     $fdesc = $buginfo['ldesc'];
     $sdesc = $buginfo['sdesc'];
     $ascii_report = "{$report}{$sdesc}\n\n" . wordwrap($fdesc);
     $ascii_report .= "\n-- \nEdit bug report at ";
     $ascii_report .= "http://" . PEAR_CHANNELNAME . "/bugs/bug.php?id={$buginfo['id']}&edit=";
     include_once 'bugs/pear-bugs-utils.php';
     $pbu = new PEAR_Bugs_Utils();
     list($mailto, $mailfrom) = $pbu->getPackageMail($buginfo['package_name']);
     $email = $this->email;
     $protected_email = '"' . $pbu->spamProtect($email, 'text') . '"';
     $protected_email .= '<' . $mailfrom . '>';
     if ((!isset($email) || !isset($mailfrom)) && isset($buginfo['reporter_name'])) {
         $protected_email = '"' . $buginfo['reporter_name'] . '" <' . $pbu->spamProtect($buginfo['email']) . '>';
     }
     $extra_headers = 'From: ' . $protected_email . "\n";
     $extra_headers .= 'X-PHP-BugTracker: PEARbug' . "\n";
     $extra_headers .= 'X-PHP-Bug: ' . $buginfo['id'] . "\n";
     $extra_headers .= 'X-PHP-Type: ' . $buginfo['bug_type'] . "\n";
     $extra_headers .= 'X-PHP-PackageVersion: ' . $buginfo['package_version'] . "\n";
     $extra_headers .= 'X-PHP-Version: ' . $buginfo['php_version'] . "\n";
     $extra_headers .= 'X-PHP-Category: ' . $buginfo['package_name'] . "\n";
     $extra_headers .= 'X-PHP-OS: ' . $buginfo['php_os'] . "\n";
     $extra_headers .= 'X-PHP-Status: Open' . "\n";
     $extra_headers .= 'Message-ID: <bug-' . $buginfo['id'] . '@' . PEAR_CHANNELNAME . '>';
     $types = array('Bug' => 'Bug', 'Feature/Change Request' => 'Req', 'Documentation Problem' => 'Doc');
     $type = @$types[$buginfo['bug_type']];
     if (!DEVBOX) {
         // mail to package developers
         @mail($mailto, "[PEAR-BUG] {$buginfo['bug_type']} #{$buginfo['id']} [NEW]: {$sdesc}", $ascii_report . "1\n-- \n", $extra_headers, '-f ' . PEAR_BOUNCE_EMAIL);
         // mail to reporter
         @mail($email, "[PEAR-BUG] {$buginfo['bug_type']} #{$buginfo['id']}: {$sdesc}", $ascii_report . "2\n", "From: " . PEAR_CHANNELNAME . " Bug Database <{$mailfrom}>\n" . "X-PHP-Bug: {$buginfo['id']}\n" . "Message-ID: <bug-{$buginfo['id']}@" . PEAR_CHANNELNAME . ">", '-f ' . PEAR_BOUNCE_EMAIL);
     }
 }
Example #6
0
    $errors = array($e->getMessage(), 'Could not attach patch "' . htmlspecialchars($patchname) . '" to Bug #' . $id);
    $captcha = $numeralCaptcha->getOperation();
    $_SESSION['answer'] = $numeralCaptcha->getAnswer();
    return;
}
// {{{ Email after the patch is added and add a comment to the bug report.
if (!isset($buggie)) {
    $patchname = $_POST['patchname'];
    $url = "bug.php?id={$id}&edit=12&patch={$patchname}&revision={$e}";
    $bugurl = 'http://' . PEAR_CHANNELNAME . '/bugs/' . $url;
    // Add a comment about this in the bug report
    $text = <<<TXT
Added #patch bug:{$id};patch:{$patchname};revision:{$e};.
TXT;
    $query = 'INSERT INTO bugdb_comments' . ' (bug, email, ts, comment, reporter_name, handle) VALUES (?, ?, NOW(), ?, ?, ?)';
    $dbh->query($query, array($id, $auth_user->email, $text, $auth_user->name, $auth_user->handle));
    /**
     * Email the package maintainers/leaders about
     * the new patch added to their bug request.
     */
    require_once 'bugs/pear-bugs-utils.php';
    $patch = array('patch' => $patchname, 'bug_id' => $id, 'revision' => $e, 'package_name' => $buginfo['package_name']);
    $res = PEAR_Bugs_Utils::sendPatchEmail($patch);
    if (PEAR::isError($res)) {
        // Patch not sent. Let's handle it here but not now..
    }
}
// }}}
localRedirect('/bugs/bug.php' . '?id=' . $id . '&edit=12' . '&patch=' . urlencode($_POST['patchname']) . '&revision=' . $e . '&thanks=13');
//don't execute rest of script
exit;
Example #7
0
File: bug.php Project: 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";
}