public function write() { JSession::checkToken() or jexit(JText::_('INVALID TOKEN')); $rights = AimySitemapRightsHelper::getRights(); if (!$rights->get('aimysitemap.write')) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); $this->setMessage($this->getError(), 'error'); } else { require_once JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'Sitemap.php'; $sm = new AimySitemapSitemap(); $sm->write_sitemap_file(); } $this->setRedirect(JRoute::_('index.php?option=com_aimysitemap&view=urls', false)); }