Skip to content

Commit

Permalink
Do not redirect in a JSON call but return a JSON string
Browse files Browse the repository at this point in the history
  • Loading branch information
roland-d committed Jun 9, 2016
1 parent 877b3e1 commit 2b88f07
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ public function execute()
// Check if the user is authorized to do this.
if (!JFactory::getUser()->authorise('core.admin'))
{
$this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'));
$this->app->redirect('index.php');
echo new JResponseJson(json_encode(false), JText::_('JERROR_ALERTNOAUTHOR'));

JFactory::getApplication()->close();
}

// Get Post DATA
Expand All @@ -52,5 +53,7 @@ public function execute()
{
echo new JResponseJson(json_encode(false), 0);
}

JFactory::getApplication()->close();
}
}

0 comments on commit 2b88f07

Please sign in to comment.