cellog Tue Apr 17 21:46:49 2007 UTC
Modified files:
/pearweb/include/bugs pear-bug-accountrequest.php
/pearweb/public_html/bugs bug.php patch-add.php report.php
resend-request-email.php
Log:
second attempt to fix mail issue on reporting a bug
http://cvs.php.net/viewvc.cgi/pearweb/include/bugs/pear-bug-accountrequest.php?r1=1.15&r2=1.16&diff_format=u
Index: pearweb/include/bugs/pear-bug-accountrequest.php
diff -u pearweb/include/bugs/pear-bug-accountrequest.php:1.15
pearweb/include/bugs/pear-bug-accountrequest.php:1.16
--- pearweb/include/bugs/pear-bug-accountrequest.php:1.15 Tue Apr 17
19:02:27 2007
+++ pearweb/include/bugs/pear-bug-accountrequest.php Tue Apr 17 21:46:49 2007
@@ -39,7 +39,7 @@
function sendEmail()
{
if (!$this->user) {
- return false;
+ return PEAR::raiseError('Internal fault: user was not set when
sending email, please report to pear-core@xxxxxxxxxxxxx');
}
$salt = $this->dbh->getOne('
SELECT salt
@@ -47,15 +47,15 @@
WHERE handle=?
', array($this->user));
if (!$salt) {
- return false;
+ throw new Exception('No such handle found, cannot send
confirmation email');
}
$email = $this->dbh->getOne('
SELECT email
FROM bug_account_request
- WHERE handle=?
- ', array($this->user));
+ WHERE salt=?
+ ', array($salt));
if (!$email) {
- return false;
+ throw new Exception('No such salt found, cannot send confirmation
email');
}
$mailData = array(
'salt' => $salt,
@@ -63,7 +63,13 @@
require_once 'Damblan/Mailer.php';
$mailer = Damblan_Mailer::create('pearweb_account_request_bug',
$mailData);
$additionalHeaders['To'] = $email;
- return $mailer->send($additionalHeaders);
+ PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
+ $e = $mailer->send($additionalHeaders);
+ PEAR::popErrorHandling();
+ if (PEAR::isError($e)) {
+ throw new Exception('Cannot send confirmation email: ' .
$e->getMessage());
+ }
+ return true;
}
function _makeSalt($handle)
@@ -125,7 +131,7 @@
return $res;
}
- $this->user = $salt;
+ $this->user = $handle;
return $salt;
}
http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/bug.php?r1=1.150&r2=1.151&diff_format=u
Index: pearweb/public_html/bugs/bug.php
diff -u pearweb/public_html/bugs/bug.php:1.150
pearweb/public_html/bugs/bug.php:1.151
--- pearweb/public_html/bugs/bug.php:1.150 Tue Apr 17 21:35:48 2007
+++ pearweb/public_html/bugs/bug.php Tue Apr 17 21:46:49 2007
@@ -15,7 +15,7 @@
* @package Bugs
* @copyright Copyright (c) 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License
- * @version $Id: bug.php,v 1.150 2007/04/17 21:35:48 cellog Exp $
+ * @version $Id: bug.php,v 1.151 2007/04/17 21:46:49 cellog Exp $
*/
/*
@@ -302,14 +302,15 @@
}
if (!DEVBOX) {
- $e = $buggie->sendEmail();
- if (PEAR::isError($e)) {
+ try {
+ $buggie->sendEmail();
+ } catch (Exception $e) {
$errors[] = 'Critical internal error: could not send' .
' email to your address ' . $_POST['in']['email'] .
', please write a mail message to the
<i>pear-dev</i>' .
'mailing list and report this problem with
details.' .
' We apologize for the problem, your report will
help' .
- ' us to fix it for future users.';
+ ' us to fix it for future users: ' .
$e->getMessage();
}
response_header('Report - Problems');
break;
http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/patch-add.php?r1=1.10&r2=1.11&diff_format=u
Index: pearweb/public_html/bugs/patch-add.php
diff -u pearweb/public_html/bugs/patch-add.php:1.10
pearweb/public_html/bugs/patch-add.php:1.11
--- pearweb/public_html/bugs/patch-add.php:1.10 Thu Apr 5 19:28:05 2007
+++ pearweb/public_html/bugs/patch-add.php Tue Apr 17 21:46:49 2007
@@ -125,7 +125,14 @@
exit;
}
if (!DEVBOX) {
- $buggie->sendEmail();
+ try {
+ $buggie->sendEmail();
+ } catch (Exception $e) {
+ response_header('Error sending confirmation email');
+ report_error(array('Patch was successfully attached, but
account confirmation email not sent, please report to pear-core@xxxxxxxxxxxxx',
$e));
+ response_footer();
+ exit;
+ }
}
localRedirect('/bugs/patch-display.php?bug=' . $bug . '&patch=' .
urlencode($_POST['name']) . '&revision=' . $e);
http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/report.php?r1=1.94&r2=1.95&diff_format=u
Index: pearweb/public_html/bugs/report.php
diff -u pearweb/public_html/bugs/report.php:1.94
pearweb/public_html/bugs/report.php:1.95
--- pearweb/public_html/bugs/report.php:1.94 Tue Apr 17 21:35:48 2007
+++ pearweb/public_html/bugs/report.php Tue Apr 17 21:46:49 2007
@@ -17,7 +17,7 @@
* @package Bugs
* @copyright Copyright (c) 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License
- * @version $Id: report.php,v 1.94 2007/04/17 21:35:48 cellog Exp $
+ * @version $Id: report.php,v 1.95 2007/04/17 21:46:49 cellog Exp $
*/
/**
@@ -225,14 +225,15 @@
$_POST['in']['handle'] =
$_POST['in']['reporter_name'] = substr('#' . $salt, 0, 20);
if (!DEVBOX) {
- $e = $buggie->sendEmail();
- if (PEAR::isError($e)) {
+ try {
+ $buggie->sendEmail();
+ } catch (Exception $e) {
$errors[] = 'Critical internal error: could not
send' .
' email to your address ' .
$_POST['in']['email'] .
', please write a mail message to the
<i>pear-dev</i>' .
'mailing list and report this problem with
details.' .
' We apologize for the problem, your report
will help' .
- ' us to fix it for future users.';
+ ' us to fix it for future users: ' .
$e->getMessage();
}
response_header('Report - Problems');
break;
http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/resend-request-email.php?r1=1.2&r2=1.3&diff_format=u
Index: pearweb/public_html/bugs/resend-request-email.php
diff -u pearweb/public_html/bugs/resend-request-email.php:1.2
pearweb/public_html/bugs/resend-request-email.php:1.3
--- pearweb/public_html/bugs/resend-request-email.php:1.2 Mon Mar 12
16:56:48 2007
+++ pearweb/public_html/bugs/resend-request-email.php Tue Apr 17 21:46:49 2007
@@ -8,9 +8,11 @@
require 'bugs/pear-bug-accountrequest.php';
$account = new PEAR_Bug_Accountrequest($_GET['handle']);
if ($account->pending()) {
- if (!$account->sendEmail()) {
+ try {
+ $account->sendEmail();
+ } catch (Exception $e) {
response_header('Error: cannot send confirmation email');
- report_error('Error: confirmation email could not be sent');
+ report_error('Error: confirmation email could not be sent: ' .
$e->getMessage());
response_footer();
exit;
}
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|