Esempio n. 1
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
Esempio n. 2
0
 $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 . '>';
 $type = @$types[$_POST['in']['bug_type']];
 if (!DEVBOX) {
     // mail to package developers
     @mail($mailto, "[" . SITE_BIG . "-BUG] {$type} #{$cid} [NEW]: {$sdesc}", $ascii_report . "1\n-- \n{$dev_extra}", $extra_headers, '-f ' . PEAR_BOUNCE_EMAIL);
Esempio n. 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);
}
?>
Esempio n. 4
0
        $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>';
        echo "      <rdf:li rdf:resource=\"http://" . PEAR_CHANNELNAME . "/bug/{$row['id']}\" />\n";
        $items[$i] = "    <item rdf:about=\"http://" . PEAR_CHANNELNAME . "/bug/{$row['id']}\">\n";
        $items[$i] .= '      <title>' . utf8_encode(htmlspecialchars($row['package_name'] . ': ' . $row['bug_type'] . ' ' . $row['id'] . ' [' . $row['status'] . '] ' . $row['sdesc'])) . "</title>\n";
        $items[$i] .= "      <link>http://" . PEAR_CHANNELNAME . "/bugs/{$row['id']}</link>\n";
        $items[$i] .= '      <content:encoded><![CDATA[' . $desc . "]]></content:encoded>\n";
        $items[$i] .= '      <description><![CDATA[' . $desc . "]]></description>\n";
        if (!$row['unchanged']) {
            $items[$i] .= '      <dc:date>' . date(DATE_ATOM, $row['ts1a']) . "</dc:date>\n";
        } else {
            $items[$i] .= '      <dc:date>' . date(DATE_ATOM, $row['ts2a']) . "</dc:date>\n";
        }
        $items[$i] .= '      <dc:creator>' . utf8_encode(htmlspecialchars($pbu->spamProtect($row['email']))) . "</dc:creator>\n";
        $items[$i] .= '      <dc:subject>' . utf8_encode(htmlspecialchars($row['package_name'])) . ' ' . utf8_encode(htmlspecialchars($row['bug_type'])) . "</dc:subject>\n";
        $items[$i] .= "    </item>\n";
    }
    $items = implode('', $items);
} else {
    $warnings[] = "No bugs matched your criteria";
}
echo '
     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://' . PEAR_CHANNELNAME . '/gifs/pearsmall.gif">
    <title>' . SITE_BIG . ' Bugs</title>
    <url>http://' . PEAR_CHANNELNAME . '/gifs/pearsmall.gif</url>
Esempio n. 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);
     }
 }
Esempio n. 6
0
File: bug.php Progetto: 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";
}