cvs: pearweb /public_html/bugs patch-add.php

From: Date: Tue, 25 Mar 2008 02:28:30 +0000
Subject: cvs: pearweb /public_html/bugs patch-add.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-7380@lists.php.net to get a copy of this message
dufuz Tue Mar 25 02:28:30 2008 UTC Modified files: /pearweb/public_html/bugs patch-add.php Log: made it use pear_bugs_utils and the patch email sending function which was identical to this code anyway http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/patch-add.php?r1=1.19&r2=1.20&diff_format=u Index: pearweb/public_html/bugs/patch-add.php diff -u pearweb/public_html/bugs/patch-add.php:1.19 pearweb/public_html/bugs/patch-add.php:1.20 --- pearweb/public_html/bugs/patch-add.php:1.19 Tue Feb 5 19:18:48 2008 +++ pearweb/public_html/bugs/patch-add.php Tue Mar 25 02:28:30 2008 @@ -29,6 +29,7 @@ response_footer(); exit; } + if (PEAR::isError($buginfo = $patchinfo->getBugInfo($_POST['bug']))) { response_header('Error :: invalid bug selected'); report_error('Invalid bug "' . $id . '" selected'); @@ -174,34 +175,14 @@ * Email the package maintainers/leaders about * the new patch added to their bug request. */ - require_once 'Damblan/Mailer.php'; - require_once 'Damblan/Bugs.php'; - - $patchName = htmlspecialchars($_POST['name']); - - $rev = $e; - - $mailData = array( - 'id' => $bug, - 'url' => 'http://' . PEAR_CHANNELNAME . - "/bugs/patch-display.php?bug=$bug&patch=$patchName&revision=$rev&display=1", - 'package' => $buginfo['package_name'], - 'summary' => $dbh->getOne('SELECT sdesc from bugdb WHERE id = ?', array($bug)), - 'date' => date('Y-m-d H:i:s'), - 'name' => $_POST['name'], - 'packageUrl' => 'http://' . PEAR_CHANNELNAME . - '/bugs/bug.php?id=' . $bug, + require_once 'bugs/pear-bugs-utils.php'; + $patch = array( + 'patch' => $_POST['name'], + 'bug_id' => $bug, + 'revision' => $e, + 'package_name' => $buginfo['package_name'], ); - - $additionalHeaders['To'] = Damblan_Bugs::getMaintainers($buginfo['package_name']); - - $mailer = Damblan_Mailer::create('Patch_Added', $mailData); - - $res = true; - - if (!DEVBOX) { - $res = $mailer->send($additionalHeaders); - } + $res = PEAR_Bugs_Utils::sendPatchEmail($patch); if (PEAR::isError($res)) { // Patch not sent. Let's handle it here but not now.. @@ -209,30 +190,30 @@ } // }}} $package = $buginfo['package_name']; - $bug = $buginfo['id']; - $name = $_POST['name']; + $bug = $buginfo['id']; + $name = $_POST['name']; $patches = $patchinfo->listPatches($bug); - $errors = array(); + $errors = array(); include PEARWEB_TEMPLATEDIR . '/bugs/patchadded.php'; exit; } -if (!isset($_GET['bug'])) { +if (!isset($_GET['bug_id'])) { response_header('Error :: no bug selected'); report_error('No bug selected to add a patch to'); response_footer(); exit; } -if (PEAR::isError($buginfo = $patchinfo->getBugInfo($_GET['bug']))) { +if (PEAR::isError($buginfo = $patchinfo->getBugInfo($_GET['bug_id']))) { response_header('Error :: invalid bug selected'); report_error('Invalid bug "' . $id . '" selected'); response_footer(); exit; } -$email = isset($_GET['email']) ? $_GET['email'] : ''; -$errors = array(); +$email = isset($_GET['email']) ? $_GET['email'] : ''; +$errors = array(); $package = $buginfo['package_name']; -$bug = $buginfo['id']; -$name = isset($_GET['patch']) ? $_GET['patch'] : ''; +$bug = $buginfo['id']; +$name = isset($_GET['patch']) ? $_GET['patch'] : ''; $patches = $patchinfo->listPatches($bug); $captcha = $numeralCaptcha->getOperation(); $_SESSION['answer'] = $numeralCaptcha->getAnswer();

« previous php.pear.core (#7380) next »