// ensure user has access to this function if (!($acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'all') | $acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'com_newsfeeds'))) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('admin_html'); require_once $mainframe->getPath('class'); $cid = josGetArrayInts('cid'); switch ($task) { case 'new': editNewsFeed(0, $option); break; case 'edit': editNewsFeed(intval($cid[0]), $option); break; case 'editA': editNewsFeed($id, $option); break; case 'save': saveNewsFeed($option); break; case 'publish': publishNewsFeeds($cid, 1, $option); break; case 'unpublish': publishNewsFeeds($cid, 0, $option); break; case 'remove': removeNewsFeeds($cid, $option); break; case 'cancel': cancelNewsFeed($option);
* Make sure the user is authorized to view this page */ $user =& JFactory::getUser(); if (!$user->authorize('com_newsfeeds', 'manage')) { $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH')); } // Set the table directory JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_newsfeeds' . DS . 'tables'); require_once JApplicationHelper::getPath('admin_html'); $task = JRequest::getCmd('task'); switch ($task) { case 'add': editNewsFeed(false); break; case 'edit': editNewsFeed(true); break; case 'save': case 'apply': saveNewsFeed(); break; case 'publish': publishNewsFeeds(); break; case 'unpublish': unPublishNewsFeeds(); break; case 'remove': removeNewsFeeds(); break; case 'cancel':
if (!($acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'all') | $acl->acl_check('administration', 'edit', 'users', $my->usertype, 'components', 'com_newsfeeds'))) { mosRedirect('index2.php', _NOT_AUTH); } require_once $mainframe->getPath('admin_html'); require_once $mainframe->getPath('class'); $task = mosGetParam($_REQUEST, 'task', array(0)); $cid = mosGetParam($_POST, 'cid', array(0)); if (!is_array($cid)) { $cid = array(0); } switch ($task) { case "new": editNewsFeed(0, $option); break; case "edit": editNewsFeed($cid[0], $option); break; case "save": saveNewsFeed($option); break; case "publish": publishNewsFeeds($cid, 1, $option); break; case "unpublish": publishNewsFeeds($cid, 0, $option); break; case "remove": removeNewsFeeds($cid, $option); break; case "cancel": cancelNewsFeed($option);