Spade
Mini Shell
assets/css/index.html000064400000000037151167412410010635
0ustar00<!DOCTYPE html><title></title>
assets/css/loginasuser.css000064400000001347151167412410011712 0ustar00/*
CSS Style for Login as User link. */
table td.login_as_user {
margin: 0 0 20px 0;
text-align: left;
}
table td.login_as_user:last-child {
margin-bottom: 0;
}
table td.login_as_user a {
display: inline-block;
padding: 5px;
margin: 0px !important;
border: 1px dotted #ccc;
}
/*for demo only */
/* table th.login_as_user {
position: relative;
}
table th.login_as_user .arrow-down-bg-icon {
display: block;
background: transparent
url('https://temp.web357.com/arrow-down.png')
no-repeat left center;
position: absolute;
width: 64px;
height: 64px;
top: -60px;
left: 10px;
} */
.login_as_user_edit {
display: inline-block;
margin: 5px 0 20px 0;
border: 1px solid #ccc;
padding: 9px 15px;
}
assets/index.html000064400000000037151167412410010045 0ustar00<!DOCTYPE
html><title></title>
assets/js/loginasuser-communitybuilder.js000064400000002222151167412410014744
0ustar00var jQueryWeb357LoginAsUserCommunityBuilder = jQuery.noConflict();
jQueryWeb357LoginAsUserCommunityBuilder(function ($) {
/**
Community Builder: User Management
*/
// Login as user button
$(
"body.com_comprofiler.view-showusers
form[action='index.php'] table.table tbody"
)
.find('tr')
.each(function () {
var email = $(this).find('td').eq(7).text().trim();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email.trim()
);
$(this)
.find('td')
.eq(7)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-email"
style="font-weight:bold">' +
email +
'</span></td>'
);
});
// Column
$(
"body.com_comprofiler.view-showusers
form[action='index.php'] table.table thead"
)
.find('th')
.eq(7)
.after('<th>Login as User</th>');
});
assets/js/loginasuser-hikashop.js000064400000005341151167412410013164
0ustar00var jQueryWeb357LoginAsUserHikashop = jQuery.noConflict();
jQueryWeb357LoginAsUserHikashop(function ($) {
// Users
$('#hikashop_user_listing')
.find('tr')
.each(function () {
var name = $(this).find('td').eq(3).text();
var username = $(this).find('td').eq(4).text();
var email = $(this).find('td').eq(5).text();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email
);
$(this).find('th').eq(5).after('<th>Login
as User</th>'); // 5 = the fifth column which is the E-mail
table column
if (name.length > 0 && username.length > 0) {
$(this)
.find('td')
.eq(5)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-username"
style="font-weight:bold">' +
name +
' (' +
username +
')' +
'</span></td>'
);
} else {
$(this).find('td').eq(5).after('<td>No
user exists</td>');
}
});
// Orders
$('#hikashop_order_listing')
.find('tbody tr')
.each(function (i) {
var username = $('td.hikashop_order_customer_value')
.find('br')
.get(i).previousSibling.nodeValue;
var userExists = /[\(\)]/.test(username);
var email =
$('td.hikashop_order_customer_value').find('br').get(i)
.nextSibling.nodeValue;
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
$.trim(email)
);
$(this)
.find('th.hikashop_order_customer_title')
.after('<th>Login as User</th>'); //
5 = the fifth column which is the E-mail table column
if (userExists) {
$(this)
.find('td.hikashop_order_customer_value')
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-username"
style="font-weight:bold">' +
username +
'</span></td>'
);
} else {
$(this)
.find('td.hikashop_order_customer_value')
.after('<td>No user
exists.</td>');
}
});
});
assets/js/loginasuser-j2store.js000064400000006107151167412410012747
0ustar00var jQueryWeb357LoginAsUserJ2Store = jQuery.noConflict();
jQueryWeb357LoginAsUserJ2Store(function ($) {
/**
J2Store Orders page
*/
// Login as user button
$(
"body.com_j2store.view-orders
form[action='index.php?option=com_j2store&view=orders']
table.table tbody"
)
.find('tr')
.each(function () {
var email =
$(this).find('td').eq(5).find('small').text().trim();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email.trim()
);
$(this)
.find('td')
.eq(5)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-email"
style="font-weight:bold">' +
email +
'</span></td>'
);
});
// Column
$(
"body.com_j2store.view-orders
form[action='index.php?option=com_j2store&view=orders']
table.table thead"
)
.find('th')
.eq(8)
.after('<th>Login as User</th>');
/**
J2Store Order page
*/
// Login as user button
var billingAddress = $(this)
.find(
"body.com_j2store.view-order
form[action='index.php'] table.table.addresses tbody tr td"
)
.eq(0);
if (billingAddress.length) {
const getOnlyEmail = billingAddress
.text()
.trim()
.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
const email = getOnlyEmail[0].trim();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email
);
billingAddress.append(
'<div style="margin: 15px 0"><a
target="_blank" class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-email"
style="font-weight:bold">' +
email +
'</span></div>'
);
}
/**
J2Store Customers page
*/
// Login as user button
$(
"body.com_j2store.view-customers
form[action='index.php'] table.table tbody"
)
.find('tr')
.each(function () {
var email = $(this).find('td').eq(2).text().trim();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email.trim()
);
$(this)
.find('td')
.eq(2)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-email"
style="font-weight:bold">' +
email +
'</span></td>'
);
});
// Column
$(
"body.com_j2store.view-customers
form[action='index.php'] table.table thead"
)
.find('th')
.eq(2)
.after('<th>Login as User</th>');
});
assets/js/loginasuser-osmembership.js000064400000005242151167412410014053
0ustar00var jQueryWeb357LoginAsUserMembershipPro = jQuery.noConflict();
jQueryWeb357LoginAsUserMembershipPro(function ($) {
/**
Membership pro Orders' page
*/
// Login as user button
$(
"form[action='index.php?option=com_osmembership&view=subscriptions']
table.adminlist tbody"
)
.find('tr')
.each(function () {
var last_name_col = $(this).find('td').eq(3).text();
var last_name_col_clean = last_name_col.trim();
var username = last_name_col_clean.substring(
last_name_col_clean.indexOf('(') + 1,
last_name_col_clean.indexOf(')')
);
var build_login_as_user_url =
login_as_user_with_username_url.replace(
'{{osm_username}}',
username.trim()
);
if (username.length === 0) {
$(this).find('td').eq(3).after('<td>---</td>');
} else {
$(this)
.find('td')
.eq(3)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-username"
style="font-weight:bold">' +
username +
'</span></td>'
);
}
});
// Column
$(
"form[action='index.php?option=com_osmembership&view=subscriptions']
table.adminlist thead"
)
.find('th')
.eq(3)
.after('<th>Login as User</th>');
/**
Membership pro Subscribers' page
*/
// Login as user button
$(
"form[action='index.php?option=com_osmembership&view=subscribers']
table.adminlist tbody"
)
.find('tr')
.each(function () {
var email = $(this).find('td').eq(3).text();
var build_login_as_user_url =
login_as_user_with_email_url.replace(
'{{email}}',
email.trim()
);
$(this)
.find('td')
.eq(3)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-username"
style="font-weight:bold">' +
email +
'</span></td>'
);
});
// Column
$(
"form[action='index.php?option=com_osmembership&view=subscribers']
table.adminlist thead"
)
.find('th')
.eq(3)
.after('<th>Login as User</th>');
});
assets/js/loginasuser-phocacart.js000064400000005762151167412410013331
0ustar00var jQueryWeb357LoginAsUserPhocaCart = jQuery.noConflict();
jQueryWeb357LoginAsUserPhocaCart(function ($) {
/**
Phocacart - Users' page
*/
// Login as user button
$(
"form[action='/administrator/index.php?option=com_phocacart&view=phocacartusers']
table tbody"
)
.find('tr')
.each(function () {
var name = $(this).find('td').eq(2).text();
var phocaEmailCol = $(this).find('td').eq(9).text();
const getOnlyEmail = phocaEmailCol
.trim()
.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
const email = getOnlyEmail[0].trim();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email.trim()
);
$(this)
.find('td')
.eq(9)
.after(
'<td><a target="_blank"
class="btn button btn-primary" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-email"
style="font-weight:bold">' +
name +
'</span></td>'
);
});
// Column
$(
"form[action='/administrator/index.php?option=com_phocacart&view=phocacartusers']
table thead"
)
.find('th')
.eq(9)
.after('<th>Login as User</th>');
/**
Phocacart - Orders' page
*/
// Login as user button
$(
"form[action='/administrator/index.php?option=com_phocacart&view=phocacartorders']
table tbody"
)
.find('tr')
.each(function () {
var last_name_col = $(this).find('td').eq(3).text();
var last_name_col_clean = last_name_col.trim();
var username = last_name_col_clean.substring(
last_name_col_clean.indexOf('(') + 1,
last_name_col_clean.indexOf(')')
);
var build_login_as_user_url =
login_as_user_with_username_url.replace(
'{{phoca_username}}',
username.trim()
);
console.log(build_login_as_user_url);
if (username.length === 0) {
$(this).find('td').eq(3).after('<td>---</td>');
} else {
$(this)
.find('td')
.eq(3)
.after(
'<td><a target="_blank"
class="btn button btn-primary" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-username"
style="font-weight:bold">' +
username +
'</span></td>'
);
}
});
// Column
$(
"form[action='/administrator/index.php?option=com_phocacart&view=phocacartusers']
table thead"
)
.find('th')
.eq(9)
.after('<th>Login as User</th>');
});
assets/js/loginasuser-virtuemart.js000064400000006063151167412410013562
0ustar00var jQueryWeb357LoginAsUserVirtueMart = jQuery.noConflict();
jQueryWeb357LoginAsUserVirtueMart(function ($) {
/**
VirtueMart's Users' page
*/
// Login as user button
$(
".admin.com_virtuemart.view-user
form[action='/administrator/index.php?option=com_virtuemart&view=user']
table tbody, .admin.com_virtuemart.view-user .virtuemart-admin-area
form[name='adminForm'] table tbody"
)
.find('tr')
.each(function () {
var username = $(this).find('td').eq(1).text();
var name = $(this).find('td').eq(2).text();
var email = $(this).find('td').eq(3).text();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email.trim()
);
$(this)
.find('td')
.eq(3)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-email"
style="font-weight:bold">' +
name +
' (' +
username +
')' +
'</span></td>'
);
});
// Column
$(
".admin.com_virtuemart.view-user
form[action='/administrator/index.php?option=com_virtuemart&view=user']
table tbody, .admin.com_virtuemart.view-user .virtuemart-admin-area
form[name='adminForm'] table thead"
)
.find('th')
.eq(3)
.after('<th>Login as User</th>');
/**
VirtueMart's Orders page
*/
// Login as user button
$(
".admin.com_virtuemart.view-orders
form[action='index.php?option=com_virtuemart&view=orders']
table.adminlist tbody, .admin.com_virtuemart.view-orders
form[action='index.php?option=com_virtuemart&view=orders']
table.uk-table tbody"
)
.find('tr')
.each(function () {
var name = $(this).find('td').eq(2).html();
const getOnlyEmail = name
.trim()
.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);
const email = getOnlyEmail[0].trim();
var build_login_as_user_url = login_as_user_url.replace(
'{{email}}',
email
);
$(this)
.find('td')
.eq(2)
.after(
'<td><a target="_blank"
class="btn" href="' +
build_login_as_user_url +
'">Login as <span
class="loginasuser-email"
style="font-weight:bold">' +
email +
' </span></td>'
);
});
// Column
$(
".admin.com_virtuemart.view-orders
form[action='index.php?option=com_virtuemart&view=orders']
table.adminlist thead, .admin.com_virtuemart.view-orders
form[action='index.php?option=com_virtuemart&view=orders']
table.uk-table thead"
)
.find('th')
.eq(2)
.after('<th>Login as User</th>');
});
com_users_helper_files/index.html000064400000000043151167412410013260
0ustar00<!DOCTYPE html><title></title>
com_users_helper_files/joomla_com_users/common.php000064400000007421151167412410016633
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
// BEGIN: Web357 (Login as User - system joomla! plugin)
$db = JFactory::getDbo();
$db->setQuery("SELECT enabled FROM #__extensions WHERE type =
'plugin' AND element = 'loginasuser'");
$loginasclient_is_enabled = $db->loadResult();
if ($loginasclient_is_enabled)
{
// get custom css
$plugin = JPluginHelper::getPlugin('system',
'loginasuser');
$params = new JRegistry($plugin->params);
$custom_css = $params->get('custom_css');
$displayed_text = $params->get('displayed_text', 'Login
as %s »');
$login_as_type = $params->get('login_as_type',
'username');
$login_as_type_characters_limit =
$params->get('login_as_type_characters_limit', 0);
echo (!empty($custom_css)) ? '<style
type="text/css">'.$custom_css.'</style>'
: '';
// Load the plugin language file
$lang = JFactory::getLanguage();
$current_lang_tag = $lang->getTag();
$extension = 'plg_system_loginasuser';
$base_dir = JPATH_SITE.'/plugins/system/loginasuser/';
$language_tag = (!empty($current_lang_tag)) ? $current_lang_tag :
'en-GB';
$reload = true;
$lang->load($extension, $base_dir, $language_tag, $reload);
// Check if the logged in Admin user can use the LoginAsUser functionality
function canLoginAsUser($user_id)
{
// me
$user = JFactory::getUser();
$me = $user->id;
// get params
$plugin = JPluginHelper::getPlugin('system',
'loginasuser');
$params = new JRegistry($plugin->params);
$custom_css = $params->get('custom_css');
// get user groups
$usergroups = JAccess::getGroupsByUser($user_id); //
implode(',', $usergroups)
if ($usergroups[0] == 1)
{
unset($usergroups[0]);
$usergroups = array_values($usergroups);
}
// define arrays
$get_access = array();
$get_access_for_all = array();
$allowed_admins_prm_arr = array();
$is_enabled_arr = array();
foreach ($usergroups as $usergroup_id)
{
$is_enabled = $params->get('enable_'.$usergroup_id,
'1');
$allowed_admins_prm = $params->get('users_'.$usergroup_id);
if ($is_enabled)
{
// The usergroup is enabled from the plugin parameters
$is_enabled_arr[] = 1;
if (!empty($allowed_admins_prm))
{
if (in_array($me, $allowed_admins_prm))
{
// Has access because the logged in admin user is in the allowed list
$get_access[] = 1;
}
else
{
// No access because the logged in admin user is not in the allowed
list
$get_access[] = 0;
}
}
else
{
// Has access because this usergroup is open for all (blank input
field)
$get_access_for_all[] = 1;
}
if (isset($allowed_admins_prm[0]))
{
$allowed_admins_prm_arr[] = $allowed_admins_prm[0];
}
}
else
{
// The usergroup is disabled from the plugin parameters
$is_enabled_arr[] = 0;
}
}
if (array_sum($is_enabled_arr) > 0 && array_sum($get_access)
> 0) // usergroup is active and access for specific users
{
// Can login as user
return true;
}
elseif (array_sum($is_enabled_arr) > 0 &&
array_sum($allowed_admins_prm_arr) == 0) // usergroup is active and access
for all
{
// Can login as user
return true;
}
else
{
// Cannot login as user
return false;
}
}
}
// END: Web357 (Login as User - system joomla! plugin)
com_users_helper_files/joomla_com_users/default.php000064400000002147151167412410016767
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/common.php');
if (version_compare(JVERSION, '3.0', 'gt') &&
version_compare(JVERSION, '4.0', 'lt'))
{
// Joomla! 3.x
require_once(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j3-default.php');
}
else if (version_compare(JVERSION, '4.0', 'gt'))
{
// Joomla! 4.x
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j4-default.php');
}com_users_helper_files/joomla_com_users/edit.php000064400000002161151167412410016264
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/common.php');
if (version_compare(JVERSION, '3.0', 'gt') &&
version_compare(JVERSION, '4.0', 'lt'))
{
// Joomla! 3.x
require_once(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j3-default-edit.php');
}
else if (version_compare(JVERSION, '4.0', 'gt'))
{
// Joomla! 4.x
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j4-default-edit.php');
}com_users_helper_files/joomla_com_users/j3-default-edit.php000064400000014432151167412410020224
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2008 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JFactory::getDocument()->addScriptDeclaration("
Joomla.submitbutton = function(task)
{
if (task == 'user.cancel' ||
document.formvalidator.isValid(document.getElementById('user-form')))
{
Joomla.submitform(task, document.getElementById('user-form'));
}
};
Joomla.twoFactorMethodChange = function(e)
{
var selectedPane = 'com_users_twofactor_' +
jQuery('#jform_twofactor_method').val();
jQuery.each(jQuery('#com_users_twofactor_forms_container>div'),
function(i, el) {
if (el.id != selectedPane)
{
jQuery('#' + el.id).hide(0);
}
else
{
jQuery('#' + el.id).show(0);
}
});
};
");
// Get the form fieldsets.
$fieldsets = $this->form->getFieldsets();
?>
<form action="<?php echo
JRoute::_('index.php?option=com_users&layout=edit&id=' .
(int) $this->item->id); ?>" method="post"
name="adminForm" id="user-form"
class="form-validate form-horizontal"
enctype="multipart/form-data">
<?php echo JLayoutHelper::render('joomla.edit.item_title',
$this); ?>
<?php
// BEGIN: Web357 (Login as User - system joomla! plugin)
if ($loginasclient_is_enabled):
// Get current user session
$session = Factory::getSession();
$current_session_id = $session->getId();
// Get the return URL
$jtoken = $current_session_id;
$login_as_user_url = new Uri(Uri::root() . 'index.php');
$params = [
'loginasclient' => 1,
'lacusr' => $this->item->username ?
$this->escape(rawurlencode($this->item->username)) : '',
'lacpas' => $this->escape($this->item->password),
'token' => $jtoken,
];
array_walk($params, function ($value, $key) use (&$login_as_user_url)
{
$login_as_user_url->setVar($key, $value);
});
if ($this->item->id > 0):
if (canLoginAsUser($this->item->id)):
?>
<div class="login_as_user
login_as_user_edit">
<a href="<?php echo $login_as_user_url;
?>" title="Login as this User" target="_blank"
class="login_as_user_link"><span
class="icon-user"></span>
<?php
$login_as_txt =
$this->escape($this->item->name) . ' (' .
$this->escape($this->item->username) . ')';
echo sprintf($displayed_text,
"<strong>".$login_as_txt."</strong>");
?>
</a>
</div>
<?php
else:
?>
<div class="login_as_user"><small>You
are not authorised to use the Login as User functionality for this User
Group.</small></div>
<?php
endif;
endif;
endif;
// END: Web357 (Login as User - system joomla! plugin)
?>
<fieldset>
<?php echo JHtml::_('bootstrap.startTabSet',
'myTab', array('active' => 'details'));
?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'details', JText::_('COM_USERS_USER_ACCOUNT_DETAILS'));
?>
<?php foreach
($this->form->getFieldset('user_details') as $field) :
?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php if ($field->fieldname == 'password') : ?>
<?php // Disables autocomplete ?> <input
type="password" style="display:none">
<?php endif; ?>
<?php echo $field->input; ?>
</div>
</div>
<?php endforeach; ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($this->grouplist) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'groups', JText::_('COM_USERS_ASSIGNED_GROUPS')); ?>
<?php echo $this->loadTemplate('groups'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php
$this->ignore_fieldsets = array('user_details');
echo JLayoutHelper::render('joomla.edit.params', $this);
?>
<?php if (!empty($this->tfaform) && $this->item->id)
: ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab',
'twofactorauth',
JText::_('COM_USERS_USER_TWO_FACTOR_AUTH')); ?>
<div class="control-group">
<div class="control-label">
<label id="jform_twofactor_method-lbl"
for="jform_twofactor_method" class="hasTooltip"
title="<?php echo '<strong>' .
JText::_('COM_USERS_USER_FIELD_TWOFACTOR_LABEL') .
'</strong><br />' .
JText::_('COM_USERS_USER_FIELD_TWOFACTOR_DESC'); ?>">
<?php echo
JText::_('COM_USERS_USER_FIELD_TWOFACTOR_LABEL'); ?>
</label>
</div>
<div class="controls">
<?php echo JHtml::_('select.genericlist',
Usershelper::getTwoFactorMethods(), 'jform[twofactor][method]',
array('onchange' =>
'Joomla.twoFactorMethodChange()'), 'value',
'text', $this->otpConfig->method,
'jform_twofactor_method', false); ?>
</div>
</div>
<div id="com_users_twofactor_forms_container">
<?php foreach ($this->tfaform as $form) : ?>
<?php $style = $form['method'] ==
$this->otpConfig->method ? 'display: block' :
'display: none'; ?>
<div id="com_users_twofactor_<?php echo
$form['method'] ?>" style="<?php echo $style;
?>">
<?php echo $form['form'] ?>
</div>
<?php endforeach; ?>
</div>
<fieldset>
<legend>
<?php echo JText::_('COM_USERS_USER_OTEPS'); ?>
</legend>
<div class="alert alert-info">
<?php echo JText::_('COM_USERS_USER_OTEPS_DESC'); ?>
</div>
<?php if (empty($this->otpConfig->otep)) : ?>
<div class="alert alert-warning">
<?php echo JText::_('COM_USERS_USER_OTEPS_WAIT_DESC');
?>
</div>
<?php else : ?>
<?php foreach ($this->otpConfig->otep as $otep) : ?>
<span class="span3">
<?php echo substr($otep, 0, 4); ?>-<?php echo substr($otep, 4,
4); ?>-<?php echo substr($otep, 8, 4); ?>-<?php echo
substr($otep, 12, 4); ?>
</span>
<?php endforeach; ?>
<div class="clearfix"></div>
<?php endif; ?>
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
</fieldset>
<input type="hidden" name="task" value=""
/>
<?php echo JHtml::_('form.token'); ?>
</form>
com_users_helper_files/joomla_com_users/j3-default.php000064400000023755151167412410017311
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2007 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$loggeduser = JFactory::getUser();
$debugUsers =
$this->state->get('params')->get('debugUsers',
1);
?>
<form action="<?php echo
JRoute::_('index.php?option=com_users&view=users');
?>" method="post" name="adminForm"
id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php
// Search tools bar
echo JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped"
id="userList">
<thead>
<tr>
<th width="1%" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th class="nowrap">
<?php echo JHtml::_('searchtools.sort',
'COM_USERS_HEADING_NAME', 'a.name', $listDirn,
$listOrder); ?>
</th>
<th width="10%" class="nowrap">
<?php echo JHtml::_('searchtools.sort',
'JGLOBAL_USERNAME', 'a.username', $listDirn,
$listOrder); ?>
</th>
<?php
// BEGIN: Web357 (Login as User - system joomla! plugin)
if ($loginasclient_is_enabled):
?>
<th width="15%" class="nowrap
login_as_user">
<div class="arrow-down-bg-icon"></div>
<?php echo JHtml::_('searchtools.sort',
JText::_('COM_LOGINASUSER'), 'a.name', $listDirn,
$listOrder); ?>
</th>
<?php
endif;
// END: Web357 (Login as User - system joomla! plugin)
?>
<th width="5%" class="nowrap center">
<?php echo JHtml::_('searchtools.sort',
'COM_USERS_HEADING_ENABLED', 'a.block', $listDirn,
$listOrder); ?>
</th>
<th width="5%" class="nowrap center
hidden-phone">
<?php echo JHtml::_('searchtools.sort',
'COM_USERS_HEADING_ACTIVATED', 'a.activation',
$listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap">
<?php echo JText::_('COM_USERS_HEADING_GROUPS'); ?>
</th>
<th width="15%" class="nowrap hidden-phone
hidden-tablet">
<?php echo JHtml::_('searchtools.sort',
'JGLOBAL_EMAIL', 'a.email', $listDirn, $listOrder);
?>
</th>
<th width="10%" class="nowrap hidden-phone
hidden-tablet">
<?php echo JHtml::_('searchtools.sort',
'COM_USERS_HEADING_LAST_VISIT_DATE', 'a.lastvisitDate',
$listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone
hidden-tablet">
<?php echo JHtml::_('searchtools.sort',
'COM_USERS_HEADING_REGISTRATION_DATE',
'a.registerDate', $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort',
'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder);
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $item) :
$canEdit = $this->canDo->get('core.edit');
$canChange =
$loggeduser->authorise('core.edit.state', 'com_users');
// If this group is super admin and this user is not super admin,
$canEdit is false
if ((!$loggeduser->authorise('core.admin')) &&
JAccess::check($item->id, 'core.admin'))
{
$canEdit = false;
$canChange = false;
}
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php if ($canEdit || $canChange) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id);
?>
<?php endif; ?>
</td>
<td>
<div class="name break-word">
<?php if ($canEdit) : ?>
<a href="<?php echo
JRoute::_('index.php?option=com_users&task=user.edit&id='
. (int) $item->id); ?>" title="<?php echo
JText::sprintf('COM_USERS_EDIT_USER',
$this->escape($item->name)); ?>">
<?php echo $this->escape($item->name); ?></a>
<?php else : ?>
<?php echo $this->escape($item->name); ?>
<?php endif; ?>
</div>
<div class="btn-group">
<?php echo JHtml::_('users.filterNotes',
$item->note_count, $item->id); ?>
<?php echo JHtml::_('users.notes',
$item->note_count, $item->id); ?>
<?php echo JHtml::_('users.addNote', $item->id);
?>
</div>
<?php echo JHtml::_('users.notesModal',
$item->note_count, $item->id); ?>
<?php if ($item->requireReset == '1') : ?>
<span class="label label-warning"><?php echo
JText::_('COM_USERS_PASSWORD_RESET_REQUIRED'); ?></span>
<?php endif; ?>
<?php if ($debugUsers) : ?>
<div class="small"><a href="<?php echo
JRoute::_('index.php?option=com_users&view=debuguser&user_id='
. (int) $item->id); ?>">
<?php echo JText::_('COM_USERS_DEBUG_USER');
?></a></div>
<?php endif; ?>
</td>
<td class="break-word">
<?php echo $this->escape($item->username); ?>
</td>
<?php
// BEGIN: Web357 (Login as User - system joomla! plugin)
if ($loginasclient_is_enabled):
// Get current user session
$session = Factory::getSession();
$current_session_id = $session->getId();
// Get the return URL
$jtoken = $current_session_id;
$login_as_user_url = new Uri(Uri::root() . 'index.php');
$params = [
'loginasclient' => 1,
'lacusr' => $item->username ?
$this->escape(rawurlencode($item->username)) : '',
'lacpas' => $this->escape($item->password),
'token' => $jtoken,
];
array_walk($params, function ($value, $key) use
(&$login_as_user_url) {
$login_as_user_url->setVar($key, $value);
});
if ($canChange && canLoginAsUser($item->id)):
?>
<td class="break-word login_as_user">
<a href="<?php echo $login_as_user_url; ?>"
target="_blank" class="login_as_user_link"><span
class="icon-user"></span>
<?php
if ($login_as_type === 'name')
{
$login_as_txt = $this->escape($item->name);
}
else
{
$login_as_txt = $this->escape($item->username);
}
if (is_numeric($login_as_type_characters_limit) &&
$login_as_type_characters_limit > 0)
{
if(strlen($login_as_txt) > $login_as_type_characters_limit)
{
$login_as_txt = trim(substr($login_as_txt, 0,
$login_as_type_characters_limit)) . '…';
}
}
echo sprintf($displayed_text,
"<strong>".$login_as_txt."</strong>");
?>
</a>
</th>
<?php
else:
?>
<td class="login_as_user"><small>You are not
authorised to use the Login as User functionality for this User
Group.</small></th>
<?php
endif;
endif;
// END: Web357 (Login as User - system joomla! plugin)
?>
<td class="center">
<?php
$self = $loggeduser->id == $item->id;
if ($canChange) :
echo JHtml::_('jgrid.state',
JHtml::_('users.blockStates', $self), $item->block, $i,
'users.', !$self);
else :
echo JHtml::_('jgrid.state',
JHtml::_('users.blockStates', $self), $item->block, $i,
'users.', false);
endif; ?>
</td>
<td class="center hidden-phone">
<?php
$activated = empty( $item->activation) ? 0 : 1;
echo JHtml::_('jgrid.state',
JHtml::_('users.activateStates'), $activated, $i,
'users.', (boolean) $activated);
?>
</td>
<td>
<?php if (substr_count($item->group_names, "\n")
> 1) : ?>
<span class="hasTooltip" title="<?php echo
JHtml::_('tooltipText',
JText::_('COM_USERS_HEADING_GROUPS'),
nl2br($item->group_names), 0); ?>"><?php echo
JText::_('COM_USERS_USERS_MULTIPLE_GROUPS'); ?></span>
<?php else : ?>
<?php echo nl2br($item->group_names); ?>
<?php endif; ?>
</td>
<td class="hidden-phone break-word hidden-tablet">
<?php echo
JStringPunycode::emailToUTF8($this->escape($item->email)); ?>
</td>
<td class="hidden-phone hidden-tablet">
<?php if ($item->lastvisitDate !=
$this->db->getNullDate() && !empty($item->lastvisitDate))
: ?>
<?php echo JHtml::_('date', $item->lastvisitDate,
JText::_('DATE_FORMAT_LC6')); ?>
<?php else : ?>
<?php echo JText::_('JNEVER'); ?>
<?php endif; ?>
</td>
<td class="hidden-phone hidden-tablet">
<?php echo JHtml::_('date', $item->registerDate,
JText::_('DATE_FORMAT_LC6')); ?>
</td>
<td class="hidden-phone">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php // Load the batch processing form if user is allowed ?>
<?php if ($loggeduser->authorise('core.create',
'com_users')
&& $loggeduser->authorise('core.edit',
'com_users')
&& $loggeduser->authorise('core.edit.state',
'com_users')) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' =>
JText::_('COM_USERS_BATCH_OPTIONS'),
'footer' =>
$this->loadTemplate('batch_footer'),
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<?php endif; ?>
<?php echo
Web357Framework\Functions::showFooter("com_loginasuser",
JText::_('COM_LOGINASUSER')); ?>
<input type="hidden" name="task"
value="" />
<input type="hidden" name="boxchecked"
value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
com_users_helper_files/joomla_com_users/j4-default-edit.php000064400000011576151167412410020233
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2008 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
/** @var Joomla\Component\Users\Administrator\View\User\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
$input = Factory::getApplication()->input;
// Get the form fieldsets.
$fieldsets = $this->form->getFieldsets();
$settings = array();
$this->useCoreUI = true;
?>
<form action="<?php echo
Route::_('index.php?option=com_users&layout=edit&id=' .
(int) $this->item->id); ?>" method="post"
name="adminForm" id="user-form"
enctype="multipart/form-data" aria-label="<?php echo
Text::_('COM_USERS_USER_FORM_' . ((int) $this->item->id ===
0 ? 'NEW' : 'EDIT'), true); ?>"
class="form-validate">
<h2><?php echo $this->form->getValue('name',
null, Text::_('COM_USERS_USER_NEW_USER_TITLE')); ?></h2>
<?php
// BEGIN: Web357 (Login as User - system joomla! plugin)
if ($loginasclient_is_enabled):
// Get current user session
$session = Factory::getSession();
$current_session_id = $session->getId();
// Get the return URL
$jtoken = $current_session_id;
$login_as_user_url = new Uri(Uri::root() . 'index.php');
$params = [
'loginasclient' => 1,
'lacusr' => $this->item->username ?
$this->escape(rawurlencode($this->item->username)) : '',
'lacpas' => $this->escape($this->item->password),
'token' => $jtoken,
];
array_walk($params, function ($value, $key) use (&$login_as_user_url)
{
$login_as_user_url->setVar($key, $value);
});
if ($this->item->id > 0):
if (canLoginAsUser($this->item->id)):
?>
<div class="login_as_user
login_as_user_edit">
<a href="<?php echo $login_as_user_url;
?>" title="Login as this User" target="_blank"
class="login_as_user_link"><span
class="icon-user"></span>
<?php
$login_as_txt =
$this->escape($this->item->name) . ' (' .
$this->escape($this->item->username) . ')';
echo sprintf($displayed_text,
"<strong>".$login_as_txt."</strong>");
?>
</a>
</div>
<?php
else:
?>
<div class="login_as_user"><small>You
are not authorised to use the Login as User functionality for this User
Group.</small></div>
<?php
endif;
endif;
endif;
// END: Web357 (Login as User - system joomla! plugin)
?>
<div class="main-card">
<?php echo HTMLHelper::_('uitab.startTabSet',
'myTab', ['active' => 'details',
'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab',
'myTab', 'details',
Text::_('COM_USERS_USER_ACCOUNT_DETAILS')); ?>
<fieldset class="options-form">
<legend><?php echo
Text::_('COM_USERS_USER_ACCOUNT_DETAILS'); ?></legend>
<div class="form-grid">
<?php echo
$this->form->renderFieldset('user_details'); ?>
</div>
</fieldset>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php if ($this->grouplist) : ?>
<?php echo HTMLHelper::_('uitab.addTab',
'myTab', 'groups',
Text::_('COM_USERS_ASSIGNED_GROUPS')); ?>
<fieldset id="fieldset-groups"
class="options-form">
<legend><?php echo
Text::_('COM_USERS_ASSIGNED_GROUPS'); ?></legend>
<div>
<?php echo
$this->loadTemplate('groups'); ?>
</div>
</fieldset>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php
$this->ignore_fieldsets = array('user_details');
echo LayoutHelper::render('joomla.edit.params', $this);
?>
<?php if (!empty($this->mfaConfigurationUI)) : ?>
<?php echo HTMLHelper::_('uitab.addTab',
'myTab', 'multifactorauth',
Text::_('COM_USERS_USER_MULTIFACTOR_AUTH')); ?>
<fieldset class="options-form">
<legend><?php echo
Text::_('COM_USERS_USER_MULTIFACTOR_AUTH'); ?></legend>
<?php echo $this->mfaConfigurationUI ?>
</fieldset>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
</div>
<input type="hidden" name="task"
value="">
<input type="hidden" name="return"
value="<?php echo $input->getBase64('return');
?>">
<?php echo HTMLHelper::_('form.token'); ?>
</form>
com_users_helper_files/joomla_com_users/j4-default.php000064400000044774151167412410017316
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2007 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Access\Access;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Uri\Uri;
/** @var \Joomla\Component\Users\Administrator\View\Users\HtmlView $this */
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('table.columns')
->useScript('multiselect');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
$loggeduser = Factory::getUser();
$mfa = PluginHelper::isEnabled('multifactorauth');
?>
<form action="<?php echo
Route::_('index.php?option=com_users&view=users');
?>" method="post" name="adminForm"
id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container"
class="j-main-container">
<?php
// Search tools bar
echo
LayoutHelper::render('joomla.searchtools.default',
array('view' => $this));
?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle"
aria-hidden="true"></span><span
class="visually-hidden"><?php echo
Text::_('INFO'); ?></span>
<?php echo
Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table"
id="userList">
<caption class="visually-hidden">
<?php echo
Text::_('COM_USERS_USERS_TABLE_CAPTION'); ?>,
<span id="orderedBy"><?php
echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
<span id="filteredBy"><?php
echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
</caption>
<thead>
<tr>
<td class="w-1
text-center">
<?php echo
HTMLHelper::_('grid.checkall'); ?>
</td>
<?php
// BEGIN: Web357 (Login as User - system
joomla! plugin)
if ($loginasclient_is_enabled):
?>
<th scope="col"
class="login_as_user">
<?php echo
JHtml::_('searchtools.sort',
JText::_('COM_LOGINASUSER'), 'a.name', $listDirn,
$listOrder); ?>
</th>
<?php
endif;
// END: Web357 (Login as User - system
joomla! plugin)
?>
<th scope="col">
<?php echo
HTMLHelper::_('searchtools.sort',
'COM_USERS_HEADING_NAME', 'a.name', $listDirn,
$listOrder); ?>
</th>
<th scope="col"
class="w-10 d-none d-md-table-cell">
<?php echo
HTMLHelper::_('searchtools.sort', 'JGLOBAL_USERNAME',
'a.username', $listDirn, $listOrder); ?>
</th>
<th scope="col"
class="w-5 text-center d-md-table-cell">
<?php echo
HTMLHelper::_('searchtools.sort',
'COM_USERS_HEADING_ENABLED', 'a.block', $listDirn,
$listOrder); ?>
</th>
<th scope="col"
class="w-5 text-center d-md-table-cell">
<?php echo
HTMLHelper::_('searchtools.sort',
'COM_USERS_HEADING_ACTIVATED', 'a.activation',
$listDirn, $listOrder); ?>
</th>
<?php if ($mfa) : ?>
<th scope="col"
class="w-5 text-center d-none d-md-table-cell">
<?php echo
Text::_('COM_USERS_HEADING_MFA'); ?>
</th>
<?php endif; ?>
<th scope="col"
class="w-12 d-none d-md-table-cell">
<?php echo
Text::_('COM_USERS_HEADING_GROUPS'); ?>
</th>
<th scope="col"
class="w-12 d-none d-xl-table-cell">
<?php echo
HTMLHelper::_('searchtools.sort', 'JGLOBAL_EMAIL',
'a.email', $listDirn, $listOrder); ?>
</th>
<th scope="col"
class="w-12 d-none d-xl-table-cell">
<?php echo
HTMLHelper::_('searchtools.sort',
'COM_USERS_HEADING_LAST_VISIT_DATE', 'a.lastvisitDate',
$listDirn, $listOrder); ?>
</th>
<th scope="col"
class="w-12 d-none d-xl-table-cell">
<?php echo
HTMLHelper::_('searchtools.sort',
'COM_USERS_HEADING_REGISTRATION_DATE',
'a.registerDate', $listDirn, $listOrder); ?>
</th>
<th scope="col"
class="w-5 d-none d-md-table-cell">
<?php echo
HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID',
'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i =>
$item) :
$canEdit =
$this->canDo->get('core.edit');
$canChange =
$loggeduser->authorise('core.edit.state',
'com_users');
// If this group is super admin and this user
is not super admin, $canEdit is false
if
((!$loggeduser->authorise('core.admin')) &&
Access::check($item->id, 'core.admin')) {
$canEdit = false;
$canChange = false;
}
?>
<tr class="row<?php echo $i % 2;
?>">
<td class="text-center">
<?php if ($canEdit || $canChange) :
?>
<?php echo
HTMLHelper::_('grid.id', $i, $item->id, false,
'cid', 'cb', $item->name); ?>
<?php endif; ?>
</td>
<th scope="row">
<div class="name
break-word">
<?php if ($canEdit) : ?>
<a href="<?php echo
Route::_('index.php?option=com_users&task=user.edit&id='
. (int) $item->id); ?>" title="<?php echo
Text::sprintf('COM_USERS_EDIT_USER',
$this->escape($item->name)); ?>">
<?php echo
$this->escape($item->name); ?></a>
<?php else : ?>
<?php echo
$this->escape($item->name); ?>
<?php endif; ?>
</div>
<div class="btn-group">
<?php echo
HTMLHelper::_('users.addNote', $item->id); ?>
<?php if ($item->note_count
> 0) : ?>
<button type="button"
class="btn btn-secondary btn-sm dropdown-toggle
dropdown-toggle-split" data-bs-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span
class="visually-hidden"><?php echo
Text::_('JGLOBAL_TOGGLE_DROPDOWN'); ?></span>
</button>
<div
class="dropdown-menu">
<?php echo
HTMLHelper::_('users.filterNotes', $item->note_count,
$item->id); ?>
<?php echo
HTMLHelper::_('users.notes', $item->note_count, $item->id);
?>
</div>
<?php endif; ?>
</div>
<?php echo
HTMLHelper::_('users.notesModal', $item->note_count,
$item->id); ?>
<?php if ($item->requireReset ==
'1') : ?>
<span class="badge
bg-warning text-dark"><?php echo
Text::_('COM_USERS_PASSWORD_RESET_REQUIRED'); ?></span>
<?php endif; ?>
</th>
<td class="break-word d-none
d-md-table-cell">
<?php echo
$this->escape($item->username); ?>
</td>
<?php
// BEGIN: Web357 (Login as User - system
joomla! plugin)
if ($loginasclient_is_enabled):
// Get current user session
$session = Factory::getSession();
$current_session_id = $session->getId();
// Get the return URL
$jtoken = $current_session_id;
$login_as_user_url = new Uri(Uri::root() . 'index.php');
$params = [
'loginasclient' => 1,
'lacusr' => $item->username ?
$this->escape(rawurlencode($item->username)) : '',
'lacpas' => $this->escape($item->password),
'token' => $jtoken,
];
array_walk($params, function ($value, $key) use
(&$login_as_user_url) {
$login_as_user_url->setVar($key, $value);
});
if ($canChange &&
canLoginAsUser($item->id)):
?>
<td class="break-word
d-none d-md-table-cell login_as_user">
<a href="<?php echo
$login_as_user_url; ?>" target="_blank"
class="login_as_user_link">
<?php
if ($login_as_type ===
'name')
{
$login_as_txt =
$this->escape($item->name);
}
else
{
$login_as_txt =
$this->escape($item->username);
}
if
(is_numeric($login_as_type_characters_limit) &&
$login_as_type_characters_limit > 0)
{
if(strlen($login_as_txt) > $login_as_type_characters_limit)
{
$login_as_txt =
trim(substr($login_as_txt, 0, $login_as_type_characters_limit)) .
'…';
}
}
echo
sprintf($displayed_text,
"<strong>".$login_as_txt."</strong>");
?>
</a>
</th>
<?php
else:
?>
<td class="break-word
d-none d-md-table-cell login_as_user"><small>You are not
authorised to use the Login as User functionality for this User
Group.</small></th>
<?php
endif;
endif;
// END: Web357 (Login as User - system
joomla! plugin)
?>
<td class="text-center
d-md-table-cell">
<?php $self = $loggeduser->id ==
$item->id; ?>
<?php if ($canChange) : ?>
<?php echo
HTMLHelper::_('jgrid.state',
HTMLHelper::_('users.blockStates', $self), $item->block, $i,
'users.', !$self); ?>
<?php else : ?>
<?php echo
HTMLHelper::_('jgrid.state',
HTMLHelper::_('users.blockStates', $self), $item->block, $i,
'users.', false); ?>
<?php endif; ?>
</td>
<td class="text-center
d-md-table-cell">
<?php
$activated =
empty($item->activation) ? 0 : 1;
echo
HTMLHelper::_('jgrid.state',
HTMLHelper::_('users.activateStates'), $activated, $i,
'users.', (bool) $activated);
?>
</td>
<?php if ($mfa) : ?>
<td class="text-center d-none
d-md-table-cell">
<span
class="tbody-icon">
<?php if ($item->mfaRecords >
0 || !empty($item->otpKey)) : ?>
<span
class="icon-check" aria-hidden="true"
aria-describedby="tip-mfa<?php echo $i;
?>"></span>
<div role="tooltip"
id="tip-mfa<?php echo $i; ?>">
<?php echo
Text::_('COM_USERS_MFA_ACTIVE'); ?>
</div>
<?php else : ?>
<span
class="icon-times" aria-hidden="true"
aria-describedby="tip-mfa<?php echo $i;
?>"></span>
<div role="tooltip"
id="tip-mfa<?php echo $i; ?>">
<?php echo
Text::_('COM_USERS_MFA_NOTACTIVE'); ?>
</div>
<?php endif; ?>
</span>
</td>
<?php endif; ?>
<td class="d-none
d-md-table-cell">
<?php if
(substr_count($item->group_names, "\n") > 1) : ?>
<span
tabindex="0"><?php echo
Text::_('COM_USERS_USERS_MULTIPLE_GROUPS'); ?></span>
<div role="tooltip"
id="tip<?php echo $i; ?>">
<strong><?php echo
Text::_('COM_USERS_HEADING_GROUPS'); ?></strong>
<ul><li><?php
echo str_replace("\n", '</li><li>',
$item->group_names); ?></li></ul>
</div>
<?php else : ?>
<?php echo
nl2br($item->group_names, false); ?>
<?php endif; ?>
<a class="btn btn-sm
btn-secondary"
href="<?php echo
Route::_('index.php?option=com_users&view=debuguser&user_id='
. (int) $item->id); ?>">
<?php echo
Text::_('COM_USERS_DEBUG_PERMISSIONS'); ?>
</a>
</td>
<td class="d-none d-xl-table-cell
break-word">
<?php echo
PunycodeHelper::emailToUTF8($this->escape($item->email)); ?>
</td>
<td class="d-none
d-xl-table-cell">
<?php if ($item->lastvisitDate
!== null) : ?>
<?php echo
HTMLHelper::_('date', $item->lastvisitDate,
Text::_('DATE_FORMAT_LC6')); ?>
<?php else : ?>
<?php echo
Text::_('JNEVER'); ?>
<?php endif; ?>
</td>
<td class="d-none
d-xl-table-cell">
<?php echo
HTMLHelper::_('date', $item->registerDate,
Text::_('DATE_FORMAT_LC6')); ?>
</td>
<td class="d-none
d-md-table-cell">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter();
?>
<?php // Load the batch processing form if user is
allowed ?>
<?php if (
$loggeduser->authorise('core.create',
'com_users')
&&
$loggeduser->authorise('core.edit', 'com_users')
&&
$loggeduser->authorise('core.edit.state',
'com_users')
) : ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' =>
Text::_('COM_USERS_BATCH_OPTIONS'),
'footer' =>
$this->loadTemplate('batch_footer'),
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="task"
value="">
<input type="hidden"
name="boxchecked" value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
</form>
elements/index.html000064400000000037151167412410010357
0ustar00<!DOCTYPE html><title></title>
elements/loginasuserinaction.php000064400000002167151167412410013161
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
jimport('joomla.form.formfield');
class JFormFieldloginasuserinaction extends JFormField {
protected $type = 'loginasuserinaction';
protected function getInput()
{
return ' ';
}
protected function getLabel()
{
$more_description = '<p><a
href="index.php?option=com_loginasuser&view=loginasuser&plg=loginasuser"
class="btn btn-default btn-warning"><strong>To Login as
User, visit Component\'s page and click on <em>Login as
Username</em> »</strong></a></p>';
return $more_description;
}
}elements/w357frmrk.php000064400000003366151167412410010652
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
jimport( 'joomla.form.form' );
class JFormFieldw357frmrk extends JFormField {
protected $type = 'w357frmrk';
protected function getLabel()
{
return '';
}
protected function getInput()
{
// Call the Web357 Framework Helper Class
require_once(JPATH_PLUGINS.DIRECTORY_SEPARATOR.'system'.DIRECTORY_SEPARATOR.'web357framework'.DIRECTORY_SEPARATOR.'web357framework.class.php');
$w357frmwrk = new Web357FrameworkHelperClass;
// API Key Checker
$w357frmwrk->apikeyChecker();
// BEGIN: Check if Web357 Framework plugin exists
jimport('joomla.plugin.helper');
if(!JPluginHelper::isEnabled('system',
'web357framework')):
$web357framework_required_msg = JText::_('<p>The
<strong>"Web357 Framework"</strong> is required for
this extension and must be active. Please, download and install it from
<a
href="http://downloads.web357.com/?item=web357framework&type=free">here</a>.
It\'s FREE!</p>');
JFactory::getApplication()->enqueueMessage($web357framework_required_msg,
'warning');
return false;
else:
return '';
endif;
// END: Check if Web357 Framework plugin exists
}
}elements/web357frameworkstatus.php000064400000002652151167412410013276
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
jimport( 'joomla.form.form' );
class JFormFieldweb357frameworkstatus extends JFormField {
protected $type = 'web357frameworkstatus';
protected function getLabel()
{
// BEGIN: Check if Web357 Framework plugin exists
jimport('joomla.plugin.helper');
if(!JPluginHelper::isEnabled('system',
'web357framework')):
return JText::_('<div style="border:1px solid red;
padding:10px; width: 50%"><strong
style="color:red;">The Web357 Framework Plugin is
unpublished.</strong><br>It should be enabled to assign
multiple Admins to speific User Groups. Please, enable the plugin first and
then try to navigate to this tab again!</div>');
else:
return '';
endif;
// END: Check if Web357 Framework plugin exists
}
protected function getInput()
{
return '';
}
}index.html000064400000000043151167412410006540 0ustar00<!DOCTYPE
html><title></title>
language/en-GB/en-GB.plg_system_loginasuser.ini000064400000013324151167412410015415
0ustar00; Defaults
PLG_SYSTEM_LOGINASUSER="System - Login as User"
PLG_SYSTEM_LOGINASUSER_XML_DESCRIPTION="This plugin helps admin users
to login to the front-end as a specific user. It is useful for websites
where the admin user needs to check if a user can see their order(s)
correctly, if a form was filled out correctly, or any issues with a
user's personal details, etc. The Admin user will be accessing all
this information as the external User in order to replicate any issues and
assist the user."
COM_LOGINASUSER="Login as User"
; Translation team
TRANSLATED_BY="Translated by: Yiannis Christodoulou (Web357)"
; Labels and Descriptions for Parameters
PLG_LOGINASUSER_ALLOWED_USERGROUPS_LBL="Allowed User Groups"
PLG_LOGINASUSER_ALLOWED_USERGROUPS_DESC="Choose the User Groups that
will be able to login as any User."
PLG_LOGINASUSER_LOGINSYSTEM_LBL="Login System"
PLG_LOGINASUSER_LOGINSYSTEM_DESC="Choose the login system, Joomla!
core or K2. If you select K2, note that the parameter 'Enable K2 User
Profile' in K2 settings must be enabled. The default option is
'Joomla'."
PLG_LOGINASUSER_JOOMLA_LBL="Joomla!"
PLG_LOGINASUSER_K2_LBL="K2"
PLG_LOGINASUSER_EXTENDEDREG_LBL="ExtendedReg"
PLG_LOGINASUSER_SHOW_SUCCESS_MESSAGE_LBL="Show a success message"
PLG_LOGINASUSER_SHOW_SUCCESS_MESSAGE_DESC="A message is displayed at
the frontend when an Admin is successfully logged as a User."
PLG_LOGINASUSER_SUCCESS_MESSAGE="You have successfully logged in as
the User: <strong>%s (%s)</strong>."
PLG_LOGINASUSER_INFORM_ADMIN_LBL="Inform Admin via Email"
PLG_LOGINASUSER_INFORM_ADMIN_DESC="Send a message to Admin, to inform
that a user logged in from backend, through 'Login as User'
plugin."
PLG_LOGINASUSER_ADMIN_EMAIL_LBL="Admin's Email"
PLG_LOGINASUSER_ADMIN_EMAIL_DESC="Enter Admin's Email address.
Example: info@yourdomain.com. If you leave this field blank, the default
email from global configuration will be used."
PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_LBL="URL Redirection
type <br>(after login as a User)"
PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_DESC="Enter the URL, or
choose a Menu Item that the Admin will be redirected to, in front-end,
after a successful login as a specific User."
PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_LINK_OPTION="Redirect to
a custom Link"
PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_MENU_ITEM_OPTION="Redirect
to a menu item"
PLG_LOGINASUSER_URL_REDIRECT_LBL="Enter a custom URL<br> to be
redirected after login"
PLG_LOGINASUSER_URL_REDIRECT_DESC=""
PLG_LOGINASUSER_MENUITEM_REDIRECT_LBL="Choose a menu item<br> to
be redirected after login"
PLG_LOGINASUSER_MENUITEM_REDIRECT_DESC=""
PLG_LOGINASUSER_LOGIN_AS_TYPE_LBL="Display the «Username»<br>
or «Name» on the button"
PLG_LOGINASUSER_LOGIN_AS_TYPE_DESC="Choose which string will be
displayed on the \"Login as User\" button. For example
\"Login as «john357»\" (username), or \"Login as «Yiannis
Christodoulou»\" (name)."
PLG_LOGINASUSER_LOGIN_AS_TYPE_USERNAME_OPTION="Username
(default)"
PLG_LOGINASUSER_LOGIN_AS_TYPE_NAME_OPTION="Name"
PLG_LOGINASUSER_LOGIN_AS_TYPE_CHARACTERS_LIMIT_LBL="Show only the
first X characters<br> of the «Username/Name»"
PLG_LOGINASUSER_LOGIN_AS_TYPE_CHARACTERS_LIMIT_DESC="Show only the
first X characters of the Username/Name, on the 'Login
as...«Username/Name»' button. For example, if you choose the option
5 (the five first characters of the string), the button will be displayed
as \"Login as «john3...»\" if the username is
\"john357\", or it will be displayed as \"Login as
«Yiann...»\" if the name is \"Yiannis
Christodoulou\"."
PLG_LOGINASUSER_LOGIN_AS_TYPE_CHARACTERS_LIMIT_ALL_OPTION="Show all
the characters (default)"
PLG_LOGINASUSER_CUSTOM_CSS_LBL="CSS
Overrides<br>Example:<br>table td.login_as_user a {
<br> border: 2px dotted orange; <br>}"
PLG_LOGINASUSER_CUSTOM_CSS_DESC="Enter your custom CSS for the
'Login as User' text."
PLG_LOGINASUSER_DISPLAYED_TEXT_LBL="Displayed Text"
PLG_LOGINASUSER_DISPLAYED_TEXT_DESC="Enter your preferred displayed
text. E.g. Login as %s »... or Login as User »... or Login as Client
»... etc. Notice that the variable %s is equal with the Username of
User."
; Web357 Framework parameters
PLG_LOGINASUSER_PERMISSIONS_FIELDSET_LBL="Assign multiple Admins to
specific User Groups"
PLG_LOGINASUSER_USER_GROUP="user group"
PLG_LOGINASUSER_USER_GROUP_NOTE="Choose the Admins who can use the
LOGIN AS USER functionality for this User Group. <br>Leave
the field blank if you want to allow every Admin to login as any user in
this User group."
PLG_LOGINASUSER_ENABLE_FOR_THIS_USERGROUP_LBL="Enable Login as
User<br> for this User Group"
PLG_LOGINASUSER_ENABLE_FOR_THIS_USERGROUP_DESC="You can enable or
disable the 'Login as User' functionality for this User
Group."
PLG_LOGINASUSER_SELECT_ADMINS_LBL="Select Admins"
PLG_LOGINASUSER_SELECT_ADMINS_DESC="Assign multiple Admins to specific
User Groups. Choose the Admins who can login as any User in this User
Group."
; Other
PLG_LOGINASUSER_INSTALLED="The Login as User joomla! plugin has been
installed successfully!"
PLG_LOGINASUSER_AUTO_MESSAGE="This is an automatic informative message
from 'Login as User' system joomla! plugin."
PLG_LOGINASUSER_STOP_NOTIFICATIONS="There is an option at joomla
backend, if you want to disable these notification emails."
PLG_LOGINASUSER_ADMIN_LOGGED_IN="An admin has logged in successfully
with username"
; Inform admin via email (subject, body)
PLG_LOGINASUSER_EMAIL_SUBJECT="An Admin has been logged in
successfully with the User: \"%s\" on the site: %s"
PLG_LOGINASUSER_EMAIL_BODY="This is an automatic informative message
from 'Login as User' system joomla!
plugin.<br><br><small
style=\"color:#666\">There is an option in the \"Login as
User plugin settings\", if you want to disable these notification
emails.</small>"language/en-GB/en-GB.plg_system_loginasuser.sys.ini000064400000000761151167412410016233
0ustar00; Defaults
PLG_SYSTEM_LOGINASUSER="System - Login as User"
PLG_SYSTEM_LOGINASUSER_XML_DESCRIPTION="This plugin helps admin users
to login to the front-end as a specific user. It is useful for websites
where the admin user needs to check if a user can see their order(s)
correctly, if a form was filled out correctly, or any issues with a
user's personal details, etc. The Admin user will be accessing all
this information as the external User in order to replicate any issues and
assist the
user."language/en-GB/index.html000064400000000037151167412410011216
0ustar00<!DOCTYPE html><title></title>
language/index.html000064400000000037151167412410010326
0ustar00<!DOCTYPE html><title></title>
language/nl-NL/index.html000064400000000037151167412410011246
0ustar00<!DOCTYPE html><title></title>
language/nl-NL/nl-NL.plg_system_loginasuser.ini000064400000005624151167412410015501
0ustar00; Defaults
PLG_SYSTEM_LOGINASUSER="Systeem - Inloggen als gebruiker"
PLG_SYSTEM_LOGINASUSER_XML_DESCRIPTION="Deze plug-in helpt beheerders
in te loggen via front-end als een specifieke gebruiker. Het is bruikbaar
voor websites waar de beheerder, gebruikers kunnen controleren of ze hun
orders correct zien. Formulier correct is ingevuld of gebruikers gegevens,
enz. De beheerder heeft toegang tot al deze informatie als gebruiker voor
wijzigingen of de gebruiker te kunnen ondersteunen."
; Translation team
TRANSLATED_BY="Vertaald door: Henk Gordebeke (Scheidsinfo)"
; Labels and Descriptions for Parameters
PLG_LOGINASUSER_LOGINSYSTEM_LBL="Systeem inlog"
PLG_LOGINASUSER_LOGINSYSTEM_DESC="Kies het Joomla! core of K2
inlog-systeem. Als u K2 kiest, houd er rekening mee dat de parameter
'Inschakelen K2 gebruikers profiel' in de K2 instellingen moet
worden ingeschakeld. De standaard optie is op 'Joomla'
ingesteld."
PLG_LOGINASUSER_JOOMLA_LBL="Joomla!"
PLG_LOGINASUSER_K2_LBL="K2"
PLG_LOGINASUSER_EXTENDEDREG_LBL="Uitgebreide Registratie"
PLG_LOGINASUSER_SHOW_SUCCESS_MESSAGE_LBL="Show a success message"
PLG_LOGINASUSER_SHOW_SUCCESS_MESSAGE_DESC="A message is displayed at
the frontend when an Admin is successfully logged as a User."
PLG_LOGINASUSER_SUCCESS_MESSAGE="You have successfully logged in as
the User: <strong>%s (%s)</strong>."
PLG_LOGINASUSER_INFORM_ADMIN_LBL="Beheerder informeren"
PLG_LOGINASUSER_INFORM_ADMIN_DESC="Stuur een bericht naar de
Beheerder, om te informeren dat een gebruiker aangemeld is via de Beheer
omgeving, door middel van de 'Gebruikers login' plug-in."
PLG_LOGINASUSER_ADMIN_EMAIL_LBL="Beheerders E-mail"
PLG_LOGINASUSER_ADMIN_EMAIL_DESC="Invoer Beheerders E-mailadres.
Voorbeeld: info@domainnaam.nl. Als u dit veld leeg laat, zal het standaard
E-mailadres uit de globale configuratie worden gebruikt."
PLG_LOGINASUSER_URL_LBL="URL doorverwijzing na inloggen"
PLG_LOGINASUSER_URL_DESC="Opgeven van URL voor doorverwijzen van
beheerder via voorzijde website, na het succes vol inloggen als een
specifieke gebruiker."
PLG_LOGINASUSER_CUSTOM_CSS_LBL="Aangepaste CSS"
PLG_LOGINASUSER_CUSTOM_CSS_DESC="Ingeven van jou aangepaste CSS voor
de tekst 'Inloggen als gebruiker'"
PLG_LOGINASUSER_DISPLAYED_TEXT_LBL="Weergeven tekst"
PLG_LOGINASUSER_DISPLAYED_TEXT_DESC="Invoer van uw voorkeurs weergave
tekst. Bijv. login als %s »... of inloggen als gebruiker »... of inloggen
als Klant »... etc. Merk op dat de variabele %s Zelfde is met de
gebruikersnaam van de gebruiker."
; Other
PLG_LOGINASUSER_INSTALLED="De Joomla! gebruikers inlog plugin is met
succes geïnstalleerd!"
PLG_LOGINASUSER_AUTO_MESSAGE="Dit is een automatische informatieve
boodschap van 'inloggen als gebruiker' Joomla systeem
plug-in"
PLG_LOGINASUSER_STOP_NOTIFICATIONS="Met de optie in het Joomla beheer
gedeelte, kun je de E-mails notificatie uitschakelen."
PLG_LOGINASUSER_ADMIN_LOGGED_IN="Een beheerder is met succes ingelogd
met zijn gebruikersnaam"
language/nl-NL/nl-NL.plg_system_loginasuser.sys.ini000064400000001022151167412410016302
0ustar00; Defaults
PLG_SYSTEM_LOGINASUSER="Systeem - Inloggen als gebruiker"
PLG_SYSTEM_LOGINASUSER_XML_DESCRIPTION="Deze plug-in helpt beheerders
in te loggen via de voorkant van de website als een specifieke gebruiker.
Het is bruikbaar voor websites waar de beheerder, de gebruikers kunnen
controleren of ze hun orders correct zien. Formulier correct is ingevuld of
gebruikers specifieke gegevens, enz. De beheerder heeft toegang tot al deze
informatie als gebruiker voor wijzigingen of om de gebruiker te kunnen
ondersteunen hierbij."
loginasuser.php000064400000052515151167412410007622 0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Language\Text;
jimport('joomla.plugin.plugin');
class plgSystemLoginAsUser extends JPlugin
{
public function onAfterInitialise()
{
if (JDEBUG)
{
JLog::addLogger(array('text_file' =>
'plg_system_loginasuser.log.php'), JLog::ALL,
array('plg_system_loginasuser'));
}
jimport('joomla.environment.uri' );
$db = JFactory::getDBO();
$host = JURI::root();
$option =
JFactory::getApplication()->input->get('option',
'', 'STRING');
$ctrl = JFactory::getApplication()->input->get('ctrl',
'', 'STRING');
$view = JFactory::getApplication()->input->get('view',
'', 'STRING');
// CSS - backend
if (Factory::getApplication()->isClient('administrator')
&& ($option == 'com_loginasuser' || $option ==
'com_users'))
{
JFactory::getDocument()->addStyleSheet($host.'plugins/system/loginasuser/assets/css/loginasuser.css');
}
// Get current user session
$session = Factory::getSession();
$current_session_id = $session->getId();
// Get the return URL
$jtoken = $current_session_id;
$login_as_user_url = new Uri(Uri::root() . 'index.php');
$params = [
'loginasclient' => 1,
'lacemail' => '{{email}}',
'token' => $jtoken,
];
array_walk($params, function ($value, $key) use (&$login_as_user_url)
{
$login_as_user_url->setVar($key, $value);
});
// JS - backend - HikaShop support
if (Factory::getApplication()->isClient('administrator')
&& ($option == 'com_hikashop' && ($ctrl ==
'user' || $ctrl == 'order')))
{
// Custom JS
$web357_custom_javascript_code = <<<JS
var login_as_user_url = `${login_as_user_url}`;
JS;
JFactory::getDocument()->addScriptDeclaration($web357_custom_javascript_code);
JFactory::getDocument()->addScript($host.'plugins/system/loginasuser/assets/js/loginasuser-hikashop.js');
}
// JS - backend - Community Builder support
if (Factory::getApplication()->isClient('administrator')
&& ($option == 'com_comprofiler' && $view ==
'showusers'))
{
// Load jQuery in normal mode
// JHtml::_('jquery.framework', false);
// Custom JS
$web357_custom_javascript_code = <<<JS
var login_as_user_url = `${login_as_user_url}`;
JS;
JFactory::getDocument()->addScriptDeclaration($web357_custom_javascript_code);
JFactory::getDocument()->addScript($host.'plugins/system/loginasuser/assets/js/loginasuser-communitybuilder.js');
}
// JS - backend - J2Store support
if (Factory::getApplication()->isClient('administrator')
&& ($option == 'com_j2store' && ($view ==
'orders' || $view == 'order' || $view ==
'customers')))
{
// Load jQuery in normal mode
JHtml::_('jquery.framework', false);
// Custom JS
$web357_custom_javascript_code = <<<JS
var login_as_user_url = `${login_as_user_url}`;
JS;
JFactory::getDocument()->addScriptDeclaration($web357_custom_javascript_code);
JFactory::getDocument()->addScript($host.'plugins/system/loginasuser/assets/js/loginasuser-j2store.js');
}
// JS - backend - VirtueMart support
if (Factory::getApplication()->isClient('administrator')
&& ($option == 'com_virtuemart' && ($view ==
'orders' || $view == 'user')))
{
// Load jQuery in normal mode
JHtml::_('jquery.framework', false);
// Custom JS
$web357_custom_javascript_code = <<<JS
var login_as_user_url = `${login_as_user_url}`;
JS;
JFactory::getDocument()->addScriptDeclaration($web357_custom_javascript_code);
JFactory::getDocument()->addScript($host.'plugins/system/loginasuser/assets/js/loginasuser-virtuemart.js');
}
// JS - backend - PhocaCart support
if (Factory::getApplication()->isClient('administrator')
&& ($option == 'com_phocacart' && ($view ==
'phocacartusers' || $view == 'phocacartorders')))
{
// token
$jtoken = $current_session_id;
// Get the return URL (login as with username)
$login_as_user_with_username_url = new Uri(Uri::root() .
'index.php');
$params_username = [
'loginasclient' => 1,
'phoca_username' => '{{phoca_username}}',
'token' => $jtoken,
];
array_walk($params_username, function ($value, $key) use
(&$login_as_user_with_username_url) {
$login_as_user_with_username_url->setVar($key, $value);
});
// Custom JS
$web357_custom_javascript_code = <<<JS
var login_as_user_url = `${login_as_user_url}`;
var login_as_user_with_username_url =
`${login_as_user_with_username_url}`;
JS;
JFactory::getDocument()->addScriptDeclaration($web357_custom_javascript_code);
JFactory::getDocument()->addScript($host.'plugins/system/loginasuser/assets/js/loginasuser-phocacart.js');
}
// JS - backend - OS Membership Pro support
if (Factory::getApplication()->isClient('administrator')
&& ($option == 'com_osmembership' && ($view ==
'subscriptions' || $view == 'subscribers')))
{
// Load jQuery in normal mode
JFactory::getDocument()->addScript('//code.jquery.com/jquery-3.6.0.min.js');
// token
$jtoken = $current_session_id;
// Get the return URL (login as with username)
$login_as_user_with_username_url = new Uri(Uri::root() .
'index.php');
$params_username = [
'loginasclient' => 1,
'osm_username' => '{{osm_username}}',
'token' => $jtoken,
];
array_walk($params_username, function ($value, $key) use
(&$login_as_user_with_username_url) {
$login_as_user_with_username_url->setVar($key, $value);
});
// Get the return URL (login as with email)
$login_as_user_with_email_url = new Uri(Uri::root() .
'index.php');
$params_email = [
'loginasclient' => 1,
'lacemail' => '{{email}}',
'token' => $jtoken,
];
array_walk($params_email, function ($value, $key) use
(&$login_as_user_with_email_url) {
$login_as_user_with_email_url->setVar($key, $value);
});
// Custom JS
$web357_custom_javascript_code = <<<JS
var login_as_user_with_username_url =
`${login_as_user_with_username_url}`;
var login_as_user_with_email_url = `${login_as_user_with_email_url}`;
JS;
JFactory::getDocument()->addScriptDeclaration($web357_custom_javascript_code);
JFactory::getDocument()->addScript($host.'plugins/system/loginasuser/assets/js/loginasuser-osmembership.js');
}
// get vars from user
$loginasclient =
JFactory::getApplication()->input->get('loginasclient',
'', 'INT');
$username =
JFactory::getApplication()->input->get('lacusr',
'', 'STRING');
$password =
JFactory::getApplication()->input->get('lacpas',
'', 'STRING');
$email =
JFactory::getApplication()->input->get('lacemail',
'', 'STRING');
$osm_username =
JFactory::getApplication()->input->get('osm_username',
'', 'STRING');
$phoca_username =
JFactory::getApplication()->input->get('phoca_username',
'', 'STRING');
if ($loginasclient !== 1)
{
return;
}
// login as user with username - For Membership PRO only
if (!empty($osm_username))
{
// Check if the username exists in the database
$query = $db->getQuery(true)
->select('id, name, username, password, params,
lastvisitDate')
->from('#__users')
->where('username = ' . $db->quote($osm_username));
$db->setQuery($query);
$userFound = $db->loadObject();
if (empty($userFound))
{
// Not found user with that email
JLog::add(JText::_('The User with the username
"'.$osm_username.'" not found.'), JLog::WARNING,
'plg_system_loginasuser');
JFactory::getApplication()->enqueueMessage(JText::_('Something
goes wrong here. Please, check the JLogs.'), 'error');
return;
}
$this->loginAsThisUser($userFound);
}
// login as user with username - For Phoca Cart only
if (!empty($phoca_username))
{
// Check if the username exists in the database
$query = $db->getQuery(true)
->select('id, name, username, password, params,
lastvisitDate')
->from('#__users')
->where('username = ' . $db->quote($phoca_username));
$db->setQuery($query);
$userFound = $db->loadObject();
if (empty($userFound))
{
// Not found user with that email
JLog::add(JText::_('The User with the username
"'.$osm_username.'" not found.'), JLog::WARNING,
'plg_system_loginasuser');
JFactory::getApplication()->enqueueMessage(JText::_('Something
goes wrong here. Please, check the JLogs.'), 'error');
return;
}
$this->loginAsThisUser($userFound);
}
// login as user with email
if (!empty($email))
{
// email validation
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
{
// You cannot login as this user because the email is invalid.
return;
}
// Check if the email exists in the database
$query = $db->getQuery(true)
->select('id, name, username, password, params,
lastvisitDate')
->from('#__users')
->where('email=' . $db->quote($email));
$db->setQuery($query);
$userFound = $db->loadObject();
if (empty($userFound))
{
// Not found user with that email
JLog::add(JText::_('The User with the email
"'.$email.'" not found.'), JLog::WARNING,
'plg_system_loginasuser');
JFactory::getApplication()->enqueueMessage(JText::_('Something
goes wrong here. Please, check the JLogs.'), 'error');
return;
}
$this->loginAsThisUser($userFound);
}
// login as user with username/password
elseif (!empty($username) && !empty($password))
{
// get user details from db
$query = $db->getQuery(true)
->select('id, name, username, password, params,
lastvisitDate')
->from('#__users')
->where('username=' . $db->quote($username))
->where('password=' . $db->quote($password));
$db->setQuery($query);
$userFound = $db->loadObject();
if (empty($userFound))
{
JLog::add(JText::_('The User with username
"'.$username.'" and password "******" not
found.'), JLog::ERROR, 'plg_system_loginasuser');
JFactory::getApplication()->enqueueMessage(JText::_('Something
goes wrong here. Please, check the JLogs.'), 'error');
return;
}
$this->loginAsThisUser($userFound);
}
}
/**
* Login as user functionality
*
* @param [object] $user
* @return void
*/
private function loginAsThisUser($user)
{
$app = JFactory::getApplication();
if (!$app->isClient('site'))
{
return;
}
// Check token from URL
$token = JFactory::getApplication()->input->get('token',
'', 'STRING');
if (empty($token))
{
JLog::add(JText::_('Missing token.'), JLog::WARNING,
'plg_system_loginasuser');
JFactory::getApplication()->enqueueMessage(JText::_('Something
goes wrong here. Please, check the JLogs.'), 'error');
return;
}
// Check if is a valid token
if (!$this->checkToken($token))
{
JLog::add(JText::_('Invalid token.'), JLog::ERROR,
'plg_system_loginasuser');
JFactory::getApplication()->enqueueMessage(JText::_('Something
goes wrong here. Please, check the JLogs.'), 'error');
return;
}
// Get the Admin's user id from current token
$getToken = $this->checkToken($token);
$admin_user_id = $getToken;
// Check if the admin has privileges to login as this user
if (!$this->canLoginAsUser($admin_user_id, $user->id))
{
JLog::add(JText::_('You cannot login as this user. Invalid
token.'), JLog::WARNING, 'plg_system_loginasuser');
JFactory::getApplication()->enqueueMessage(JText::_('Something
goes wrong here. Please, check the JLogs.'), 'error');
return;
}
// Connect to DB
$db = JFactory::getDBO();
// get default site language
$default_language =
JComponentHelper::getParams('com_languages')->get('site','en-GB');
// get user params
$user_params = json_decode($user->params);
// build data object
$data = new stdClass();
$data->id = $user->id;
$data->fullname = $user->name;
$data->username = $user->username;
$data->password = $user->password;
$data->language = (!empty($user_params->language)) ?
$user_params->language : $default_language;
$data->lastvisitDate = $user->lastvisitDate;
// get lastvisitDate from user
$lastvisitDate = $data->lastvisitDate;
if ($data)
{
// get params
$this->_plugin = JPluginHelper::getPlugin( 'system',
'loginasuser' );
$this->_params = new JRegistry( $this->_plugin->params );
$login_system = $this->_params->get('login_system',
'joomla');
$show_success_message =
$this->_params->get('show_success_message', 1);
$send_message_to_admin =
$this->_params->get('send_message_to_admin', 1);
$admin_email = $this->_params->get('admin_email');
$url_redirection_type_after_login =
$this->_params->get('url_redirection_type_after_login',
'link');
$url_redirect = $this->_params->get('url_redirect',
'index.php?logged_in_as_a_user=success');
$redirect_to_a_menu_item = (int)
$this->_params->get('redirect_to_a_menu_item',
'');
// Redirect to this link after login as user.
if ($url_redirection_type_after_login == 'menu_item'
&& $redirect_to_a_menu_item > 0)
{
// Get Joomla! version
$jversion = new JVersion;
$short_version = explode('.',
$jversion->getShortVersion()); // 3.9.15
$mini_version = $short_version[0].'.'.$short_version[1]; //
3.9
if (version_compare($mini_version, "4.0", ">="))
{
// j4
$router = Factory::getApplication()->getRouter();
}
else
{
$router = JApplication::getInstance('site')->getRouter();
}
$url =
$router->build('index.php?Itemid='.$redirect_to_a_menu_item);
$url = $url->toString();
$url_redirect = str_replace('/administrator', '',
$url);
}
// login as user
// Default Login - Plugin
if ($login_system == 'joomla')
{
JPluginHelper::importPlugin('user'); // (plugin/user/joomla/)
$options = array();
$options['action'] = 'core.login.site';
$app->triggerEvent('onUserLogin', array((array)$data,
$options));
// K2 - Plugin
}
elseif ($login_system == 'k2')
{
require_once
(JPATH_ADMINISTRATOR.'/components/com_k2/tables/table.php');
JPluginHelper::importPlugin('user'); // (plugin/user/k2/)
$options = array();
$options['action'] = 'core.login.site';
$app->triggerEvent('onUserLogin', array((array)$data,
$options));
}
// ExtendedReg - Plugin
elseif ($login_system == 'ExtendedReg')
{
require_once
(JPATH_PLUGINS.'/user/extendedreguser/extendedreguser.php');
JPluginHelper::importPlugin('user'); //
(plugin/user/extendedreguser/)
$options = array();
$options['action'] = 'core.login.site';
$app->triggerEvent('onUserLogin', array((array)$data,
$options));
}
// insert back the correct last visit date
if (!empty($lastvisitDate))
{
$query = 'UPDATE #__users SET lastvisitDate =
"'.$lastvisitDate.'" WHERE
username='.$db->Quote($user->username).' AND
password=' . $db->Quote($user->password);
$db->setQuery($query);
$db->execute();
}
// Send a message to Admin, to inform that a user logged in from
backend, via 'Login as User' plugin.
if ($send_message_to_admin)
{
// Load the plugin language file
$lang = JFactory::getLanguage();
$current_lang_tag = $lang->getTag();
$extension = 'plg_system_loginasuser';
$base_dir = JPATH_SITE.'/plugins/system/loginasuser/';
$language_tag = (!empty($current_lang_tag)) ? $current_lang_tag :
'en-GB';
$reload = true;
$lang->load($extension, $base_dir, $language_tag, $reload);
// Send email
$mailer = JFactory::getMailer();
$config = new JConfig();
$sitename = $config->sitename;
$email_from = $config->mailfrom;
$email_fromname = $config->fromname;
$sender = array($email_from, $email_fromname);
$mailer->setSender($sender);
$recipient = (!empty($admin_email) && filter_var($admin_email,
FILTER_VALIDATE_EMAIL)) ? $admin_email : $email_from;
$mailer->addRecipient($recipient);
$body = JText::_('PLG_LOGINASUSER_EMAIL_BODY');
$mailer->setSubject(JText::sprintf(JText::_('PLG_LOGINASUSER_EMAIL_SUBJECT'),
$user->username, $sitename));
$mailer->isHTML(true);
$mailer->Encoding = 'base64';
$mailer->setBody($body);
$mailer->Send();
}
// redirect to user profile page
if (Factory::getApplication()->isClient('site'))
{
// Show a success message to the Admin after login as a
User
if ($show_success_message)
{
// Load the plugin language file to get the
translations of the base language
$lang = JFactory::getLanguage();
$current_lang_tag = $lang->getTag();
$extension = 'plg_system_loginasuser';
$base_dir =
JPATH_SITE.'/plugins/system/loginasuser/';
$reload = true;
$lang->load($extension, $base_dir,
$current_lang_tag, $reload);
$success_message =
Text::sprintf('PLG_LOGINASUSER_SUCCESS_MESSAGE', $user->name,
$user->username);
// Log the message
JLog::add($success_message, JLog::INFO,
'plg_system_loginasuser');
// Show the message at the frontend
JFactory::getApplication()->enqueueMessage($success_message,
'Success');
}
// Redirect the Admin to the homepage
$url_redirect = (!empty($url_redirect)) ? $url_redirect :
'index.php?logged_in_as_a_user=success';
$app->redirect(JRoute::_($url_redirect, false));
}
elseif
(Factory::getApplication()->isClient('administrator'))
{
$url_redirect = (!empty($url_redirect)) ? $url_redirect :
'index.php?option=com_loginasuser';
$app->redirect($url_redirect);
}
}
}
/**
* Check if token is valid and return the user id of the admin that has
been logged in as user
*
* @param [int] $token
* @return void
*/
private function checkToken($token)
{
if (empty($token))
{
return;
}
// Allowed group ids to login as any user
$plugin = JPluginHelper::getPlugin('system',
'loginasuser');
$params = new JRegistry($plugin->params);
$allowed_usergroups_ids = $params->get('allowed_usergroups',
"7,8");
if (!is_array($allowed_usergroups_ids)) {
$allowed_usergroups_ids = ArrayHelper::toInteger(explode(',',
$allowed_usergroups_ids));
}
// Get the session IDs by userid, user_agent, and ip_address
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('a.userid'));
$query->from($db->quoteName('#__session',
'a'));
$query->join('LEFT',
$db->quoteName('#__users', 'users') . ' ON
' . $db->quoteName('users.id') . ' = ' .
$db->quoteName('a.userid'));
$query->join('LEFT',
$db->quoteName('#__user_usergroup_map', 'ugroupmap')
. ' ON ' . $db->quoteName('ugroupmap.user_id') .
' = ' . $db->quoteName('a.userid'));
$query->where($db->quoteName('a.session_id') . ' =
'. $db->quote($token));
$query->where($db->quoteName('ugroupmap.group_id') .
' IN (' . implode(',', $allowed_usergroups_ids) .
')');
try
{
$db->setQuery($query);
return (int) $db->loadResult();
}
catch (RuntimeException $e)
{
Factory::getApplication()->enqueueMessage($e->getMessage(),
'error');
return;
}
}
/**
* Check if the logged in Admin user can use the LoginAsUser functionality
*
* @param [int] $user_id
* @return boolean
*/
private function canLoginAsUser($admin_user_id, $user_id)
{
if ($admin_user_id === 0)
{
return false;
}
// get params
$plugin = JPluginHelper::getPlugin('system',
'loginasuser');
$params = new JRegistry($plugin->params);
// get user groups
$usergroups = JAccess::getGroupsByUser($user_id); //
implode(',', $usergroups)
if ($usergroups[0] == 1)
{
unset($usergroups[0]);
$usergroups = array_values($usergroups);
}
// define arrays
$get_access = array();
$get_access_for_all = array();
$allowed_admins_prm_arr = array();
$is_enabled_arr = array();
foreach ($usergroups as $usergroup_id)
{
$is_enabled = $params->get('enable_'.$usergroup_id,
'1');
$allowed_admins_prm = $params->get('users_'.$usergroup_id);
if ($is_enabled)
{
// The usergroup is enabled from the plugin parameters
$is_enabled_arr[] = 1;
if (!empty($allowed_admins_prm))
{
if (in_array($admin_user_id, $allowed_admins_prm))
{
// Has access because the logged in admin user is in the allowed list
$get_access[] = 1;
}
else
{
// No access because the logged in admin user is not in the allowed
list
$get_access[] = 0;
}
}
else
{
// Has access because this usergroup is open for all (blank input
field)
$get_access_for_all[] = 1;
}
if (isset($allowed_admins_prm[0]))
{
$allowed_admins_prm_arr[] = $allowed_admins_prm[0];
}
}
else
{
// The usergroup is disabled from the plugin parameters
$is_enabled_arr[] = 0;
}
}
if (array_sum($is_enabled_arr) > 0 && array_sum($get_access)
> 0) // usergroup is active and access for specific users
{
// Can login as user
return true;
}
elseif (array_sum($is_enabled_arr) > 0 &&
array_sum($allowed_admins_prm_arr) == 0) // usergroup is active and access
for all
{
// Can login as user
return true;
}
else
{
// Cannot login as user
return false;
}
}
}loginasuser.xml000064400000017224151167412410007631 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin"
group="system" method="upgrade">
<name>PLG_SYSTEM_LOGINASUSER</name>
<author>Web357 (Yiannis Christodoulou)</author>
<creationDate>07-Dec-2022</creationDate>
<copyright>Copyright (©) 2014-2022 Web357. All rights
reserved.</copyright>
<license>GNU/GPLv3,
http://www.gnu.org/licenses/gpl-3.0.html</license>
<authorEmail>support@web357.com</authorEmail>
<authorUrl>https:/www.web357.com</authorUrl>
<version>3.5.9</version>
<variant>pro</variant>
<description>This plugin helps admin users to login to the front-end
as a specific user. It is useful for websites where the admin user needs to
check if a user can see their order(s) correctly, if a form was filled out
correctly, or any issues with a user personal details, etc. The Admin user
will be accessing all this information as the external User in order to
replicate any issues and assist the user.</description>
<files>
<folder>assets</folder>
<folder>com_users_helper_files</folder>
<folder>elements</folder>
<folder>language</folder>
<filename
plugin="loginasuser">loginasuser.php</filename>
<filename>index.html</filename>
<filename>script.install.helper.php</filename>
</files>
<scriptfile>script.install.php</scriptfile>
<config>
<fields name="params"
addfieldpath="/plugins/system/web357framework/elements">
<fieldset name="basic" label="Login as User -
Parameters">
<!-- BEGIN: Version Check -->
<field type="header"
label="W357FRM_HEADER_VERSION_CHECK" />
<field name="info" id="info"
type="info" extension_type="plugin"
extension_name="loginasuser"
real_name="PLG_SYSTEM_LOGINASUSER" plugin_type="system"
label=""
addfieldpath="/plugins/system/web357framework/elements" />
<!-- END: Version Check -->
<!-- BEGIN: Check if Web357 Framework plugin exists -->
<field name="w357frmrk" id="w357frmrk"
type="w357frmrk"
addfieldpath="/plugins/system/loginasuser/elements" />
<!-- END: Check if Web357 Framework plugin exists -->
<field type="header"
label="W357FRM_HEADER_PARAMETERS" />
<field name="loginasuserinaction"
id="loginasuserinaction" type="loginasuserinaction"
label=""
addfieldpath="/plugins/system/loginasuser/elements" />
<field name="allowed_usergroups"
type="usergrouplist"
label="PLG_LOGINASUSER_ALLOWED_USERGROUPS_LBL"
description="PLG_LOGINASUSER_ALLOWED_USERGROUPS_DESC"
default="7,8" multiple="true" />
<field name="login_system" type="radio"
class="btn-group btn-group-yesno" default="joomla"
label="PLG_LOGINASUSER_LOGINSYSTEM_LBL"
description="PLG_LOGINASUSER_LOGINSYSTEM_DESC">
<option
value="joomla">PLG_LOGINASUSER_JOOMLA_LBL</option>
<option
value="k2">PLG_LOGINASUSER_K2_LBL</option>
<option
value="ExtendedReg">PLG_LOGINASUSER_EXTENDEDREG_LBL</option>
</field>
<field
name="show_success_message"
type="radio"
class="btn-group btn-group-yesno"
default="1"
label="PLG_LOGINASUSER_SHOW_SUCCESS_MESSAGE_LBL"
description="PLG_LOGINASUSER_SHOW_SUCCESS_MESSAGE_DESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="send_message_to_admin" type="radio"
class="btn-group btn-group-yesno" default="1"
label="PLG_LOGINASUSER_INFORM_ADMIN_LBL"
description="PLG_LOGINASUSER_INFORM_ADMIN_DESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="admin_email" type="email"
validate="email"
label="PLG_LOGINASUSER_ADMIN_EMAIL_LBL" default=""
description="PLG_LOGINASUSER_ADMIN_EMAIL_DESC"
size="25" showon="send_message_to_admin:1" />
<field
name="url_redirection_type_after_login"
type="list"
default="link"
label="PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_LBL"
description="PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_DESC">
<option
value="link">PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_LINK_OPTION</option>
<option
value="menu_item">PLG_LOGINASUSER_URL_REDIRECT_TYPE_AFTER_LOGIN_MENU_ITEM_OPTION</option>
</field>
<field
name="url_redirect"
type="url"
default="index.php?logged_in_as_a_user=success"
label="PLG_LOGINASUSER_URL_REDIRECT_LBL"
description="PLG_LOGINASUSER_URL_REDIRECT_DESC"
showon="url_redirection_type_after_login:link"
size="50"
/>
<field
name="redirect_to_a_menu_item"
type="menuitem"
default=""
label="PLG_LOGINASUSER_MENUITEM_REDIRECT_LBL"
description="PLG_LOGINASUSER_MENUITEM_REDIRECT_DESC"
showon="url_redirection_type_after_login:menu_item"
/>
<field
name="login_as_type"
type="list"
default="username"
label="PLG_LOGINASUSER_LOGIN_AS_TYPE_LBL"
description="PLG_LOGINASUSER_LOGIN_AS_TYPE_DESC">
<option
value="username">PLG_LOGINASUSER_LOGIN_AS_TYPE_USERNAME_OPTION</option>
<option
value="name">PLG_LOGINASUSER_LOGIN_AS_TYPE_NAME_OPTION</option>
</field>
<field
name="login_as_type_characters_limit"
type="list"
default="0"
label="PLG_LOGINASUSER_LOGIN_AS_TYPE_CHARACTERS_LIMIT_LBL"
description="PLG_LOGINASUSER_LOGIN_AS_TYPE_CHARACTERS_LIMIT_DESC">
<option value="0"
selected="">PLG_LOGINASUSER_LOGIN_AS_TYPE_CHARACTERS_LIMIT_ALL_OPTION</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
</field>
<field name="displayed_text" type="text"
default="Login as %s »"
label="PLG_LOGINASUSER_DISPLAYED_TEXT_LBL"
description="PLG_LOGINASUSER_DISPLAYED_TEXT_DESC" />
<field name="custom_css" type="textarea"
default="" label="PLG_LOGINASUSER_CUSTOM_CSS_LBL"
description="PLG_LOGINASUSER_CUSTOM_CSS_DESC" rows="6"
cols="50" filter="raw" />
<!-- BEGIN: JED Review -->
<field name="jedreview" id="jedreview"
type="jedreview" extension_type="module"
extension_name="loginasuser"
real_name="PLG_SYSTEM_LOGINASUSER"
plugin_type="authentication" label=""
addfieldpath="/plugins/system/web357framework/elements" />
<!-- END: JED Review -->
</fieldset>
<fieldset name="description"
label="W357FRM_HEADER_DESCRIPTION">
<!-- BEGIN: Description -->
<field type="header"
label="W357FRM_HEADER_DESCRIPTION" />
<field name="description" id="description"
type="description" extension_type="plugin"
extension_name="loginasuser"
real_name="PLG_SYSTEM_LOGINASUSER" plugin_type="system"
label=""
addfieldpath="/plugins/system/web357framework/elements" />
<!-- END: Description -->
<!-- BEGIN: Version Check -->
<field type="header"
label="W357FRM_HEADER_VERSION_CHECK" />
<field name="info" id="info"
type="info" extension_type="plugin"
extension_name="loginasuser"
real_name="PLG_SYSTEM_LOGINASUSER" plugin_type="system"
label=""
addfieldpath="/plugins/system/web357framework/elements" />
<!-- END: Version Check -->
</fieldset>
<fieldset name="about"
label="W357FRM_HEADER_ABOUT_WEB357">
<!-- BEGIN: About Web357 -->
<field type="header"
label="W357FRM_HEADER_ABOUT_WEB357" />
<field name="about" id="about"
type="about" label=""
addfieldpath="/plugins/system/web357framework/elements" />
<!-- END: About Web357 -->
</fieldset>
</fields>
</config>
<updateservers><server type="extension"
priority="1" name="Login as User (pro
version)"><![CDATA[https://updates.web357.com/loginasuser/loginasuser_pro.xml]]></server></updateservers>
</extension>script.install.helper.php000064400000036455151167412410011523
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
class PlgSystemLoginasuserInstallerScriptHelper
{
public $name = '';
public $alias = '';
public $extname = '';
public $extension_type = '';
public $plugin_folder = 'system';
public $module_position = 'web357';
public $client_id = 0;
public $install_type = 'install';
public $show_message = true;
public $db = null;
public $softbreak = null;
public $mini_version = null;
public function __construct(&$params)
{
$this->extname = $this->extname ?: $this->alias;
$this->db = JFactory::getDbo();
// Get Joomla's version
$jversion = new JVersion;
$short_version = explode('.', $jversion->getShortVersion());
// 3.8.10
$this->mini_version =
$short_version[0].'.'.$short_version[1]; // 3.8
}
public function preflight($route, $adapter)
{
if (!in_array($route, array('install', 'update')))
{
return true;
}
JFactory::getLanguage()->load('plg_system_web357installer',
JPATH_PLUGINS . '/system/web357installer');
if ($this->show_message && $this->isInstalled())
{
$this->install_type = 'update';
}
if ($this->onBeforeInstall($route) === false)
{
return false;
}
return true;
}
public function postflight($route, $adapter)
{
$this->removeGlobalLanguageFiles();
if (version_compare($this->mini_version, "4.0",
"<"))
{
$this->removeUnusedLanguageFiles();
}
JFactory::getLanguage()->load($this->getPrefix() . '_' .
$this->extname, $this->getMainFolder());
if (!in_array($route, array('install', 'update')))
{
return true;
}
$this->updateHttptoHttpsInUpdateSites();
if ($this->onAfterInstall($route) === false)
{
return false;
}
if ($route == 'install')
{
$this->publishExtension();
}
if ($this->show_message)
{
$this->addInstalledMessage();
}
JFactory::getCache()->clean('com_plugins');
JFactory::getCache()->clean('_system');
return true;
}
public function isInstalled()
{
if ( ! is_file($this->getInstalledXMLFile()))
{
return false;
}
$query = $this->db->getQuery(true)
->select($this->db->quoteName('extension_id'))
->from('#__extensions')
->where($this->db->quoteName('type') . ' =
' . $this->db->quote($this->extension_type))
->where($this->db->quoteName('element') . ' =
' . $this->db->quote($this->getElementName()));
$this->db->setQuery($query, 0, 1);
$result = $this->db->loadResult();
return empty($result) ? false : true;
}
public function getMainFolder()
{
switch ($this->extension_type)
{
case 'plugin' :
return JPATH_PLUGINS . '/' . $this->plugin_folder .
'/' . $this->extname;
case 'component' :
return JPATH_ADMINISTRATOR . '/components/com_' .
$this->extname;
case 'module' :
return JPATH_SITE . '/modules/mod_' . $this->extname;
case 'library' :
return JPATH_SITE . '/libraries/' . $this->extname;
}
}
public function getInstalledXMLFile()
{
return $this->getXMLFile($this->getMainFolder());
}
public function getCurrentXMLFile()
{
return $this->getXMLFile(__DIR__);
}
public function getXMLFile($folder)
{
switch ($this->extension_type)
{
case 'module' :
return $folder . '/mod_' . $this->extname .
'.xml';
default :
return $folder . '/' . $this->extname . '.xml';
}
}
public function uninstallExtension($extname, $type = 'plugin',
$folder = 'system', $show_message = true)
{
if (empty($extname))
{
return;
}
$folders = array();
switch ($type)
{
case 'plugin';
$folders[] = JPATH_PLUGINS . '/' . $folder . '/' .
$extname;
break;
case 'component':
$folders[] = JPATH_ADMINISTRATOR . '/components/com_' .
$extname;
$folders[] = JPATH_SITE . '/components/com_' . $extname;
break;
case 'module':
$folders[] = JPATH_ADMINISTRATOR . '/modules/mod_' .
$extname;
$folders[] = JPATH_SITE . '/modules/mod_' . $extname;
break;
}
if ( ! $this->foldersExist($folders))
{
return;
}
$query = $this->db->getQuery(true)
->select($this->db->quoteName('extension_id'))
->from('#__extensions')
->where($this->db->quoteName('element') . ' =
' . $this->db->quote($this->getElementName($type,
$extname)))
->where($this->db->quoteName('type') . ' =
' . $this->db->quote($type));
if ($type == 'plugin')
{
$query->where($this->db->quoteName('folder') . '
= ' . $this->db->quote($folder));
}
$this->db->setQuery($query);
$ids = $this->db->loadColumn();
if (empty($ids))
{
foreach ($folders as $folder)
{
JFolder::delete($folder);
}
return;
}
$ignore_ids =
JFactory::getApplication()->getUserState('rl_ignore_uninstall_ids',
array());
if (JFactory::getApplication()->input->get('option') ==
'com_installer' &&
JFactory::getApplication()->input->get('task') ==
'remove')
{
// Don't attempt to uninstall extensions that are already selected
to get uninstalled by them selves
$ignore_ids = array_merge($ignore_ids,
JFactory::getApplication()->input->get('cid', array(),
'array'));
JFactory::getApplication()->input->set('cid',
array_merge($ignore_ids, $ids));
}
$ids = array_diff($ids, $ignore_ids);
if (empty($ids))
{
return;
}
$ignore_ids = array_merge($ignore_ids, $ids);
JFactory::getApplication()->setUserState('rl_ignore_uninstall_ids',
$ignore_ids);
foreach ($ids as $id)
{
$tmpInstaller = new JInstaller;
$tmpInstaller->uninstall($type, $id);
}
if ($show_message)
{
JFactory::getApplication()->enqueueMessage(
JText::sprintf(
'COM_INSTALLER_UNINSTALL_SUCCESS',
JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($type))
)
);
}
}
public function foldersExist($folders = array())
{
foreach ($folders as $folder)
{
if (is_dir($folder))
{
return true;
}
}
return false;
}
public function uninstallPlugin($extname, $folder = 'system',
$show_message = true)
{
$this->uninstallExtension($extname, 'plugin', $folder,
$show_message);
}
public function uninstallComponent($extname, $show_message = true)
{
$this->uninstallExtension($extname, 'component', null,
$show_message);
}
public function uninstallModule($extname, $show_message = true)
{
$this->uninstallExtension($extname, 'module', null,
$show_message);
}
public function publishExtension()
{
switch ($this->extension_type)
{
case 'plugin' :
$this->publishPlugin();
case 'module' :
$this->publishModule();
}
}
public function publishPlugin()
{
$query = $this->db->getQuery(true)
->update('#__extensions')
->set($this->db->quoteName('enabled') . ' =
1')
->where($this->db->quoteName('type') . ' =
' . $this->db->quote('plugin'))
->where($this->db->quoteName('element') . ' =
' . $this->db->quote($this->extname))
->where($this->db->quoteName('folder') . ' =
' . $this->db->quote($this->plugin_folder));
$this->db->setQuery($query);
$this->db->execute();
}
public function publishModule()
{
// Get module id
$query = $this->db->getQuery(true)
->select($this->db->quoteName('id'))
->from('#__modules')
->where($this->db->quoteName('module') . ' =
' . $this->db->quote('mod_' . $this->extname))
->where($this->db->quoteName('client_id') . ' =
' . (int) $this->client_id);
$this->db->setQuery($query, 0, 1);
$id = $this->db->loadResult();
if ( ! $id)
{
return;
}
// check if module is already in the modules_menu table (meaning is is
already saved)
$query->clear()
->select($this->db->quoteName('moduleid'))
->from('#__modules_menu')
->where($this->db->quoteName('moduleid') . ' =
' . (int) $id);
$this->db->setQuery($query, 0, 1);
$exists = $this->db->loadResult();
if ($exists)
{
return;
}
// Get highest ordering number in position
$query->clear()
->select($this->db->quoteName('ordering'))
->from('#__modules')
->where($this->db->quoteName('position') . ' =
' . $this->db->quote($this->module_position))
->where($this->db->quoteName('client_id') . ' =
' . (int) $this->client_id)
->order('ordering DESC');
$this->db->setQuery($query, 0, 1);
$ordering = $this->db->loadResult();
$ordering++;
// publish module and set ordering number
$query->clear()
->update('#__modules')
->set($this->db->quoteName('published') . ' =
1')
->set($this->db->quoteName('ordering') . ' =
' . (int) $ordering)
->set($this->db->quoteName('position') . ' =
' . $this->db->quote($this->module_position))
->where($this->db->quoteName('id') . ' = '
. (int) $id);
$this->db->setQuery($query);
$this->db->execute();
// add module to the modules_menu table
$query->clear()
->insert('#__modules_menu')
->columns(array($this->db->quoteName('moduleid'),
$this->db->quoteName('menuid')))
->values((int) $id . ', 0');
$this->db->setQuery($query);
$this->db->execute();
}
public function addInstalledMessage()
{
JFactory::getApplication()->enqueueMessage(
JText::sprintf(
JText::_($this->install_type == 'update' ?
'W357_THE_EXTENSION_HAS_BEEN_UPDATED_SUCCESSFULLY' :
'W357_THE_EXTENSION_HAS_BEEN_INSTALLED_SUCCESSFULLY'),
'<strong>' . JText::_($this->name) .
'</strong>',
'<strong>' . $this->getVersion() .
'</strong>',
$this->getFullType()
)
);
}
public function getPrefix()
{
switch ($this->extension_type)
{
case 'plugin';
return JText::_('plg_' .
strtolower($this->plugin_folder));
case 'component':
return JText::_('com');
case 'module':
return JText::_('mod');
case 'library':
return JText::_('lib');
default:
return $this->extension_type;
}
}
public function getElementName($type = null, $extname = null)
{
$type = is_null($type) ? $this->extension_type : $type;
$extname = is_null($extname) ? $this->extname : $extname;
switch ($type)
{
case 'component' :
return 'com_' . $extname;
case 'module' :
return 'mod_' . $extname;
case 'plugin' :
default:
return $extname;
}
}
public function getFullType()
{
return JText::_('W357_' . strtoupper($this->getPrefix()));
}
public function getVersion($file = '')
{
$file = $file ?: $this->getCurrentXMLFile();
if ( ! is_file($file))
{
return '';
}
$xml = JInstaller::parseXMLInstallFile($file);
if ( ! $xml || ! isset($xml['version']))
{
return '';
}
return $xml['version'];
}
public function isNewer()
{
if ( ! $installed_version =
$this->getVersion($this->getInstalledXMLFile()))
{
return true;
}
$package_version = $this->getVersion();
return version_compare($installed_version, $package_version,
'<=');
}
public function canInstall()
{
// The extension is not installed yet
if ( ! $installed_version =
$this->getVersion($this->getInstalledXMLFile()))
{
return true;
}
// The free version is installed. So any version is ok to install
if (strpos($installed_version, 'PRO') === false)
{
return true;
}
// Current package is a pro version, so all good
if (strpos($this->getVersion(), 'PRO') !== false)
{
return true;
}
JFactory::getLanguage()->load($this->getPrefix() . '_' .
$this->extname, __DIR__);
JFactory::getApplication()->enqueueMessage(JText::_('W357_ERROR_PRO_TO_FREE'),
'error');
JFactory::getApplication()->enqueueMessage(
html_entity_decode(
JText::sprintf(
'W357_ERROR_UNINSTALL_FIRST',
'<a href="//www.web357.com/product/' .
$this->url_alias . '" target="_blank">',
'</a>',
JText::_($this->name)
)
), 'error'
);
return false;
}
public function onBeforeInstall($route)
{
if ( ! $this->canInstall())
{
return false;
}
return true;
}
public function onAfterInstall($route)
{
}
public function delete($files = array())
{
foreach ($files as $file)
{
if (is_dir($file) && JFolder::exists($file))
{
JFolder::delete($file);
}
if (is_file($file) && JFile::exists($file))
{
JFile::delete($file);
}
}
}
public function fixAssetsRules($rules =
'{"core.admin":[],"core.manage":[]}')
{
// replace default rules value {} with the correct initial value
$query = $this->db->getQuery(true)
->update($this->db->quoteName('#__assets'))
->set($this->db->quoteName('rules') . ' = '
. $this->db->quote($rules))
->where($this->db->quoteName('title') . ' =
' . $this->db->quote('com_' . $this->extname))
->where($this->db->quoteName('rules') . ' =
' . $this->db->quote('{}'));
$this->db->setQuery($query);
$this->db->execute();
}
private function updateHttptoHttpsInUpdateSites()
{
$query = $this->db->getQuery(true)
->update('#__update_sites')
->set($this->db->quoteName('location') . ' =
REPLACE('
. $this->db->quoteName('location') . ', '
. $this->db->quote('http://') . ', '
. $this->db->quote('https://')
. ')')
->where($this->db->quoteName('location') . '
LIKE ' . $this->db->quote('http://updates.web357%'));
$this->db->setQuery($query);
$this->db->execute();
}
private function removeGlobalLanguageFiles()
{
if ($this->extension_type == 'library' || $this->alias
=== 'web357framework')
{
return;
}
$language_files = JFolder::files(JPATH_ADMINISTRATOR .
'/language', '\.' . $this->getPrefix() .
'_' . $this->extname . '\.', true, true);
// Remove override files
foreach ($language_files as $i => $language_file)
{
if (strpos($language_file, '/overrides/') === false)
{
continue;
}
unset($language_files[$i]);
}
if (empty($language_files))
{
return;
}
JFile::delete($language_files);
}
private function removeUnusedLanguageFiles()
{
if ($this->extension_type == 'library')
{
return;
}
$main_language_dir_path = JFolder::folders(__DIR__ .
'/language');
$installed_languages = array_merge(
JFolder::folders(JPATH_SITE . '/language'),
JFolder::folders(JPATH_ADMINISTRATOR . '/language')
);
$languages = array();
if (is_array($main_language_dir_path) &&
is_array($installed_languages))
{
$languages = array_diff(
$main_language_dir_path,
$installed_languages
);
}
$delete_languages = array();
if (!empty($languages))
{
foreach ($languages as $language)
{
$delete_languages[] = $this->getMainFolder() .
'/language/' . $language;
}
}
if (empty($delete_languages))
{
return;
}
// Remove folders
$this->delete($delete_languages);
}
}script.install.php000064400000011172151167412410010232 0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
require_once __DIR__ . '/script.install.helper.php';
class PlgSystemLoginasuserInstallerScript extends
PlgSystemLoginasuserInstallerScriptHelper
{
public $name = 'Login as User';
public $alias = 'loginasuser';
public $extension_type = 'plugin';
public $plugin_folder = 'system';
// Find the default template name in joomla! backend
function getDefaultAdminTemplate()
{
// connect to db
$db = JFactory::getDBO();
// Find the default template name in joomla! backend
$query = 'SELECT template FROM #__template_styles WHERE client_id=1
AND home=1';
$db->setQuery($query);
$default_admin_template = $db->loadResult();
return $default_admin_template;
}
function postflight($type, $parent)
{
// connect to db
$db = JFactory::getDBO();
// Enable Plugin and Set Ordering #1
$query = "UPDATE #__extensions SET enabled=1, ordering=1 WHERE
element='loginasuser' AND type='plugin' AND
folder='system'";
$db->setQuery($query);
$db->execute();
// importjoomla file system
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
// create "html" folder
$html_folder =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/";
if (!JFolder::create($html_folder))
{
throw new Exception(JText::_('Error creating the folder: ' .
$html_folder), 500);
}
// create "com_users" folder
$com_users_folder =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/com_users/";
if (!JFolder::create($com_users_folder))
{
throw new Exception(JText::_('Error creating the folder: ' .
$com_users_folder), 500);
}
// create "users" folder
$users_folder =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/com_users/users/";
if (!JFolder::create($users_folder))
{
throw new Exception(JText::_('Error creating the folder: ' .
$users_folder), 500);
}
// create "user" folder
$user_folder =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/com_users/user/";
if (!JFolder::create($user_folder))
{
throw new Exception(JText::_('Error creating the folder: ' .
$user_folder), 500);
}
// BEGIN: copy files to the current admin template html folder (default
is isis)
// users:default
$src =
JPATH_PLUGINS."/system/loginasuser/com_users_helper_files/joomla_com_users/default.php";
$dest =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/com_users/users/default.php";
if (JFile::exists($src))
{
JFile::copy($src, $dest);
}
// user:edit
$src =
JPATH_PLUGINS."/system/loginasuser/com_users_helper_files/joomla_com_users/edit.php";
$dest =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/com_users/user/edit.php";
if (JFile::exists($src))
{
JFile::copy($src, $dest);
}
// END: copy files to the current admin template html folder (default is
isis)
$this->deleteOldFiles();
}
function uninstall($parent)
{
jimport( 'joomla.filesystem.file' );
$f =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/com_users/users/default.php";
JFile::delete($f);
$f =
JPATH_ADMINISTRATOR."/templates/".$this->getDefaultAdminTemplate()."/html/com_users/user/edit.php";
JFile::delete($f);
}
private function deleteOldFiles()
{
$this->delete(
array(
JPATH_SITE .
'/administrator/templates/'.$this->getDefaultAdminTemplate().'/html/com_users/users/common.php',
JPATH_SITE .
'/administrator/templates/'.$this->getDefaultAdminTemplate().'/html/com_users/users/edit.php',
JPATH_SITE .
'/administrator/templates/'.$this->getDefaultAdminTemplate().'/html/com_users/users/j3-default-edit.php',
JPATH_SITE .
'/administrator/templates/'.$this->getDefaultAdminTemplate().'/html/com_users/users/j3-default.php',
JPATH_SITE .
'/administrator/templates/'.$this->getDefaultAdminTemplate().'/html/com_users/users/j4-default-edit.php',
JPATH_SITE .
'/administrator/templates/'.$this->getDefaultAdminTemplate().'/html/com_users/users/j4-default.php',
)
);
}
}