diff --git a/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php b/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php index 664bb154c89f1..4e7dca1227313 100644 --- a/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php +++ b/administrator/components/com_admin/src/View/Sysinfo/HtmlView.php @@ -82,7 +82,7 @@ class HtmlView extends BaseHtmlView 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); } diff --git a/administrator/components/com_associations/src/View/Associations/HtmlView.php b/administrator/components/com_associations/src/View/Associations/HtmlView.php index 3fe4c66e2f9e6..12dc60323e892 100644 --- a/administrator/components/com_associations/src/View/Associations/HtmlView.php +++ b/administrator/components/com_associations/src/View/Associations/HtmlView.php @@ -208,7 +208,7 @@ public function display($tpl = null) */ protected function addToolbar() { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); if (isset($this->typeName) && isset($this->extensionName)) { diff --git a/administrator/components/com_banners/src/View/Banner/HtmlView.php b/administrator/components/com_banners/src/View/Banner/HtmlView.php index 1de2d41b86171..a73f0d9f2415c 100644 --- a/administrator/components/com_banners/src/View/Banner/HtmlView.php +++ b/administrator/components/com_banners/src/View/Banner/HtmlView.php @@ -95,7 +95,7 @@ protected function addToolbar(): void { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->id; $isNew = ($this->item->id == 0); $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $userId); diff --git a/administrator/components/com_banners/src/View/Client/HtmlView.php b/administrator/components/com_banners/src/View/Client/HtmlView.php index 065573839e522..b7b820267800c 100644 --- a/administrator/components/com_banners/src/View/Client/HtmlView.php +++ b/administrator/components/com_banners/src/View/Client/HtmlView.php @@ -106,7 +106,7 @@ protected function addToolbar(): void { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->id); $canDo = $this->canDo; diff --git a/administrator/components/com_cache/src/View/Cache/HtmlView.php b/administrator/components/com_cache/src/View/Cache/HtmlView.php index b26eaea6a56b4..7018a26ed96d7 100644 --- a/administrator/components/com_cache/src/View/Cache/HtmlView.php +++ b/administrator/components/com_cache/src/View/Cache/HtmlView.php @@ -137,7 +137,7 @@ protected function addToolbar(): void ToolbarHelper::divider(); } - if (Factory::getUser()->authorise('core.admin', 'com_cache')) + if ($this->getCurrentUser()->authorise('core.admin', 'com_cache')) { ToolbarHelper::preferences('com_cache'); ToolbarHelper::divider(); diff --git a/administrator/components/com_categories/src/View/Category/HtmlView.php b/administrator/components/com_categories/src/View/Category/HtmlView.php index 71d1a50119ec7..d0a31e2b49143 100644 --- a/administrator/components/com_categories/src/View/Category/HtmlView.php +++ b/administrator/components/com_categories/src/View/Category/HtmlView.php @@ -131,7 +131,7 @@ public function display($tpl = null) protected function addToolbar() { $extension = Factory::getApplication()->input->get('extension'); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->id; $isNew = ($this->item->id == 0); diff --git a/administrator/components/com_config/src/View/Application/HtmlView.php b/administrator/components/com_config/src/View/Application/HtmlView.php index c750bffa0b603..4811211852143 100644 --- a/administrator/components/com_config/src/View/Application/HtmlView.php +++ b/administrator/components/com_config/src/View/Application/HtmlView.php @@ -66,7 +66,7 @@ public function display($tpl = null) // Load Form and Data $form = $this->get('form'); $data = $this->get('data'); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); } catch (\Exception $e) { diff --git a/administrator/components/com_config/src/View/Component/HtmlView.php b/administrator/components/com_config/src/View/Component/HtmlView.php index fa0996f9f9233..b29e47b5031ad 100644 --- a/administrator/components/com_config/src/View/Component/HtmlView.php +++ b/administrator/components/com_config/src/View/Component/HtmlView.php @@ -70,7 +70,7 @@ public function display($tpl = null) } $form = $this->get('form'); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); } catch (\Exception $e) { diff --git a/administrator/components/com_contact/src/View/Contact/HtmlView.php b/administrator/components/com_contact/src/View/Contact/HtmlView.php index 018cde07ce84c..c3b55bb0fa0a9 100644 --- a/administrator/components/com_contact/src/View/Contact/HtmlView.php +++ b/administrator/components/com_contact/src/View/Contact/HtmlView.php @@ -99,7 +99,7 @@ protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->id; $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $userId); diff --git a/administrator/components/com_content/src/View/Article/HtmlView.php b/administrator/components/com_content/src/View/Article/HtmlView.php index 82df0941ea678..1e09c33605ab3 100644 --- a/administrator/components/com_content/src/View/Article/HtmlView.php +++ b/administrator/components/com_content/src/View/Article/HtmlView.php @@ -128,7 +128,7 @@ public function display($tpl = null) protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->id; $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $userId); diff --git a/administrator/components/com_fields/src/View/Field/HtmlView.php b/administrator/components/com_fields/src/View/Field/HtmlView.php index 8159b9ac9c6c9..0b8e8a209cb23 100644 --- a/administrator/components/com_fields/src/View/Field/HtmlView.php +++ b/administrator/components/com_fields/src/View/Field/HtmlView.php @@ -91,7 +91,7 @@ protected function addToolbar() { $component = $this->state->get('field.component'); $section = $this->state->get('field.section'); - $userId = Factory::getUser()->get('id'); + $userId = $this->getCurrentUser()->get('id'); $canDo = $this->canDo; $isNew = ($this->item->id == 0); diff --git a/administrator/components/com_fields/src/View/Fields/HtmlView.php b/administrator/components/com_fields/src/View/Fields/HtmlView.php index ac30ba0f3bdb2..e7bb2fdf8d170 100644 --- a/administrator/components/com_fields/src/View/Fields/HtmlView.php +++ b/administrator/components/com_fields/src/View/Fields/HtmlView.php @@ -152,7 +152,7 @@ protected function addToolbar() $toolbar->addNew('field.add'); } - if ($canDo->get('core.edit.state') || Factory::getUser()->authorise('core.admin')) + if ($canDo->get('core.edit.state') || $this->getCurrentUser()->authorise('core.admin')) { $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') @@ -172,7 +172,7 @@ protected function addToolbar() $childBar->archive('fields.archive')->listCheck(true); } - if (Factory::getUser()->authorise('core.admin')) + if ($this->getCurrentUser()->authorise('core.admin')) { $childBar->checkin('fields.checkin')->listCheck(true); } diff --git a/administrator/components/com_fields/src/View/Group/HtmlView.php b/administrator/components/com_fields/src/View/Group/HtmlView.php index 0a10b060c31d2..7e1421f78ee71 100644 --- a/administrator/components/com_fields/src/View/Group/HtmlView.php +++ b/administrator/components/com_fields/src/View/Group/HtmlView.php @@ -116,7 +116,7 @@ protected function addToolbar() $component = $parts[0]; } - $userId = Factory::getUser()->get('id'); + $userId = $this->getCurrentUser()->get('id'); $canDo = $this->canDo; $isNew = ($this->item->id == 0); diff --git a/administrator/components/com_fields/src/View/Groups/HtmlView.php b/administrator/components/com_fields/src/View/Groups/HtmlView.php index 107bc27b3a983..2c80ab45f2cec 100644 --- a/administrator/components/com_fields/src/View/Groups/HtmlView.php +++ b/administrator/components/com_fields/src/View/Groups/HtmlView.php @@ -154,7 +154,7 @@ protected function addToolbar() $toolbar->addNew('group.add'); } - if ($canDo->get('core.edit.state') || Factory::getUser()->authorise('core.admin')) + if ($canDo->get('core.edit.state') || $this->getCurrentUser()->authorise('core.admin')) { $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') @@ -174,7 +174,7 @@ protected function addToolbar() $childBar->archive('groups.archive')->listCheck(true); } - if (Factory::getUser()->authorise('core.admin')) + if ($this->getCurrentUser()->authorise('core.admin')) { $childBar->checkin('groups.checkin')->listCheck(true); } diff --git a/administrator/components/com_finder/src/View/Filter/HtmlView.php b/administrator/components/com_finder/src/View/Filter/HtmlView.php index 43dcfe64ac076..b51c2166d9a89 100644 --- a/administrator/components/com_finder/src/View/Filter/HtmlView.php +++ b/administrator/components/com_finder/src/View/Filter/HtmlView.php @@ -113,7 +113,7 @@ protected function addToolbar() Factory::getApplication()->input->set('hidemainmenu', true); $isNew = ($this->item->filter_id == 0); - $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == Factory::getUser()->id); + $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $this->getCurrentUser()->id); $canDo = ContentHelper::getActions('com_finder'); // Configure the toolbar. diff --git a/administrator/components/com_installer/src/View/Install/HtmlView.php b/administrator/components/com_installer/src/View/Install/HtmlView.php index 32cc41f03b166..acd570b4c3d78 100644 --- a/administrator/components/com_installer/src/View/Install/HtmlView.php +++ b/administrator/components/com_installer/src/View/Install/HtmlView.php @@ -37,7 +37,7 @@ class HtmlView extends InstallerViewDefault */ public function display($tpl = null) { - if (!Factory::getUser()->authorise('core.admin')) + if (!$this->getCurrentUser()->authorise('core.admin')) { throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); } diff --git a/administrator/components/com_installer/src/View/Languages/HtmlView.php b/administrator/components/com_installer/src/View/Languages/HtmlView.php index 5cef7b65e0151..41766b6330663 100644 --- a/administrator/components/com_installer/src/View/Languages/HtmlView.php +++ b/administrator/components/com_installer/src/View/Languages/HtmlView.php @@ -46,7 +46,7 @@ class HtmlView extends InstallerViewDefault */ public function display($tpl = null) { - if (!Factory::getUser()->authorise('core.admin')) + if (!$this->getCurrentUser()->authorise('core.admin')) { throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); } diff --git a/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php b/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php index f116aa9e65063..a4318560674e9 100644 --- a/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php +++ b/administrator/components/com_joomlaupdate/src/View/Joomlaupdate/HtmlView.php @@ -278,7 +278,7 @@ protected function addToolbar() } // Add toolbar buttons. - if (Factory::getUser()->authorise('core.admin')) + if ($this->getCurrentUser()->authorise('core.admin')) { ToolbarHelper::preferences('com_joomlaupdate'); } diff --git a/administrator/components/com_languages/src/View/Overrides/HtmlView.php b/administrator/components/com_languages/src/View/Overrides/HtmlView.php index a02dabb38594f..1795f4a2fcaed 100644 --- a/administrator/components/com_languages/src/View/Overrides/HtmlView.php +++ b/administrator/components/com_languages/src/View/Overrides/HtmlView.php @@ -109,7 +109,7 @@ protected function addToolbar() ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'overrides.delete', 'JTOOLBAR_DELETE'); } - if (Factory::getUser()->authorise('core.admin')) + if ($this->getCurrentUser()->authorise('core.admin')) { ToolbarHelper::custom('overrides.purge', 'refresh', '', 'COM_LANGUAGES_VIEW_OVERRIDES_PURGE', false); } diff --git a/administrator/components/com_mails/src/View/Templates/HtmlView.php b/administrator/components/com_mails/src/View/Templates/HtmlView.php index 79f938ac33298..f70abbb4604b1 100644 --- a/administrator/components/com_mails/src/View/Templates/HtmlView.php +++ b/administrator/components/com_mails/src/View/Templates/HtmlView.php @@ -137,7 +137,7 @@ protected function addToolbar() { // Get the toolbar object instance $toolbar = Toolbar::getInstance('toolbar'); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); ToolbarHelper::title(Text::_('COM_MAILS_MAILS_TITLE'), 'envelope'); diff --git a/administrator/components/com_media/src/View/Media/HtmlView.php b/administrator/components/com_media/src/View/Media/HtmlView.php index 56e93e73b0a26..a8bd7b64b2864 100644 --- a/administrator/components/com_media/src/View/Media/HtmlView.php +++ b/administrator/components/com_media/src/View/Media/HtmlView.php @@ -88,7 +88,7 @@ protected function prepareToolbar() // Get the toolbar object instance $bar = Toolbar::getInstance('toolbar'); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); // Set the title ToolbarHelper::title(Text::_('COM_MEDIA'), 'images mediamanager'); diff --git a/administrator/components/com_menus/src/View/Item/HtmlView.php b/administrator/components/com_menus/src/View/Item/HtmlView.php index 9751b0cf168a2..1978f46098eba 100644 --- a/administrator/components/com_menus/src/View/Item/HtmlView.php +++ b/administrator/components/com_menus/src/View/Item/HtmlView.php @@ -128,7 +128,7 @@ protected function addToolbar() $input = Factory::getApplication()->input; $input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); $canDo = $this->canDo; diff --git a/administrator/components/com_menus/src/View/Items/HtmlView.php b/administrator/components/com_menus/src/View/Items/HtmlView.php index f2b6f8722f22e..fe1c86bdd9521 100644 --- a/administrator/components/com_menus/src/View/Items/HtmlView.php +++ b/administrator/components/com_menus/src/View/Items/HtmlView.php @@ -320,7 +320,7 @@ protected function addToolbar() $menutypeId = (int) $this->state->get('menutypeid'); $canDo = ContentHelper::getActions('com_menus', 'menu', (int) $menutypeId); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); // Get the menu title $menuTypeTitle = $this->get('State')->get('menutypetitle'); @@ -344,7 +344,7 @@ protected function addToolbar() $protected = $this->state->get('filter.menutype') == 'main'; - if (($canDo->get('core.edit.state') || Factory::getUser()->authorise('core.admin')) && !$protected + if (($canDo->get('core.edit.state') || $this->getCurrentUser()->authorise('core.admin')) && !$protected || $canDo->get('core.edit.state') && $this->state->get('filter.client_id') == 0) { $dropdown = $toolbar->dropdownButton('status-group') @@ -363,7 +363,7 @@ protected function addToolbar() $childBar->unpublish('items.unpublish')->listCheck(true); } - if (Factory::getUser()->authorise('core.admin') && !$protected) + if ($this->getCurrentUser()->authorise('core.admin') && !$protected) { $childBar->checkin('items.checkin')->listCheck(true); } @@ -393,7 +393,7 @@ protected function addToolbar() } } - if (Factory::getUser()->authorise('core.admin')) + if ($this->getCurrentUser()->authorise('core.admin')) { $toolbar->standardButton('refresh') ->text('JTOOLBAR_REBUILD') diff --git a/administrator/components/com_modules/src/View/Module/HtmlView.php b/administrator/components/com_modules/src/View/Module/HtmlView.php index 0fa6388aacf7b..f911c01fc20d3 100644 --- a/administrator/components/com_modules/src/View/Module/HtmlView.php +++ b/administrator/components/com_modules/src/View/Module/HtmlView.php @@ -90,7 +90,7 @@ protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); $canDo = $this->canDo; diff --git a/administrator/components/com_modules/src/View/Modules/HtmlView.php b/administrator/components/com_modules/src/View/Modules/HtmlView.php index 698fed3736e66..853ae9b074b13 100644 --- a/administrator/components/com_modules/src/View/Modules/HtmlView.php +++ b/administrator/components/com_modules/src/View/Modules/HtmlView.php @@ -180,7 +180,7 @@ protected function addToolbar() { $state = $this->get('State'); $canDo = ContentHelper::getActions('com_modules'); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); // Get the toolbar object instance $toolbar = Toolbar::getInstance('toolbar'); @@ -200,7 +200,7 @@ protected function addToolbar() ->onclick("location.href='index.php?option=com_modules&view=select&client_id=" . $this->state->get('client_id', 0) . "'"); } - if (!$this->isEmptyState && ($canDo->get('core.edit.state') || Factory::getUser()->authorise('core.admin'))) + if (!$this->isEmptyState && ($canDo->get('core.edit.state') || $this->getCurrentUser()->authorise('core.admin'))) { $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') @@ -218,7 +218,7 @@ protected function addToolbar() $childBar->unpublish('modules.unpublish')->listCheck(true); } - if (Factory::getUser()->authorise('core.admin')) + if ($this->getCurrentUser()->authorise('core.admin')) { $childBar->checkin('modules.checkin')->listCheck(true); } diff --git a/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php b/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php index eb84cfcca0249..612996ed2182a 100644 --- a/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php +++ b/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php @@ -104,7 +104,7 @@ protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); diff --git a/administrator/components/com_postinstall/src/View/Messages/HtmlView.php b/administrator/components/com_postinstall/src/View/Messages/HtmlView.php index 2163793bc5708..fb5190ec072b1 100644 --- a/administrator/components/com_postinstall/src/View/Messages/HtmlView.php +++ b/administrator/components/com_postinstall/src/View/Messages/HtmlView.php @@ -81,7 +81,7 @@ private function toolbar() } // Options button. - if (Factory::getUser()->authorise('core.admin', 'com_postinstall')) + if ($this->getCurrentUser()->authorise('core.admin', 'com_postinstall')) { $toolbar->preferences('com_postinstall'); $toolbar->help('Post-installation_Messages_for_Joomla_CMS'); diff --git a/administrator/components/com_tags/src/View/Tag/HtmlView.php b/administrator/components/com_tags/src/View/Tag/HtmlView.php index d7a903ede8428..80a2745b25dfc 100644 --- a/administrator/components/com_tags/src/View/Tag/HtmlView.php +++ b/administrator/components/com_tags/src/View/Tag/HtmlView.php @@ -99,7 +99,7 @@ protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->get('id'); $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $userId); diff --git a/administrator/components/com_templates/src/View/Template/HtmlView.php b/administrator/components/com_templates/src/View/Template/HtmlView.php index 8aa3f7cf0c7fe..84992c390493c 100644 --- a/administrator/components/com_templates/src/View/Template/HtmlView.php +++ b/administrator/components/com_templates/src/View/Template/HtmlView.php @@ -224,7 +224,7 @@ public function display($tpl = null) $this->addToolbar(); - if (!Factory::getUser()->authorise('core.admin')) + if (!$this->getCurrentUser()->authorise('core.admin')) { $this->setLayout('readonly'); } @@ -242,7 +242,7 @@ public function display($tpl = null) protected function addToolbar() { $app = Factory::getApplication(); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $app->input->set('hidemainmenu', true); // User is global SuperUser diff --git a/administrator/components/com_users/src/View/Debuggroup/HtmlView.php b/administrator/components/com_users/src/View/Debuggroup/HtmlView.php index c3cdf1b2dbbca..77dc0693c26fc 100644 --- a/administrator/components/com_users/src/View/Debuggroup/HtmlView.php +++ b/administrator/components/com_users/src/View/Debuggroup/HtmlView.php @@ -90,7 +90,7 @@ class HtmlView extends BaseHtmlView public function display($tpl = null) { // Access check. - if (!Factory::getUser()->authorise('core.manage', 'com_users')) + if (!$this->getCurrentUser()->authorise('core.manage', 'com_users')) { throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); } diff --git a/administrator/components/com_users/src/View/Debuguser/HtmlView.php b/administrator/components/com_users/src/View/Debuguser/HtmlView.php index ab211bc3ed97b..7d2c463949056 100644 --- a/administrator/components/com_users/src/View/Debuguser/HtmlView.php +++ b/administrator/components/com_users/src/View/Debuguser/HtmlView.php @@ -90,7 +90,7 @@ class HtmlView extends BaseHtmlView public function display($tpl = null) { // Access check. - if (!Factory::getUser()->authorise('core.manage', 'com_users')) + if (!$this->getCurrentUser()->authorise('core.manage', 'com_users')) { throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); } diff --git a/administrator/components/com_users/src/View/Note/HtmlView.php b/administrator/components/com_users/src/View/Note/HtmlView.php index 72b878f3370fc..48ac938246924 100644 --- a/administrator/components/com_users/src/View/Note/HtmlView.php +++ b/administrator/components/com_users/src/View/Note/HtmlView.php @@ -92,7 +92,7 @@ protected function addToolbar() $input = Factory::getApplication()->input; $input->set('hidemainmenu', 1); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); $checkedOut = !(is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); diff --git a/administrator/components/com_users/src/View/Users/HtmlView.php b/administrator/components/com_users/src/View/Users/HtmlView.php index 1084826ba50eb..ee56bdc8a47c4 100644 --- a/administrator/components/com_users/src/View/Users/HtmlView.php +++ b/administrator/components/com_users/src/View/Users/HtmlView.php @@ -124,7 +124,7 @@ public function display($tpl = null) protected function addToolbar() { $canDo = $this->canDo; - $user = Factory::getUser(); + $user = $this->getCurrentUser(); // Get the toolbar object instance $toolbar = Toolbar::getInstance('toolbar'); diff --git a/administrator/components/com_workflow/src/View/Stage/HtmlView.php b/administrator/components/com_workflow/src/View/Stage/HtmlView.php index 1bff632d3b4b3..1c24c2cd7a3f1 100644 --- a/administrator/components/com_workflow/src/View/Stage/HtmlView.php +++ b/administrator/components/com_workflow/src/View/Stage/HtmlView.php @@ -116,7 +116,7 @@ protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->id; $isNew = empty($this->item->id); diff --git a/administrator/components/com_workflow/src/View/Stages/HtmlView.php b/administrator/components/com_workflow/src/View/Stages/HtmlView.php index 91393fe5b60b3..294f44037113b 100644 --- a/administrator/components/com_workflow/src/View/Stages/HtmlView.php +++ b/administrator/components/com_workflow/src/View/Stages/HtmlView.php @@ -166,7 +166,7 @@ protected function addToolbar() { $canDo = ContentHelper::getActions($this->extension, 'workflow', $this->workflowID); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $toolbar = Toolbar::getInstance('toolbar'); diff --git a/administrator/components/com_workflow/src/View/Transition/HtmlView.php b/administrator/components/com_workflow/src/View/Transition/HtmlView.php index 69810da132e69..52d9112090361 100644 --- a/administrator/components/com_workflow/src/View/Transition/HtmlView.php +++ b/administrator/components/com_workflow/src/View/Transition/HtmlView.php @@ -146,7 +146,7 @@ protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->id; $isNew = empty($this->item->id); diff --git a/administrator/components/com_workflow/src/View/Transitions/HtmlView.php b/administrator/components/com_workflow/src/View/Transitions/HtmlView.php index d2b484fa1f7f1..50653c395630e 100644 --- a/administrator/components/com_workflow/src/View/Transitions/HtmlView.php +++ b/administrator/components/com_workflow/src/View/Transitions/HtmlView.php @@ -159,7 +159,7 @@ protected function addToolbar() { $canDo = ContentHelper::getActions($this->extension, 'workflow', $this->workflowID); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $toolbar = Toolbar::getInstance('toolbar'); diff --git a/administrator/components/com_workflow/src/View/Workflow/HtmlView.php b/administrator/components/com_workflow/src/View/Workflow/HtmlView.php index 5777eaf498d96..0bc91d5cfe0cb 100644 --- a/administrator/components/com_workflow/src/View/Workflow/HtmlView.php +++ b/administrator/components/com_workflow/src/View/Workflow/HtmlView.php @@ -121,7 +121,7 @@ protected function addToolbar() { Factory::getApplication()->input->set('hidemainmenu', true); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $userId = $user->id; $isNew = empty($this->item->id); diff --git a/components/com_config/src/View/Config/HtmlView.php b/components/com_config/src/View/Config/HtmlView.php index 437ee88fa405c..6cb0b6ff1636e 100644 --- a/components/com_config/src/View/Config/HtmlView.php +++ b/components/com_config/src/View/Config/HtmlView.php @@ -78,7 +78,7 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $this->userIsSuperAdmin = $user->authorise('core.admin'); // Access backend com_config diff --git a/components/com_config/src/View/Templates/HtmlView.php b/components/com_config/src/View/Templates/HtmlView.php index f8e6783b03f8e..39478d9b5d734 100644 --- a/components/com_config/src/View/Templates/HtmlView.php +++ b/components/com_config/src/View/Templates/HtmlView.php @@ -78,7 +78,7 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $this->userIsSuperAdmin = $user->authorise('core.admin'); $app = Factory::getApplication(); diff --git a/components/com_contact/src/View/Contact/HtmlView.php b/components/com_contact/src/View/Contact/HtmlView.php index af207dfbc37f2..0419adf686b98 100644 --- a/components/com_contact/src/View/Contact/HtmlView.php +++ b/components/com_contact/src/View/Contact/HtmlView.php @@ -130,7 +130,7 @@ class HtmlView extends BaseHtmlView public function display($tpl = null) { $app = Factory::getApplication(); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $state = $this->get('State'); $item = $this->get('Item'); $this->form = $this->get('Form'); diff --git a/components/com_contact/src/View/Form/HtmlView.php b/components/com_contact/src/View/Form/HtmlView.php index d72d14df978d4..498db543fae8c 100644 --- a/components/com_contact/src/View/Form/HtmlView.php +++ b/components/com_contact/src/View/Form/HtmlView.php @@ -73,7 +73,7 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $app = Factory::getApplication(); // Get model data. diff --git a/components/com_content/src/View/Archive/HtmlView.php b/components/com_content/src/View/Archive/HtmlView.php index a19c34cc05dbc..ff86fccf5d37e 100644 --- a/components/com_content/src/View/Archive/HtmlView.php +++ b/components/com_content/src/View/Archive/HtmlView.php @@ -112,7 +112,7 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $state = $this->get('State'); $items = $this->get('Items'); $pagination = $this->get('Pagination'); diff --git a/components/com_content/src/View/Article/HtmlView.php b/components/com_content/src/View/Article/HtmlView.php index 1678dd3d61b33..737561243eaea 100644 --- a/components/com_content/src/View/Article/HtmlView.php +++ b/components/com_content/src/View/Article/HtmlView.php @@ -103,7 +103,7 @@ public function display($tpl = null) } $app = Factory::getApplication(); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $this->item = $this->get('Item'); $this->print = $app->input->getBool('print', false); diff --git a/components/com_content/src/View/Featured/HtmlView.php b/components/com_content/src/View/Featured/HtmlView.php index 5c95e413d1ab3..e84d4d554da0a 100644 --- a/components/com_content/src/View/Featured/HtmlView.php +++ b/components/com_content/src/View/Featured/HtmlView.php @@ -110,7 +110,7 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $state = $this->get('State'); $items = $this->get('Items'); diff --git a/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php b/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php index 6355bddb6957a..92675cc012365 100644 --- a/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php +++ b/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php @@ -93,7 +93,7 @@ class HtmlView extends BaseHtmlView public function display($tpl = null) { $app = Factory::getApplication(); - $user = Factory::getUser(); + $user = $this->getCurrentUser(); // Get view related request variables. $print = $app->input->getBool('print'); diff --git a/components/com_tags/src/View/Tag/HtmlView.php b/components/com_tags/src/View/Tag/HtmlView.php index 7fde0d3c6ec19..c700751e65fea 100644 --- a/components/com_tags/src/View/Tag/HtmlView.php +++ b/components/com_tags/src/View/Tag/HtmlView.php @@ -148,7 +148,7 @@ public function display($tpl = null) // Check whether access level allows access. // @TODO: Should already be computed in $item->params->get('access-view') - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $groups = $user->getAuthorisedViewLevels(); foreach ($item as $itemElement) @@ -378,7 +378,7 @@ protected function getTagsTitle() if (!empty($this->item)) { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); $groups = $user->getAuthorisedViewLevels(); foreach ($this->item as $item) diff --git a/components/com_tags/src/View/Tags/HtmlView.php b/components/com_tags/src/View/Tags/HtmlView.php index 8cab3fbf90332..4797969d18291 100644 --- a/components/com_tags/src/View/Tags/HtmlView.php +++ b/components/com_tags/src/View/Tags/HtmlView.php @@ -88,7 +88,7 @@ public function display($tpl = null) $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $this->state->get('params'); - $this->user = Factory::getUser(); + $this->user = $this->getCurrentUser(); if (count($errors = $this->get('Errors'))) { diff --git a/components/com_users/src/View/Login/HtmlView.php b/components/com_users/src/View/Login/HtmlView.php index 88556fadf1f5c..0ce42e723d1bb 100644 --- a/components/com_users/src/View/Login/HtmlView.php +++ b/components/com_users/src/View/Login/HtmlView.php @@ -92,7 +92,7 @@ class HtmlView extends BaseHtmlView public function display($tpl = null) { // Get the view data. - $this->user = Factory::getUser(); + $this->user = $this->getCurrentUser(); $this->form = $this->get('Form'); $this->state = $this->get('State'); $this->params = $this->state->get('params'); @@ -131,7 +131,7 @@ public function display($tpl = null) */ protected function prepareDocument() { - $login = Factory::getUser()->get('guest') ? true : false; + $login = $this->getCurrentUser()->get('guest') ? true : false; // Because the application sets a default page title, // we need to get it from the menu item itself diff --git a/components/com_users/src/View/Profile/HtmlView.php b/components/com_users/src/View/Profile/HtmlView.php index 28e6138c5cf0d..e76990061eb05 100644 --- a/components/com_users/src/View/Profile/HtmlView.php +++ b/components/com_users/src/View/Profile/HtmlView.php @@ -95,7 +95,7 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $user = Factory::getUser(); + $user = $this->getCurrentUser(); // Get the view data. $this->data = $this->get('Data'); @@ -169,7 +169,7 @@ protected function prepareDocument() if ($menu) { - $this->params->def('page_heading', $this->params->get('page_title', Factory::getUser()->name)); + $this->params->def('page_heading', $this->params->get('page_title', $this->getCurrentUser()->name)); } else {