function approveDocument($cid, $approved = 1) { DOCMAN_token::check() or die('Invalid Token'); $database = JFactory::getDBO(); $mainframe = JFactory::getApplication(); $redirect = JRequest::getString('redirect', "index.php?option=com_docman§ion=documents"); $doc = new mosDMDocument($database); if ($doc->approve($cid, $approved)) { $mainframe->redirect($redirect); } }
function approveDocument($cid, $approved = 1) { DOCMAN_token::check() or die('Invalid Token'); global $database; $redirect = mosGetParam($_REQUEST, 'redirect', "index2.php?option=com_docman§ion=documents"); $doc = new mosDMDocument($database); if ($doc->approve($cid, $approved)) { mosRedirect($redirect); } }