summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-05-26 10:35:26 +0200
committerAleksander Machniak <alec@alec.pl>2012-05-26 10:35:26 +0200
commitead98f4efb712deb124655fd6fe0bf30d8e642c5 (patch)
tree349b9cdadccd50c9817e5b4b4ba6e30024b5f4fa /program
parent9a8a86efcae2c3c5ff36f71cbba7acd5ce3d4c6f (diff)
parentd4d2e427a561d2fc93e6922f7c6d0ea3e8f6f4a9 (diff)
Merge branch 'release-0.8' of github.com:roundcube/roundcubemail into release-0.8
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_session.php35
-rw-r--r--program/localization/en_US/labels.inc3
-rw-r--r--program/steps/settings/func.inc12
-rw-r--r--program/steps/settings/save_prefs.inc1
4 files changed, 34 insertions, 17 deletions
diff --git a/program/include/rcube_session.php b/program/include/rcube_session.php
index 53042b3bf..4ac395472 100644
--- a/program/include/rcube_session.php
+++ b/program/include/rcube_session.php
@@ -40,7 +40,7 @@ class rcube_session
private $unsets = array();
private $gc_handlers = array();
private $cookiename = 'roundcube_sessauth';
- private $vars = false;
+ private $vars;
private $key;
private $now;
private $secret = '';
@@ -137,11 +137,10 @@ class rcube_session
$this->vars = base64_decode($sql_arr['vars']);
$this->key = $key;
- if (!empty($this->vars))
- return $this->vars;
+ return !empty($this->vars) ? (string) $this->vars : '';
}
- return false;
+ return null;
}
@@ -160,7 +159,7 @@ class rcube_session
// no session row in DB (db_read() returns false)
if (!$this->key) {
- $oldvars = false;
+ $oldvars = null;
}
// use internal data from read() for fast requests (up to 0.5 sec.)
else if ($key == $this->key && (!$this->vars || $ts - $this->start < 0.5)) {
@@ -170,7 +169,7 @@ class rcube_session
$oldvars = $this->db_read($key);
}
- if ($oldvars !== false) {
+ if ($oldvars !== null) {
$newvars = $this->_fixvars($vars, $oldvars);
if ($newvars !== $oldvars) {
@@ -200,7 +199,7 @@ class rcube_session
*/
private function _fixvars($vars, $oldvars)
{
- if ($oldvars !== false) {
+ if ($oldvars !== null) {
$a_oldvars = $this->unserialize($oldvars);
if (is_array($a_oldvars)) {
foreach ((array)$this->unsets as $k)
@@ -268,13 +267,13 @@ class rcube_session
$this->vars = $arr['vars'];
$this->key = $key;
- if (!empty($this->vars))
- return $this->vars;
+ return !empty($this->vars) ? (string) $this->vars : '';
}
- return false;
+ return null;
}
+
/**
* Save session data.
* handler for session_read()
@@ -289,21 +288,22 @@ class rcube_session
// no session data in cache (mc_read() returns false)
if (!$this->key)
- $oldvars = false;
+ $oldvars = null;
// use internal data for fast requests (up to 0.5 sec.)
else if ($key == $this->key && (!$this->vars || $ts - $this->start < 0.5))
$oldvars = $this->vars;
else // else read data again
$oldvars = $this->mc_read($key);
- $newvars = $oldvars !== false ? $this->_fixvars($vars, $oldvars) : $vars;
-
+ $newvars = $oldvars !== null ? $this->_fixvars($vars, $oldvars) : $vars;
+
if ($newvars !== $oldvars || $ts - $this->changed > $this->lifetime / 2)
return $this->memcache->set($key, serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars)), MEMCACHE_COMPRESSED, $this->lifetime);
-
+
return true;
}
+
/**
* Handler for session_destroy() with memcache backend
*
@@ -352,7 +352,7 @@ class rcube_session
{
session_regenerate_id($destroy);
- $this->vars = false;
+ $this->vars = null;
$this->key = session_id();
return true;
@@ -375,13 +375,14 @@ class rcube_session
return true;
}
-
+
+
/**
* Kill this session
*/
public function kill()
{
- $this->vars = false;
+ $this->vars = null;
$this->ip = $_SERVER['REMOTE_ADDR']; // update IP (might have changed)
$this->destroy(session_id());
rcmail::setcookie($this->cookiename, '-del-', time() - 60);
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 277f1a954..94bae1974 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -457,6 +457,9 @@ $labels['spellcheckignorenums'] = 'Ignore words with numbers';
$labels['spellcheckignorecaps'] = 'Ignore words with all letters capitalized';
$labels['addtodict'] = 'Add to dictionary';
$labels['mailtoprotohandler'] = 'Register protocol handler for mailto: links';
+$labels['forwardmode'] = 'Messages forwarding';
+$labels['inline'] = 'inline';
+$labels['asattachment'] = 'as attachment';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folders';
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index d2db1dfdd..dc7c68e3b 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -620,6 +620,18 @@ function rcmail_user_prefs($current=null)
);
}
+ if (!isset($no_override['forward_attachment'])) {
+ $field_id = 'rcmfd_forward_attachment';
+ $select = new html_select(array('name' => '_forward_attachment', 'id' => $field_id));
+ $select->add(rcube_label('inline'), 0);
+ $select->add(rcube_label('asattachment'), 1);
+
+ $blocks['main']['options']['forward_attachment'] = array(
+ 'title' => html::label($field_id, Q(rcube_label('forwardmode'))),
+ 'content' => $select->show(intval($config['forward_attachment'])),
+ );
+ }
+
if (!isset($no_override['default_font'])) {
$field_id = 'rcmfd_default_font';
$fonts = rcube_fontdefs();
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index f521f4f34..cacc359e9 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -89,6 +89,7 @@ switch ($CURR_SECTION)
'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
'sig_above' => !empty($_POST['_sig_above']) && !empty($_POST['_top_posting']),
'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST),
+ 'forward_attachment' => !empty($_POST['_forward_attachment']),
);
break;