CoreFiles by mySites.guru
MailController.php72 lines, 1,419 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
5b929430590a17f59253332afac1fa23
sha1
b5d296ebbdefab112b8ba49d07c9442b042927cd
sha256
d73871520859e62977c87bc4a7486e6b65313d626a1d9c7e536402a411857a08
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Users\Administrator\Controller;

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;

/**
 * Users mail controller.
 *
 * @since  1.6
 */
class MailController extends BaseController
{
	/**
	 * Send the mail
	 *
	 * @return void
	 *
	 * @since 1.6
	 */
	public function send()
	{
		// Redirect to admin index if mass mailer disabled in conf
		if ($this->app->get('massmailoff', 0) == 1)
		{
			$this->app->redirect(Route::_('index.php', false));
		}

		// Check for request forgeries.
		Session::checkToken('request') or jexit(Text::_('JINVALID_TOKEN'));

		$model = $this->getModel('Mail');

		if ($model->send())
		{
			$type = 'message';
		}
		else
		{
			$type = 'error';
		}

		$msg = $model->getError();
		$this->setRedirect('index.php?option=com_users&view=mail', $msg, $type);
	}

	/**
	 * Cancel the mail
	 *
	 * @return void
	 *
	 * @since 1.6
	 */
	public function cancel()
	{
		// Check for request forgeries.
		Session::checkToken('request') or jexit(Text::_('JINVALID_TOKEN'));
		$this->setRedirect('index.php');
	}
}

No other release has this exact content. See every version of this file.