phpBB

Code Changes

File: phpbb/notification/method/messenger_base.php

  Unmodified   Added   Modified   Removed
Line 19Line 19
*/
abstract class messenger_base extends \phpbb\notification\method\base
{

*/
abstract class messenger_base extends \phpbb\notification\method\base
{

 
	/** @var \phpbb\user_loader */
protected $user_loader;

/** @var string */
protected $phpbb_root_path;

/** @var string */
protected $php_ext;

/**
* Notification Method Board Constructor
*
* @param \phpbb\user_loader $user_loader
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(\phpbb\user_loader $user_loader, $phpbb_root_path, $php_ext)
{
$this->user_loader = $user_loader;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}


	/**
* Notify using phpBB messenger
*

	/**
* Notify using phpBB messenger
*

Line 57Line 80
			include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
}
$messenger = new \messenger();

			include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
}
$messenger = new \messenger();

		$board_url = generate_board_url();

 

// Time to go through the queue and send emails


// Time to go through the queue and send emails

 
		/** @var \phpbb\notification\type\type_interface $notification */

		foreach ($this->queue as $notification)
{
if ($notification->get_email_template() === false)

		foreach ($this->queue as $notification)
{
if ($notification->get_email_template() === false)

Line 69Line 92

$user = $this->user_loader->get_user($notification->user_id);



$user = $this->user_loader->get_user($notification->user_id);


			if ($user['user_type'] == USER_IGNORE || in_array($notification->user_id, $banned_users))

			if ($user['user_type'] == USER_IGNORE || ($user['user_type'] == USER_INACTIVE && $user['user_inactive_reason'] == INACTIVE_MANUAL) || in_array($notification->user_id, $banned_users))

			{
continue;
}


			{
continue;
}


			$messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']);

			$messenger->template($notification->get_email_template(), $user['user_lang'], '', $template_dir_prefix);


$messenger->set_addresses($user);

$messenger->assign_vars(array_merge(array(
'USERNAME' => $user['username'],



$messenger->set_addresses($user);

$messenger->assign_vars(array_merge(array(
'USERNAME' => $user['username'],


				'U_NOTIFICATION_SETTINGS'		=> generate_board_url() . '/ucp.' . $this->php_ext . '?i=ucp_notifications',

				'U_NOTIFICATION_SETTINGS'		=> generate_board_url() . '/ucp.' . $this->php_ext . '?i=ucp_notifications&mode=notification_options',

			), $notification->get_email_template_variables()));

$messenger->send($notify_method);

			), $notification->get_email_template_variables()));

$messenger->send($notify_method);