CoreFiles by mySites.guru
MailController.php68 lines, 1,337 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
e629c7d35fa917c931965baf7d156ee9
sha1
3123653fe8688a7a28bfcb9d0bd344246b3acbac
sha256
4d268fa5fdb5f0e7281a41aaf02708cf594fbfd359ac97cfc1c3b56127661a95
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2018 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\MVC\Controller\BaseController;

/**
 * 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(\JRoute::_('index.php', false));
		}

		// Check for request forgeries.
		\JSession::checkToken('request') or jexit(\JText::_('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.
		\JSession::checkToken('request') or jexit(\JText::_('JINVALID_TOKEN'));
		$this->setRedirect('index.php');
	}
}

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