diff options
author | thomascube <thomas@roundcube.net> | 2012-04-24 06:40:56 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2012-04-24 06:40:56 +0000 |
commit | 988a80ad673ff77e2d3027098e245be8a15aaf33 (patch) | |
tree | 83e43d6996f1874626fe27d433cdbd50126e284d /program/include | |
parent | 19d5973247d1476a7c566692a412508638ff344d (diff) |
Bring back some legacy functions and session vars for better backwards compatibility
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube.php | 1 | ||||
-rw-r--r-- | program/include/rcube_bc.inc | 5 | ||||
-rw-r--r-- | program/include/rcube_output.php | 15 |
3 files changed, 21 insertions, 0 deletions
diff --git a/program/include/rcube.php b/program/include/rcube.php index 66715ed85..55dc4ee77 100644 --- a/program/include/rcube.php +++ b/program/include/rcube.php @@ -348,6 +348,7 @@ class rcube $options['port'] = $_SESSION['storage_port']; $options['ssl'] = $_SESSION['storage_ssl']; $options['password'] = $this->decrypt($_SESSION['password']); + $_SESSION[$driver.'_host'] = $_SESSION['storage_host']; } $options = $this->plugins->exec_hook("storage_init", $options); diff --git a/program/include/rcube_bc.inc b/program/include/rcube_bc.inc index 40725b4ee..d416773fc 100644 --- a/program/include/rcube_bc.inc +++ b/program/include/rcube_bc.inc @@ -385,3 +385,8 @@ function rcube_idn_to_utf8($str) { return rcube_utils::idn_to_utf8($str); } + +function send_future_expire_header($offset = 2600000) +{ + return rcmail::get_instance()->output->future_expire_header($offset); +} diff --git a/program/include/rcube_output.php b/program/include/rcube_output.php index 4a51b5efe..e1d5e43b8 100644 --- a/program/include/rcube_output.php +++ b/program/include/rcube_output.php @@ -237,6 +237,21 @@ abstract class rcube_output } } + /** + * Send header with expire date 30 days in future + * + * @param int Expiration time in seconds + */ + public function future_expire_header($offset = 2600000) + { + if (headers_sent()) + return; + + header("Expires: " . gmdate("D, d M Y H:i:s", time()+$offset) . " GMT"); + header("Cache-Control: max-age=$offset"); + header("Pragma: "); + } + /** * Show error page and terminate script execution |