Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
views/index.html000066600000000037150773114070007707 0ustar00 views/mailto/view.html.php000066600000003033150773114070011624 0ustar00getData(); if ($data === false) { return false; } $this->set('data', $data); parent::display($tpl); } /** * @since 1.5 */ function &getData() { $user = JFactory::getUser(); $app = JFactory::getApplication(); $data = new stdClass; $data->link = urldecode(JRequest::getVar('link', '', 'method', 'base64')); if ($data->link == '') { JError::raiseError(403, JText::_('COM_MAILTO_LINK_IS_MISSING')); $false = false; return $false; } // Load with previous data, if it exists $mailto = $app->input->post->getString('mailto', ''); $sender = $app->input->post->getString('sender', ''); $from = $app->input->post->getString('from', ''); $subject = $app->input->post->getString('subject', ''); if ($user->get('id') > 0) { $data->sender = $user->get('name'); $data->from = $user->get('email'); } else { $data->sender = $sender; $data->from = JStringPunycode::emailToPunycode($from); } $data->subject = $subject; $data->mailto = JStringPunycode::emailToPunycode($mailto); return $data; } } views/mailto/tmpl/default.php000066600000005262150773114070012315 0ustar00 get('data'); ?>

views/mailto/tmpl/index.html000066600000000037150773114070012150 0ustar00 views/mailto/metadata.xml000066600000000043150773114070011476 0ustar00 views/mailto/index.html000066600000000037150773114070011174 0ustar00 views/sent/view.html.php000066600000000753150773114070011316 0ustar00

views/sent/tmpl/index.html000066600000000037150773114070011634 0ustar00 views/sent/metadata.xml000066600000000746150773114070011174 0ustar00 Mailto Andrew Eddie 13 Mar 2006 Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org COM_MAILTO_XML_DESCRIPTION views/sent/index.html000066600000000037150773114070010660 0ustar00 mailto.php000066600000001067150773114070006557 0ustar00registerDefaultTask('mailto'); $controller->execute(JFactory::getApplication()->input->get('task')); //$controller->redirect(); index.html000066600000000037150773114070006552 0ustar00 controller.php000066600000007411150773114070007454 0ustar00set('com_mailto.formtime', time()); $this->input->set('view', 'mailto'); $this->display(); } /** * Send the message and display a notice * * @access public * @since 1.5 */ public function send() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $session = JFactory::getSession(); $timeout = $session->get('com_mailto.formtime', 0); if ($timeout == 0 || time() - $timeout < 20) { JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT')); return $this->mailto(); } $SiteName = $app->getCfg('sitename'); $link = MailtoHelper::validateHash($this->input->get('link', '', 'post')); // Verify that this is a local link if (!$link || !JUri::isInternal($link)) { //Non-local url... JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT')); return $this->mailto(); } // An array of email headers we do not want to allow as input $headers = array ( 'Content-Type:', 'MIME-Version:', 'Content-Transfer-Encoding:', 'bcc:', 'cc:'); // An array of the input fields to scan for injected headers $fields = array( 'mailto', 'sender', 'from', 'subject', ); /* * Here is the meat and potatoes of the header injection test. We * iterate over the array of form input and check for header strings. * If we find one, send an unauthorized header and die. */ foreach ($fields as $field) { foreach ($headers as $header) { if (strpos($_POST[$field], $header) !== false) { JError::raiseError(403, ''); } } } /* * Free up memory */ unset ($headers, $fields); $email = $this->input->post->getString('mailto', ''); $sender = $this->input->post->getString('sender', ''); $from = $this->input->post->getString('from', ''); $subject_default = JText::sprintf('COM_MAILTO_SENT_BY', $sender); $subject = $this->input->post->getString('subject', $subject_default); // Check for a valid to address $error = false; if (! $email || ! JMailHelper::isEmailAddress($email)) { $error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $email); JError::raiseWarning(0, $error); } // Check for a valid from address if (! $from || ! JMailHelper::isEmailAddress($from)) { $error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $from); JError::raiseWarning(0, $error); } if ($error) { return $this->mailto(); } // Build the message to send $msg = JText::_('COM_MAILTO_EMAIL_MSG'); $link = $link; $body = sprintf($msg, $SiteName, $sender, $from, $link); // Clean the email data $subject = JMailHelper::cleanSubject($subject); $body = JMailHelper::cleanBody($body); // To send we need to use punycode. $from = JStringPunycode::emailToPunycode($from); $from = JMailHelper::cleanAddress($from); $email = JStringPunycode::emailToPunycode($email); // Send the email if (JFactory::getMailer()->sendMail($from, $sender, $email, $subject, $body) !== true) { JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT')); return $this->mailto(); } $this->input->set('view', 'sent'); $this->display(); } } mailto.xml000066600000002343150773114070006566 0ustar00 com_mailto Joomla! Project April 2006 (C) 2005 - 2014 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 COM_MAILTO_XML_DESCRIPTION controller.php index.html mailto.php views language/en-GB.com_mailto.ini index.html language/en-GB.com_mailto.sys.ini helpers/mailto.php000066600000003443150773114070010221 0ustar00get('com_mailto.links', array()); if (!isset($mailto_links[$hash])) { $mailto_links[$hash] = new stdClass; } $mailto_links[$hash]->link = $url; $mailto_links[$hash]->expiry = time(); $session->set('com_mailto.links', $mailto_links); return $hash; } /** * Checks if a URL is a Flash file * * @param string * @return URL */ public static function validateHash($hash) { $retval = false; $session = JFactory::getSession(); self::cleanHashes(); $mailto_links = $session->get('com_mailto.links', array()); if (isset($mailto_links[$hash])) { $retval = $mailto_links[$hash]->link; } return $retval; } /** * Cleans out old hashes * * @since 1.6.1 */ public static function cleanHashes($lifetime = 1440) { // flag for if we've cleaned on this cycle static $cleaned = false; if (!$cleaned) { $past = time() - $lifetime; $session = JFactory::getSession(); $mailto_links = $session->get('com_mailto.links', array()); foreach ($mailto_links as $index => $link) { if ($link->expiry < $past) { unset($mailto_links[$index]); } } $session->set('com_mailto.links', $mailto_links); $cleaned = true; } } } helpers/index.html000066600000000037150773114070010214 0ustar00