alecpl
2010-01-25 580ff9c55e81aae04add43c95071c57e346a19ce
program/steps/mail/rss.inc
@@ -5,7 +5,7 @@
 | program/steps/mail/rss.inc                                            |
 |                                                                       |
 | This file is part of the RoundCube Webmail client                     |
 | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | PURPOSE:                                                              |
@@ -19,8 +19,6 @@
*/
require_once('Mail/mimeDecode.php');
function rss_encode($string){
   $string = rep_specialchars_output($string, 'xml');
@@ -28,12 +26,11 @@
}
$REMOTE_REQUEST = TRUE;
$OUTPUT_TYPE = 'rss';
$webmail_url = 'http';
if (strstr('HTTPS', $_SERVER['SERVER_PROTOCOL'] )!== FALSE)
if (strstr('HTTPS', $_SERVER['SERVER_PROTOCOL'] )!== FALSE || $RCMAIL->config->get('use_https'))
  $webmail_url .= 's';
$webmail_url .= '://'.$_SERVER['SERVER_NAME'];
if ($_SERVER['SERVER_PORT'] != '80')
@@ -42,7 +39,7 @@
if (dirname($_SERVER['SCRIPT_NAME']) != '/')
   $webmail_url .= dirname($_SERVER['SCRIPT_NAME']).'/';
$auth_webmail_url = $webmail_url.'?_auth='.$GLOBALS['sess_auth'];
$webmail_url .= '?_task=mail';
$messagecount_unread = $IMAP->messagecount('INBOX', 'UNSEEN', TRUE);
$messagecount = $IMAP->messagecount();
@@ -52,7 +49,7 @@
// Send global XML output
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>
echo '<?xml version="1.0" encoding="'.RCMAIL_CHARSET.'"?>
   <rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
@@ -68,7 +65,7 @@
      <ttl>5</ttl>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs>
      <description>INBOX contains '.$messagecount.' messages, of which '.$messagecount_unread.' unread</description>
      <link>'.rss_encode($auth_webmail_url, 'xml') .'</link>
      <link>'.rss_encode($webmail_url, 'xml') .'</link>
      <title>webmail for '.rss_encode($_SESSION['username'].' @ '.$_SESSION['imap_host']).'</title>
      <generator>'.rss_encode($CONFIG['useragent'], 'xml').' (RSS extension by Sjon Hortensius)</generator>
      <image>
@@ -79,7 +76,7 @@
// Check if the user wants to override the default sortingmethode
if (isset($_GET['_sort']))
  list($sort_col, $sort_order) = explode('_', $_GET['_sort']);
  list($sort_col, $sort_order) = explode('_', get_input_value('_sort', RCUBE_INPUT_GET));
// Add message to output
if ($messagecount > 0)
@@ -92,7 +89,7 @@
    if (strstr($item->from, '<'))
      $item->from = preg_replace('~"?([^"]*)"? <([^>]*)>~', '\2 (\1)', $item->from);
    $item->link = $auth_webmail_url.'&_task=mail&_action=show&_uid='.$item->uid.'&_mbox=INBOX';
    $item->link = $webmail_url.'&_task=mail&_action=show&_uid='.$item->uid.'&_mbox=INBOX';
    $item->body = $IMAP->get_body($item->uid);
@@ -114,4 +111,4 @@
</rss>';
exit;
?>
?>