From 2712e3200c69aa2ebcfe488d7941c3ad77c917bb Mon Sep 17 00:00:00 2001 From: "GDR\\!" Date: Thu, 24 May 2012 11:56:39 +0200 Subject: Password plugin made compatible with modern Virtualmin Added a new username format in Virtualmin driver, which works for default Virtualmin settings where username is user.postfix and domain is taken from email address. Example: email - info@goodcoffee.com login - info.goodcof --- plugins/password/config.inc.php.dist | 3 ++- plugins/password/drivers/virtualmin.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist index aed0eaf28..37c79315d 100644 --- a/plugins/password/config.inc.php.dist +++ b/plugins/password/config.inc.php.dist @@ -308,7 +308,8 @@ $rcmail_config['hmailserver_server'] = array( // 5: domain-username // 6: username_domain // 7: domain_username -$rcmail_config['password_virtualmin_format'] = 0; +// 8: username@domain; mbox.username +$rcmail_config['password_virtualmin_format'] = 8; // pw_usermod Driver options diff --git a/plugins/password/drivers/virtualmin.php b/plugins/password/drivers/virtualmin.php index b2547e07f..f6b9bd412 100644 --- a/plugins/password/drivers/virtualmin.php +++ b/plugins/password/drivers/virtualmin.php @@ -48,6 +48,10 @@ class rcube_virtualmin_password $pieces = explode("_", $username); $domain = $pieces[0]; break; + case 8: // domain taken from alias, username left as it was + $email = $rcmail->user->data['alias']; + $domain = substr(strrchr($email, "@"), 1); + break default: // username@domain $domain = substr(strrchr($username, "@"), 1); } -- cgit v1.2.3 From f38035da17957f7bab514381044013a54ea19d8c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 24 May 2012 12:39:02 +0200 Subject: Remove possible confusion on session reads - PHP expects string result not boolean --- program/include/rcube_session.php | 35 ++++++++++++++++++----------------- 1 file changed, 18 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); -- cgit v1.2.3 From c993e10d07d76ef7f24b45bc9e7c1c1115c85980 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 24 May 2012 18:18:47 +0200 Subject: Fixes for IE: better background for Hide/Show button, fixed invisible button in IE8 --- plugins/hide_blockquote/hide_blockquote.js | 2 +- plugins/hide_blockquote/skins/default/style.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/hide_blockquote/hide_blockquote.js b/plugins/hide_blockquote/hide_blockquote.js index 9ab90af0d..20286ee14 100644 --- a/plugins/hide_blockquote/hide_blockquote.js +++ b/plugins/hide_blockquote/hide_blockquote.js @@ -24,7 +24,7 @@ function hide_blockquote() .css({'white-space': 'nowrap', overflow: 'hidden', position: 'relative'}) .text(res[0]); - link = $('') + link = $('') .css({position: 'absolute', 'z-Index': 2}) .text(rcmail.gettext('hide_blockquote.show')) .data('parent', div) diff --git a/plugins/hide_blockquote/skins/default/style.css b/plugins/hide_blockquote/skins/default/style.css index 7b3c871c3..198172f92 100644 --- a/plugins/hide_blockquote/skins/default/style.css +++ b/plugins/hide_blockquote/skins/default/style.css @@ -17,7 +17,7 @@ span.blockquote-link { border-top: none; border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; - background: #fff; + background: #f8f8f8; background: -moz-linear-gradient(top, #f8f8f8 0%, #e8e8e8 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#e8e8e8)); background: -o-linear-gradient(top, #f8f8f8 0%, #e8e8e8 100%); -- cgit v1.2.3 From 524ead187ac560e2b199bef18b89e46e03b86242 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 25 May 2012 13:45:38 +0200 Subject: Move messages forwarding mode setting into Preferences Conflicts: CHANGELOG --- CHANGELOG | 1 + program/localization/en_US/labels.inc | 3 +++ program/steps/settings/func.inc | 12 ++++++++++++ program/steps/settings/save_prefs.inc | 1 + skins/default/includes/messagetoolbar.html | 12 +++--------- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e38a50990..330e90c52 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Move messages forwarding mode setting into Preferences - Fix HTML entities handling in HTML editor (#1488483) - Fix listing shared folders on Courier IMAP (#1488466) 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 48d1d5a0b..794335958 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -617,6 +617,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; diff --git a/skins/default/includes/messagetoolbar.html b/skins/default/includes/messagetoolbar.html index 57bed8a34..3f4995b83 100644 --- a/skins/default/includes/messagetoolbar.html +++ b/skins/default/includes/messagetoolbar.html @@ -26,15 +26,9 @@
-
    -
  • - - -
  • -
  • - - -
  • +
      +
    • +
-- cgit v1.2.3 From d4d2e427a561d2fc93e6922f7c6d0ea3e8f6f4a9 Mon Sep 17 00:00:00 2001 From: Raoul Bhatia Date: Wed, 23 May 2012 15:34:33 +0200 Subject: improve .htaccess security rules: 1. also prevent access to .gitignore 2. make the second security rule work as expected 3. include README.md in security rules --- .htaccess | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index d5ebe4c20..82afe76de 100644 --- a/.htaccess +++ b/.htaccess @@ -30,8 +30,8 @@ php_value mbstring.func_overload 0 RewriteEngine On RewriteRule ^favicon\.ico$ skins/default/images/favicon.ico # security rules -RewriteRule .git/ - [F] -RewriteRule ^README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ - [F] +RewriteRule .git - [F] +RewriteRule ^/?(README(.md)?|INSTALL|LICENSE|SQL|bin|CHANGELOG)$ - [F] -- cgit v1.2.3