app->enqueueMessage(JText::_('JINVALID_TOKEN')); $this->app->redirect('index.php'); } // 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'); } // Initialise model. $model = new ConfigModelApplication; // Attempt to save the configuration and remove root. try { $model->removeroot(); } catch (RuntimeException $e) { // Save failed, go back to the screen and display a notice. $this->app->enqueueMessage(JText::sprintf('JERROR_SAVE_FAILED', $e->getMessage()), 'error'); $this->app->redirect(JRoute::_('index.php', false)); } // Set the redirect based on the task. $this->app->enqueueMessage(JText::_('COM_CONFIG_SAVE_SUCCESS')); $this->app->redirect(JRoute::_('index.php', false)); } }