diff --git a/src/mibew/libs/classes/Mibew/Controller/Chat/User/MailController.php b/src/mibew/libs/classes/Mibew/Controller/Chat/User/MailController.php index 34501976..7c1e4879 100644 --- a/src/mibew/libs/classes/Mibew/Controller/Chat/User/MailController.php +++ b/src/mibew/libs/classes/Mibew/Controller/Chat/User/MailController.php @@ -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)); diff --git a/src/mibew/libs/common/constants.php b/src/mibew/libs/common/constants.php index e645486f..c4eedb3d 100644 --- a/src/mibew/libs/common/constants.php +++ b/src/mibew/libs/common/constants.php @@ -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); diff --git a/src/mibew/libs/notify.php b/src/mibew/libs/notify.php index fbb30187..1eb9fa95 100644 --- a/src/mibew/libs/notify.php +++ b/src/mibew/libs/notify.php @@ -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,