CoreFiles by mySites.guru
helper.php50 lines, 1,015 bytes, from Joomla_3.3.2-Stable-Full_Package.zip
Raw History Compare with 3.3.1
md5
8dfcc068158149bba620c4d3fec778fb
sha1
bfe7e2e3bf4827562508c8471a8bcde59344d4fa
sha256
3485caa748280acba31f1c1ef730e66fe4f518b5ec421da46a72ad06a37dbfb4
<?php
/**
 * @package    Joomla.Administrator
 *
 * @copyright  Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Joomla! Administrator Application helper class.
 * Provide many supporting API functions.
 *
 * @package     Joomla.Administrator
 * @subpackage  Application
 * @since       1.5
 */
class JAdministratorHelper
{
	/**
	 * Return the application option string [main component].
	 *
	 * @return  string  The component to access.
	 *
	 * @since   1.5
	 */
	public static function findOption()
	{
		$app = JFactory::getApplication();
		$option = strtolower($app->input->get('option'));

		$app->loadIdentity();
		$user = $app->getIdentity();

		if ($user->get('guest') || !$user->authorise('core.login.admin'))
		{
			$option = 'com_login';
		}

		if (empty($option))
		{
			$option = 'com_cpanel';
		}

		$app->input->set('option', $option);

		return $option;
	}
}

The same content is in 13 releases, Joomla 3.2.2 to 3.3.6. See them all, or every version of this file.