get('massmailoff', 0) == 1) { JFactory::getApplication()->redirect(JRoute::_('index.php', false)); } // Check for request forgeries. JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); $model = $this->getModel('Mail'); if ($model->send()) { $type = 'message'; } else { $type = 'error'; } $msg = $model->getError(); $this->setredirect('index.php?option=com_users&view=mail', $msg, $type); } /** * Cancel the mail * * @return void * * @since 1.6 */ public function cancel() { // Check for request forgeries. JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); $this->setRedirect('index.php'); } }