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.html 0000666 00000000037 15077311407 0007707 0 ustar 00
views/mailto/view.html.php 0000666 00000003033 15077311407 0011624 0 ustar 00 getData();
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.php 0000666 00000005262 15077311407 0012315 0 ustar 00
get('data');
?>
views/mailto/tmpl/index.html 0000666 00000000037 15077311407 0012150 0 ustar 00
views/mailto/metadata.xml 0000666 00000000043 15077311407 0011476 0 ustar 00
views/mailto/index.html 0000666 00000000037 15077311407 0011174 0 ustar 00
views/sent/view.html.php 0000666 00000000753 15077311407 0011316 0 ustar 00
views/sent/tmpl/index.html 0000666 00000000037 15077311407 0011634 0 ustar 00
views/sent/metadata.xml 0000666 00000000746 15077311407 0011174 0 ustar 00
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.html 0000666 00000000037 15077311407 0010660 0 ustar 00
mailto.php 0000666 00000001067 15077311407 0006557 0 ustar 00 registerDefaultTask('mailto');
$controller->execute(JFactory::getApplication()->input->get('task'));
//$controller->redirect();
index.html 0000666 00000000037 15077311407 0006552 0 ustar 00
controller.php 0000666 00000007411 15077311407 0007454 0 ustar 00 set('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.xml 0000666 00000002343 15077311407 0006566 0 ustar 00
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.php 0000666 00000003443 15077311407 0010221 0 ustar 00 get('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.html 0000666 00000000037 15077311407 0010214 0 ustar 00