- md5
- 1ae40afb4a68f57b1c623f5e1e8e4a43
- sha1
- 2be0661b47e8e7d3f35c51158793dc74e5b0c712
- sha256
- 8ff7ef3e333d4ee2c3f321f92b3025342f97dc3718a728cca52947f61faa6c69
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
<?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)
{
$url = 'index.php?Itemid=' . $item->id;
}
else
{
// Stay on the same page
$url = JUri::getInstance()->toString();
}
return base64_encode($url);
}
/**
* 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.2-rc to 3.4.3. See them all, or every version of this file.