CoreFiles by mySites.guru
ProfileController.php59 lines, 1,460 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
a4f7c572f199b69e095c7ea4896ccf0e
sha1
77285b3cad2bc0116b3aa9de23d093a9287bc722
sha256
96020170444c94c781d0fec82215afd4a858642872f2a34f6b52b78f72a86a62
<?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;
use Joomla\CMS\Help\Help;
use Joomla\CMS\Response\JsonResponse;

/**
 * Profile controller class for Users.
 *
 * @since  3.5
 */
class ProfileController extends BaseController
{
	/**
	 * Returns the updated options for help site selector
	 *
	 * @return  void
	 *
	 * @since   3.5
	 * @throws  \Exception
	 */
	public function gethelpsites()
	{
		jimport('joomla.filesystem.file');

		// Set FTP credentials, if given
		\JClientHelper::setCredentialsFromRequest('ftp');

		if (($data = file_get_contents('https://update.joomla.org/helpsites/helpsites.xml')) === false)
		{
			throw new \Exception(\JText::_('COM_CONFIG_ERROR_HELPREFRESH_FETCH'), 500);
		}
		elseif (!\JFile::write(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $data))
		{
			throw new \Exception(\JText::_('COM_CONFIG_ERROR_HELPREFRESH_ERROR_STORE'), 500);
		}

		$options = array_merge(
			array(
				\JHtml::_('select.option', '', \JText::_('JOPTION_USE_DEFAULT'))
			),
			Help::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml')
		);

		echo new JsonResponse($options);

		$this->app->close();
	}
}

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