phpBB

Code Changes

File: includes/functions_messenger.php

  Unmodified   Added   Modified   Removed
Line 312Line 312

/**
* Send the mail out to the recipients set previously in var $this->addresses


/**
* Send the mail out to the recipients set previously in var $this->addresses

 
	*
* @param int $method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
* @param bool $break Flag indicating if the function only formats the subject
* and the message without sending it
*
* @return bool

	*/
function send($method = NOTIFY_EMAIL, $break = false)
{

	*/
function send($method = NOTIFY_EMAIL, $break = false)
{

		global $config, $user;

		global $config, $user, $phpbb_dispatcher;


// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(


// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(

Line 323Line 329
			'EMAIL_SIG'	=> str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
'SITENAME' => htmlspecialchars_decode($config['sitename']),
));

			'EMAIL_SIG'	=> str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
'SITENAME' => htmlspecialchars_decode($config['sitename']),
));

 

$subject = $this->subject;
$message = $this->msg;
/**
* Event to modify notification message text before parsing
*
* @event core.modify_notification_message
* @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
* @var bool break Flag indicating if the function only formats the subject
* and the message without sending it
* @var string subject The message subject
* @var string message The message text
* @since 3.1.11-RC1
*/
$vars = array(
'method',
'break',
'subject',
'message',
);
extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars)));
$this->subject = $subject;
$this->msg = $message;
unset($subject, $message);


// Parse message through template
$this->msg = trim($this->template->assign_display('body'));


// Parse message through template
$this->msg = trim($this->template->assign_display('body'));

Line 438Line 468
	*/
function build_header($to, $cc, $bcc)
{

	*/
function build_header($to, $cc, $bcc)
{

		global $config;

		global $config, $phpbb_dispatcher;


// We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
$headers = array();


// We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
$headers = array();

Line 469Line 499
		$headers[] = 'X-Mailer: phpBB3';
$headers[] = 'X-MimeOLE: phpBB3';
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());

		$headers[] = 'X-Mailer: phpBB3';
$headers[] = 'X-MimeOLE: phpBB3';
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());

 

/**
* Event to modify email header entries
*
* @event core.modify_email_headers
* @var array headers Array containing email header entries
* @since 3.1.11-RC1
*/
$vars = array('headers');
extract($phpbb_dispatcher->trigger_event('core.modify_email_headers', compact($vars)));


if (sizeof($this->extra_headers))
{


if (sizeof($this->extra_headers))
{

Line 615Line 655
		if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

		if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

			$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);

			$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);


if (!$this->jabber->connect())
{


if (!$this->jabber->connect())
{

Line 790Line 830
					}

include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

					}

include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);

					$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);

					$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);


if (!$this->jabber->connect())
{


if (!$this->jabber->connect())
{

Line 1036Line 1076
	}
$collector = new \phpbb\error_collector;
$collector->install();

	}
$collector = new \phpbb\error_collector;
$collector->install();

	$smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20);













$options = array();
$verify_peer = (bool) $config['smtp_verify_peer'];
$verify_peer_name = (bool) $config['smtp_verify_peer_name'];
$allow_self_signed = (bool) $config['smtp_allow_self_signed'];
$remote_socket = $config['smtp_host'] . ':' . $config['smtp_port'];

// Set ssl context options, see http://php.net/manual/en/context.ssl.php
$options['ssl'] = array('verify_peer' => $verify_peer, 'verify_peer_name' => $verify_peer_name, 'allow_self_signed' => $allow_self_signed);
$socket_context = stream_context_create($options);

$smtp->socket = @stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);

	$collector->uninstall();
$error_contents = $collector->format_errors();


	$collector->uninstall();
$error_contents = $collector->format_errors();