Replace "$mibew_mailbox" variable with a constant

This commit is contained in:
Dmitriy Simushev 2014-06-02 12:08:24 +00:00
parent b6ee459833
commit 4ff92e7f5c
3 changed files with 8 additions and 7 deletions

View File

@ -39,8 +39,6 @@ class MailController extends AbstractController
*/
public function indexAction(Request $request)
{
global $mibew_mailbox;
$page = array(
'errors' => array(),
);
@ -102,7 +100,7 @@ class MailController extends AbstractController
true
);
mibew_mail($email, $mibew_mailbox, $subject, $body);
mibew_mail($email, MIBEW_MAILBOX, $subject, $body);
$page = array_merge_recursive($page, setup_logo($group));

View File

@ -55,3 +55,8 @@ define('VISITOR_COOKIE_NAME', 'MIBEW_VisitorID');
*/
define('USERID_COOKIE_NAME', 'MIBEW_UserID');
define('USERNAME_COOKIE_NAME', 'MIBEW_Data');
/**
* Mailbox of the current installation
*/
define('MIBEW_MAILBOX', $mibew_mailbox);

View File

@ -17,9 +17,7 @@
function mibew_mail($to_addr, $reply_to, $subject, $body)
{
global $mibew_mailbox;
$headers = "From: $mibew_mailbox\r\n"
$headers = "From: " . MIBEW_MAILBOX . "\r\n"
. "Reply-To: " . $reply_to . "\r\n"
. "Content-Type: text/plain; charset=utf-8\r\n"
. 'X-Mailer: PHP/' . phpversion();
@ -29,7 +27,7 @@ function mibew_mail($to_addr, $reply_to, $subject, $body)
$body = preg_replace("/\n/", "\r\n", $body);
$old_from = ini_get('sendmail_from');
@ini_set('sendmail_from', $mibew_mailbox);
@ini_set('sendmail_from', MIBEW_MAILBOX);
@mail(
$to_addr,
$real_subject,