Spade
Mini Shell
assets/css/index.html000064400000000037151157477410010647
0ustar00<!DOCTYPE html><title></title>
assets/css/loginasuser.css000064400000001347151157477410011724 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.html000064400000000037151157477410010057 0ustar00<!DOCTYPE
html><title></title>
assets/js/loginasuser-communitybuilder.js000064400000002222151157477410014756
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.js000064400000005341151157477410013176
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.js000064400000006107151157477410012761
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.js000064400000005242151157477410014065
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.js000064400000005762151157477410013343
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.js000064400000006063151157477410013574
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.html000064400000000043151157477410013272
0ustar00<!DOCTYPE html><title></title>
com_users_helper_files/joomla_com_users/common.php000064400000007421151157477410016645
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.php000064400000002147151157477410017001
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.php000064400000002161151157477410016276
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.php000064400000014432151157477410020236
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.php000064400000023755151157477410017323
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.php000064400000011576151157477410020245
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.php000064400000044774151157477410017330
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.html000064400000000037151157477410010371
0ustar00<!DOCTYPE html><title></title>
elements/loginasuserinaction.php000064400000002167151157477410013173
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.php000064400000003366151157477410010664
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.php000064400000002652151157477410013310
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.html000064400000000043151157477410006552 0ustar00<!DOCTYPE
html><title></title>
language/en-GB/en-GB.plg_system_loginasuser.ini000064400000013324151157477410015427
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.ini000064400000000761151157477410016245
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.html000064400000000037151157477410011230
0ustar00<!DOCTYPE html><title></title>
language/index.html000064400000000037151157477410010340
0ustar00<!DOCTYPE html><title></title>
language/nl-NL/index.html000064400000000037151157477410011260
0ustar00<!DOCTYPE html><title></title>
language/nl-NL/nl-NL.plg_system_loginasuser.ini000064400000005624151157477410015513
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.ini000064400000001022151157477410016314
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.php000064400000006215151157477410007630 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;
class plgInstallerLoginasuser extends JPlugin
{
public function onInstallerBeforePackageDownload(&$url,
&$headers)
{
if (parse_url($url, PHP_URL_HOST) == 'www.web357.com' ||
parse_url($url, PHP_URL_HOST) == 'downloads.web357.com') {
$apikey_from_plugin_parameters =
Web357Framework\Functions::getWeb357ApiKey();
$current_url = JURI::getInstance()->toString();
$parse = parse_url($current_url);
$domain = isset($parse['host']) ?
$parse['host'] : 'domain.com';
$url = str_replace('?cms=j', '&cms=j',
$url);
$uri = JUri::getInstance($url);
$item = $uri->getVar('item');
if ($item !== 'loginasuser')
{
return;
}
if (!empty($apikey_from_plugin_parameters))
{
$uri->setVar('liveupdate', 'true');
$uri->setVar('domain', $domain);
$uri->setVar('dlid',
$apikey_from_plugin_parameters);
$url = $uri->toString();
$url = str_replace('?cms=',
'&cms=', $url);
$url = str_replace(' ', '+', $url);
}
// Watchful.net support
elseif (isset($parse['query']) &&
strpos($parse['query'], 'com_watchfulli') !== false)
{
$apikey = $uri->getVar('key'); // get apikey
from watchful settings
if (isset($apikey) && !empty($apikey))
{
$apikey = str_replace(' ', '+',
$apikey);
$uri->setVar('liveupdate',
'com_watchfulli');
$uri->setVar('domain', $domain);
$uri->setVar('dlid', $apikey);
$uri->setVar('key', $apikey);
$url = $uri->toString();
$url = str_replace('?cms=',
'&cms=', $url);
}
else
{
JFactory::getApplication()->enqueueMessage(JText::_('W357FRM_APIKEY_WARNING'),
'notice');
}
}
else
{
// load default and current language
$jlang = JFactory::getLanguage();
$jlang->load('plg_system_web357framework',
JPATH_ADMINISTRATOR, 'en-GB', true);
// warn about missing api key
JFactory::getApplication()->enqueueMessage(JText::_('W357FRM_APIKEY_WARNING'),
'notice');
}
}
return true;
}
}loginasuser.xml000064400000002527151157477410007643 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="installer" method="upgrade">
<name>PLG_INSTALLER_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>language</folder>
<filename
plugin="loginasuser">loginasuser.php</filename>
<filename>script.install.helper.php</filename>
</files>
<scriptfile>script.install.php</scriptfile>
<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.php000064400000036460151157477410011531
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 PlgInstallerLoginasuserInstallerScriptHelper
{
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.php000064400000001664151157477410010251 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 PlgInstallerLoginasuserInstallerScript extends
PlgInstallerLoginasuserInstallerScriptHelper
{
public $name = 'Login as User';
public $alias = 'loginasuser';
public $extension_type = 'plugin';
public $plugin_folder = 'installer';
}language/en-GB/en-GB.plg_installer_loginasuser.ini000064400000000776151157540040016075
0ustar00; Defaults
PLG_INSTALLER_LOGINASUSER="Installer - Login as User"
PLG_INSTALLER_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/en-GB.plg_installer_loginasuser.sys.ini000064400000000776151157540040016712
0ustar00; Defaults
PLG_INSTALLER_LOGINASUSER="Installer - Login as User"
PLG_INSTALLER_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."