diff --git a/components/com_contact/views/contact/view.html.php b/components/com_contact/views/contact/view.html.php index 04db85ec28f03..6457f917f7e89 100644 --- a/components/com_contact/views/contact/view.html.php +++ b/components/com_contact/views/contact/view.html.php @@ -99,7 +99,9 @@ public function display($tpl = null) if ((!in_array($item->access, $groups)) || (!in_array($item->category_access, $groups))) { - JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + $app->setHeader('status', 403, true); + return; } diff --git a/components/com_content/views/article/view.html.php b/components/com_content/views/article/view.html.php index 3d59f8a79157a..22e30910e0f8e 100644 --- a/components/com_content/views/article/view.html.php +++ b/components/com_content/views/article/view.html.php @@ -133,7 +133,8 @@ public function display($tpl = null) // Check the view access to the article (the model has already computed the values). if ($item->params->get('access-view') == false && ($item->params->get('show_noauth', '0') == '0')) { - JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + $app->setHeader('status', 403, true); return; } diff --git a/components/com_content/views/form/view.html.php b/components/com_content/views/form/view.html.php index 0794124a11edf..9f91f58f228e7 100644 --- a/components/com_content/views/form/view.html.php +++ b/components/com_content/views/form/view.html.php @@ -34,6 +34,7 @@ class ContentViewForm extends JViewLegacy public function display($tpl = null) { $user = JFactory::getUser(); + $app = JFactory::getApplication(); // Get model data. $this->state = $this->get('State'); @@ -52,7 +53,8 @@ public function display($tpl = null) if ($authorised !== true) { - JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + $app->setHeader('status', 403, true); return false; } diff --git a/components/com_newsfeeds/views/newsfeed/view.html.php b/components/com_newsfeeds/views/newsfeed/view.html.php index 36d10d33e91c5..aede7f8b1513a 100644 --- a/components/com_newsfeeds/views/newsfeed/view.html.php +++ b/components/com_newsfeeds/views/newsfeed/view.html.php @@ -151,7 +151,8 @@ public function display($tpl = null) if (!in_array($item->access, $levels) or ((in_array($item->access, $levels) and (!in_array($item->category_access, $levels))))) { - JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + $app->setHeader('status', 403, true); return; } diff --git a/components/com_users/controllers/profile.php b/components/com_users/controllers/profile.php index 1ffd8afc80442..6b226fbc6d124 100644 --- a/components/com_users/controllers/profile.php +++ b/components/com_users/controllers/profile.php @@ -38,7 +38,8 @@ public function edit() // Check if the user is trying to edit another users profile. if ($userId != $loginUserId) { - JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR')); + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + $app->setHeader('status', 403, true); return false; }