- md5
- b4c2e2a33964bd9927ef33b33299d58d
- sha1
- 31900b5e1b7e572ecc220b36051ae3c1dcc5de82
- sha256
- 6b323e21f0e98f0081b91771e630dc1566ad9a29a7609d935a99db7f1bd37fbf
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Users\Administrator\Controller;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* 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.
$this->checkToken('request');
$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.
$this->checkToken('request');
// Clear data from session.
$this->app->setUserState('com_users.display.mail.data', null);
$this->setRedirect('index.php?option=com_users&view=users');
}
}
The same content is in 225 releases, Joomla 4.2.1 to 6.2.1-rc1. See them all, or every version of this file.