authorise('core.admin', 'com_k2')) { $user->gid = 1000; } else { $user->gid = 1; } } JLoader::register('K2Controller', JPATH_COMPONENT.DS.'controllers'.DS.'controller.php'); JLoader::register('K2Model', JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'model.php'); JLoader::register('K2View', JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'view.php'); JLoader::register('K2HelperRoute', JPATH_COMPONENT.DS.'helpers'.DS.'route.php'); JLoader::register('K2HelperPermissions', JPATH_COMPONENT.DS.'helpers'.DS.'permissions.php'); JLoader::register('K2HelperUtilities', JPATH_COMPONENT.DS.'helpers'.DS.'utilities.php'); K2HelperPermissions::setPermissions(); K2HelperPermissions::checkPermissions(); $controller = JRequest::getWord('view', 'itemlist'); $task = JRequest::getWord('task'); if ($controller == 'media') { $controller = 'item'; if ($task != 'connector') { $task = 'media'; } } if ($controller == 'users') { $controller = 'item'; $task = 'users'; } jimport('joomla.filesystem.file'); jimport('joomla.html.parameter'); if (JFile::exists(JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php')) { require_once (JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'); $classname = 'K2Controller'.$controller; $controller = new $classname(); $controller->execute($task); $controller->redirect(); } else { JError::raiseError(404, JText::_('K2_NOT_FOUND')); } if (JRequest::getCmd('format') != 'json') { echo "\n\n\n"; }