phpBB

Code Changes

File: includes/functions_messenger.php

  Unmodified   Added   Modified   Removed
Line 306Line 306

/**
* 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 317Line 323
			'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 618Line 648
		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 656Line 686
	*/
protected function setup_template()
{

	*/
protected function setup_template()
{

		global $phpbb_container;

		global $phpbb_container, $phpbb_dispatcher;


if ($this->template instanceof \phpbb\template\template)
{


if ($this->template instanceof \phpbb\template\template)
{

Line 671Line 701
			$phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader(
$phpbb_container->get('filesystem')

			$phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader(
$phpbb_container->get('filesystem')

			)



			),
$phpbb_dispatcher,
array()

		);
$template_environment->setLexer($phpbb_container->get('template.twig.lexer'));


		);
$template_environment->setLexer($phpbb_container->get('template.twig.lexer'));


Line 816Line 848
					}

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 1076Line 1108
	}
$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();