function add_to_moodle() { JRequest::checkToken() or jexit('Invalid Token'); $cid = JRequest::getVar('cid', array(), 'post', 'array'); JArrayHelper::toInteger($cid); if (count($cid) < 1) { JError::raiseError(500, JText::_('Select an item to unpublish')); } JoomdleHelperContent::add_moodle_users($cid); $this->setRedirect('index.php?option=com_joomdle&view=users'); }