CoreFiles by mySites.guru
sendtestmail.php47 lines, 1,147 bytes, from Joomla_3.6.0-alpha-Alpha-Full_Package.zip
Raw History Compare with 3.4.0-alpha
md5
6c5a979cd5679c8e30bb2c55dc8b48d3
sha1
e4a69ab853fd327cd3d7c5dd4aea06303db8e1a1
sha256
325efeeca2fc7621c752bf87303d69c2a6161ef6166f9ab335af7f7777949bf1
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_config
 *
 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;

/**
 * Send Test Mail Controller from global configuration
 *
 * @since  3.5
 */
class ConfigControllerApplicationSendtestmail extends JControllerBase
{
	/**
	 * Method to send the test mail.
	 *
	 * @return  string
	 *
	 * @since   3.5
	 */
	public function execute()
	{
		if (!JSession::checkToken('get'))
		{
			$this->app->enqueueMessage(JText::_('JINVALID_TOKEN'));
			$this->app->redirect('index.php');
		}

		if (!JFactory::getUser()->authorise('core.admin'))
		{
			$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'));
			$this->app->redirect('index.php');
		}

		$this->app->mimeType = 'application/json';
		$this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet);
		$this->app->sendHeaders();

		$model = new ConfigModelApplication;
		echo new JResponseJson($model->sendTestMail());
		$this->app->close();
	}
}

The same content is in 3 releases, Joomla 3.6.0-alpha to 3.6.0-beta2. See them all, or every version of this file.