|
From: Benjamin C. <bc...@us...> - 2004-12-05 17:01:42
|
Update of /cvsroot/phpbt/phpbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18525 Modified Files: bug.php include.php Log Message: Fixes bug #1022927 - Use the EMAIL_DISABLED flag Index: bug.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/bug.php,v retrieving revision 1.135 retrieving revision 1.136 diff -u -r1.135 -r1.136 --- bug.php 25 Oct 2004 12:06:54 -0000 1.135 +++ bug.php 5 Dec 2004 17:01:32 -0000 1.136 @@ -213,6 +213,8 @@ if (!empty($_POST['suppress_email'])) return; // Don't send email if silent update requested. + if (defined('EMAIL_DISABLED') and EMAIL_DISABLED) return; + // Reporter never changes $reporter = $db->getOne('select email from '.TBL_AUTH_USER." u, ".TBL_USER_PREF." p where u.user_id = {$buginfo['created_by']} and u.user_id = p.user_id and email_notices = 1"); $reporterstat = ' '; Index: include.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/include.php,v retrieving revision 1.128 retrieving revision 1.129 diff -u -r1.128 -r1.129 --- include.php 25 Oct 2004 12:15:49 -0000 1.128 +++ include.php 5 Dec 2004 17:01:32 -0000 1.129 @@ -169,13 +169,17 @@ $mpassword = md5($password); $db->query("update ".TBL_AUTH_USER." set password = '$mpassword' where login = '$username'"); } - qp_mail($email, - translate("phpBugTracker Login"), - sprintf(translate("Your phpBugTracker password is %s"), $password), - sprintf("From: %s", ADMIN_EMAIL)); - $t->assign('loginerror', - '<div class="result">'.translate("Your password has been emailed to you").'</div>'); - $emailsuccess = true; + if (defined('EMAIL_DISABLED') and EMAIL_DISABLED) { + $t->assign('loginerror','<div class="result">'.translate("Your password has not been mailed to you because all system email has been disabled.").'</div>'); + } else { + qp_mail($email, + translate("phpBugTracker Login"), + sprintf(translate("Your phpBugTracker password is %s"), $password), + sprintf("From: %s", ADMIN_EMAIL)); + $t->assign('loginerror', + '<div class="result">'.translate("Your password has been emailed to you").'</div>'); + $emailsuccess = true; + } } } else { if (!$u = $auth->auth_validatelogin()) { |