CoreFiles by mySites.guru
profile_base_json.php53 lines, 1,301 bytes, from Joomla_3.7.2-Stable-Full_Package.zip
Raw History Compare with 3.7.1
md5
1729606c9b8d38ce7d9a397fbda0e3df
sha1
3b292ec0ea21d64cecbe3a19f8f28c1f979e889a
sha256
e27cfdf5e397967510f85222964dcd8e5a53a35f033dd23270e3c30d22f8a6d2
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Profile controller class for Users.
 *
 * @since  3.5
 */
class UsersControllerProfile_Base_Json extends JControllerLegacy
{
	/**
	 * 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'))
			),
			JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml')
		);

		echo json_encode($options);
		JFactory::getApplication()->close();
	}
}

The same content is in 34 releases, Joomla 3.7.0-alpha2 to 3.8.3. See them all, or every version of this file.