CoreFiles by mySites.guru
helper.php71 lines, 1,443 bytes, from Joomla_3.4.1-Stable-Full_Package.zip
Raw History Compare with 3.4.0
md5
74b49a01849415c9bcbaf1cb06d07ed2
sha1
320f0693289ae032d76c55be5d751013c9cc1386
sha256
d224b8226dbad61e1f7160b690e8ac61cbbc8ca55afcf57d236197c2998966b3
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_login
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Helper for mod_login
 *
 * @package     Joomla.Site
 * @subpackage  mod_login
 *
 * @since       1.5
 */
class ModLoginHelper
{
	/**
	 * Retrieve the url where the user should be returned after logging in
	 *
	 * @param   \Joomla\Registry\Registry  $params  module parameters
	 * @param   string                     $type    return type
	 *
	 * @return string
	 */
	public static function getReturnURL($params, $type)
	{
		$app	= JFactory::getApplication();
		$item   = $app->getMenu()->getItem($params->get($type));

		if ($item)
		{
			$vars = $item->query;
		}
		else
		{
			// Stay on the same page
			$vars = $app::getRouter()->getVars();
		}

		return base64_encode('index.php?' . JUri::buildQuery($vars));
	}

	/**
	 * Returns the current users type
	 *
	 * @return string
	 */
	public static function getType()
	{
		$user = JFactory::getUser();

		return (!$user->get('guest')) ? 'logout' : 'login';
	}

	/**
	 * Get list of available two factor methods
	 *
	 * @return array
	 */
	public static function getTwoFactorMethods()
	{
		require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php';

		return UsersHelper::getTwoFactorMethods();
	}
}

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