Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ abstract class ActionLogPlugin extends CMSPlugin
*/
protected function addLog($messages, $messageLanguageKey, $context, $userId = null)
{
$user = Factory::getUser();
$user = $this->app->getIdentity();

foreach ($messages as $index => $message) {
if (!\array_key_exists('userid', $message)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\AbstractView;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\Component\Admin\Administrator\Model\SysinfoModel;

// phpcs:disable PSR1.Files.SideEffects
Expand All @@ -26,8 +28,10 @@
*
* @since 3.5
*/
class JsonView extends AbstractView
class JsonView extends AbstractView implements CurrentUserInterface
{
use CurrentUserTrait;

/**
* Execute and display a template script.
*
Expand All @@ -42,7 +46,7 @@ class JsonView extends AbstractView
public function display($tpl = null): void
{
// Access check.
if (!Factory::getUser()->authorise('core.admin')) {
if (!$this->getCurrentUser()->authorise('core.admin')) {
throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\AbstractView;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\Component\Admin\Administrator\Model\SysinfoModel;

// phpcs:disable PSR1.Files.SideEffects
Expand All @@ -26,8 +28,10 @@
*
* @since 3.5
*/
class TextView extends AbstractView
class TextView extends AbstractView implements CurrentUserInterface
{
use CurrentUserTrait;

/**
* Execute and display a template script.
*
Expand All @@ -42,7 +46,7 @@ class TextView extends AbstractView
public function display($tpl = null): void
{
// Access check.
if (!Factory::getUser()->authorise('core.admin')) {
if (!$this->getCurrentUser()->authorise('core.admin')) {
throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
Expand All @@ -25,7 +24,7 @@

$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$canManageCheckin = Factory::getUser()->authorise('core.manage', 'com_checkin');
$canManageCheckin = $this->getCurrentUser()->authorise('core.manage', 'com_checkin');

$iconStates = [
-2 => 'icon-trash',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$function = $app->getInput()->getCmd('function', 'jSelectAssociation');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$canManageCheckin = Factory::getUser()->authorise('core.manage', 'com_checkin');
$canManageCheckin = $this->getCurrentUser()->authorise('core.manage', 'com_checkin');

$iconStates = [
-2 => 'icon-trash',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
Expand All @@ -25,7 +24,7 @@
$wa->useScript('table.columns')
->useScript('multiselect');

$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
Expand All @@ -32,7 +31,7 @@
'5' => 'DAILY',
];

$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
Expand All @@ -24,7 +23,7 @@
$wa->useScript('table.columns')
->useScript('multiselect');

$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$extension = $this->escape($this->state->get('filter.extension'));
$listOrder = $this->escape($this->state->get('list.ordering'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use Joomla\CMS\Table\Table;
use Joomla\CMS\Tag\TaggableTableInterface;
use Joomla\CMS\Tag\TaggableTableTrait;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\CMS\Versioning\VersionableTableInterface;
use Joomla\Database\DatabaseDriver;
use Joomla\String\StringHelper;
Expand All @@ -31,9 +33,10 @@
*
* @since 1.0
*/
class ContactTable extends Table implements VersionableTableInterface, TaggableTableInterface
class ContactTable extends Table implements VersionableTableInterface, TaggableTableInterface, CurrentUserInterface
{
use TaggableTableTrait;
use CurrentUserTrait;

/**
* Indicates that columns fully support the NULL value in the database
Expand Down Expand Up @@ -79,7 +82,7 @@ public function __construct(DatabaseDriver $db)
public function store($updateNulls = true)
{
$date = Factory::getDate()->toSql();
$userId = Factory::getUser()->id;
$userId = $this->getCurrentUser()->id;

// Set created date if not set.
if (!(int) $this->created) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Multilanguage;
Expand All @@ -24,7 +23,7 @@
$wa->useScript('table.columns')
->useScript('multiselect');

$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
->useScript('multiselect');

$app = Factory::getApplication();
$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
defined('_JEXEC') or die;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Layout\LayoutHelper;

$params = ComponentHelper::getParams('com_content');

$published = (int) $this->state->get('filter.published');

$user = Factory::getUser();
$user = $this->getCurrentUser();
?>

<div class="p-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
->useScript('multiselect');

$app = Factory::getApplication();
$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down
3 changes: 1 addition & 2 deletions administrator/components/com_cpanel/tmpl/cpanel/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
Expand All @@ -30,7 +29,7 @@
$wa->useScript('com_cpanel.admin-cpanel')
->useScript('com_cpanel.admin-addmodule');

$user = Factory::getUser();
$user = $this->getCurrentUser();

// Set up the bootstrap modal that will be used for all module editors
echo HTMLHelper::_(
Expand Down
8 changes: 6 additions & 2 deletions administrator/components/com_fields/src/Table/FieldTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\Database\DatabaseDriver;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
Expand All @@ -28,8 +30,10 @@
*
* @since 3.7.0
*/
class FieldTable extends Table
class FieldTable extends Table implements CurrentUserInterface
{
use CurrentUserTrait;

/**
* Indicates that columns fully support the NULL value in the database
*
Expand Down Expand Up @@ -165,7 +169,7 @@ public function check()
}

$date = Factory::getDate()->toSql();
$user = Factory::getUser();
$user = $this->getCurrentUser();

// Set created date if not set.
if (!(int) $this->created_time) {
Expand Down
8 changes: 6 additions & 2 deletions administrator/components/com_fields/src/Table/GroupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\Database\DatabaseDriver;
use Joomla\Registry\Registry;

Expand All @@ -26,8 +28,10 @@
*
* @since 3.7.0
*/
class GroupTable extends Table
class GroupTable extends Table implements CurrentUserInterface
{
use CurrentUserTrait;

/**
* Indicates that columns fully support the NULL value in the database
*
Expand Down Expand Up @@ -101,7 +105,7 @@ public function check()
}

$date = Factory::getDate()->toSql();
$user = Factory::getUser();
$user = $this->getCurrentUser();

// Set created date if not set.
if (!(int) $this->created) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
->useScript('multiselect');

$app = Factory::getApplication();
$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$context = $this->escape($this->state->get('filter.context'));
$component = $this->state->get('filter.component');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
->useScript('multiselect');

$app = Factory::getApplication();
$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');

$component = '';
Expand Down
8 changes: 6 additions & 2 deletions administrator/components/com_finder/src/Table/FilterTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\Database\DatabaseDriver;
use Joomla\Registry\Registry;

Expand All @@ -26,8 +28,10 @@
*
* @since 2.5
*/
class FilterTable extends Table
class FilterTable extends Table implements CurrentUserInterface
{
use CurrentUserTrait;

/**
* Indicates that columns fully support the NULL value in the database
*
Expand Down Expand Up @@ -120,7 +124,7 @@ public function check()
public function store($updateNulls = true)
{
$date = Factory::getDate()->toSql();
$userId = Factory::getUser()->id;
$userId = $this->getCurrentUser()->id;

// Set created date if not set.
if (!(int) $this->created) {
Expand Down
3 changes: 1 addition & 2 deletions administrator/components/com_finder/tmpl/filters/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@

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;

$user = Factory::getUser();
$user = $this->getCurrentUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_finder/tmpl/index/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
</tr>
</thead>
<tbody>
<?php $canChange = Factory::getUser()->authorise('core.manage', 'com_finder'); ?>
<?php $canChange = $this->getCurrentUser()->authorise('core.manage', 'com_finder'); ?>
<?php foreach ($this->items as $i => $item) : ?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center">
Expand Down
Loading