From f12585297974a994bd9b081cd1d70e8ab8d2365e Mon Sep 17 00:00:00 2001 From: jeremie kornobis Date: Mon, 26 Nov 2012 14:12:48 +0100 Subject: Add new identity level: one identity with edit only signature --- program/steps/settings/edit_identity.inc | 7 +++++++ program/steps/settings/save_identity.inc | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'program/steps/settings') diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc index aa1aeea5d..7e7be1f83 100644 --- a/program/steps/settings/edit_identity.inc +++ b/program/steps/settings/edit_identity.inc @@ -97,6 +97,13 @@ function rcube_identity_form($attrib) $form['addressing']['content']['email']['class'] = 'disabled'; } + if (IDENTITIES_LEVEL == 4) { + foreach($form['addressing']['content'] as $formfield => $value){ + $form['addressing']['content'][$formfield]['disabled'] = true; + $form['addressing']['content'][$formfield]['class'] = 'disabled'; + } + } + $IDENTITY_RECORD['email'] = rcube_idn_to_utf8($IDENTITY_RECORD['email']); // Allow plugins to modify identity form content diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index 8515c44f1..7ca54a179 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -26,7 +26,7 @@ $a_boolean_cols = array('standard', 'html_signature'); $updated = $default_id = false; // check input -if (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3)) +if (IDENTITIES_LEVEL != 4 && (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3))) { $OUTPUT->show_message('formincomplete', 'warning'); rcmail_overwrite_action('edit-identity'); -- cgit v1.2.3 From c753bc4a8bc96680e0534ab115cb2f0f1fc67512 Mon Sep 17 00:00:00 2001 From: jeremie kornobis Date: Mon, 26 Nov 2012 15:06:54 +0100 Subject: unset email address with new level entity 4 --- program/steps/settings/save_identity.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'program/steps/settings') diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index 7ca54a179..c3b8cc4a7 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -52,9 +52,18 @@ foreach ($a_boolean_cols as $col) } // unset email address if user has no rights to change it -if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) +if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3 ) unset($save_data['email']); +if (IDENTITIES_LEVEL == 4 ){ + unset($save_data['name']); + unset($save_data['email']); + unset($save_data['organization']); + unset($save_data['reply-to']); + unset($save_data['bcc']); + unset($save_data['standard']); +} + // Validate e-mail addresses $email_checks = array(rcube_idn_to_ascii($save_data['email'])); foreach (array('reply-to', 'bcc') as $item) { -- cgit v1.2.3 From 876d31d5940f3c4c2f683891130db0201f4a3913 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 29 Nov 2012 09:01:29 +0100 Subject: Fix empty email on identities list after identity update (#1488834) --- CHANGELOG | 1 + program/steps/settings/save_identity.inc | 48 +++++++++++++++++--------------- 2 files changed, 26 insertions(+), 23 deletions(-) (limited to 'program/steps/settings') diff --git a/CHANGELOG b/CHANGELOG index 69b5a030a..ae6d27398 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix empty email on identities list after identity update (#1488834) - Add new identities_level: (4) one identity with possibility to edit only signature - Use Delivered-To header as a last resort for identity selection (#1488840) - Fix XSS vulnerability using Flash files (#1488828) diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index 88adc795e..34d8be268 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -26,17 +26,14 @@ $a_boolean_cols = array('standard', 'html_signature'); $updated = $default_id = false; // check input -if (IDENTITIES_LEVEL != 4 && (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3))) -{ +if (IDENTITIES_LEVEL != 4 && (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3))) { $OUTPUT->show_message('formincomplete', 'warning'); rcmail_overwrite_action('edit-identity'); return; } - $save_data = array(); -foreach ($a_save_cols as $col) -{ +foreach ($a_save_cols as $col) { $fname = '_'.$col; if (isset($_POST[$fname])) $save_data[$col] = get_input_value($fname, RCUBE_INPUT_POST, true); @@ -44,24 +41,23 @@ foreach ($a_save_cols as $col) // set "off" values for checkboxes that were not checked, and therefore // not included in the POST body. -foreach ($a_boolean_cols as $col) -{ +foreach ($a_boolean_cols as $col) { $fname = '_' . $col; if (!isset($_POST[$fname])) $save_data[$col] = 0; } // unset email address if user has no rights to change it -if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3 ) - unset($save_data['email']); - -if (IDENTITIES_LEVEL == 4 ){ - unset($save_data['name']); +if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) { unset($save_data['email']); - unset($save_data['organization']); - unset($save_data['reply-to']); - unset($save_data['bcc']); - unset($save_data['standard']); +} +// unset all fields except signature +else if (IDENTITIES_LEVEL == 4) { + foreach ($save_data as $idx => $value) { + if ($idx != 'signature' && $idx != 'html_signature') { + unset($save_data[$idx]); + } + } } // Validate e-mail addresses @@ -81,9 +77,16 @@ foreach ($email_checks as $email) { } // update an existing contact -if ($_POST['_iid']) -{ +if ($_POST['_iid']) { $iid = get_input_value('_iid', RCUBE_INPUT_POST); + + if (in_array(IDENTITIES_LEVEL, array(1,3,4))) { + // merge with old identity data, fixes #1488834 + $identity = $RCMAIL->user->get_identity($iid); + $save_data = array_merge($identity, $save_data); + unset($save_data['changed'], $save_data['del'], $save_data['user_id'], $save_data['identity_id']); + } + $plugin = $RCMAIL->plugins->exec_hook('identity_update', array('id' => $iid, 'record' => $save_data)); $save_data = $plugin['record']; @@ -97,8 +100,8 @@ if ($_POST['_iid']) if ($updated) { $OUTPUT->show_message('successfullysaved', 'confirmation'); - if (!empty($_POST['_standard'])) - $default_id = get_input_value('_iid', RCUBE_INPUT_POST); + if (!empty($save_data['standard'])) + $default_id = $iid; if ($_POST['_framed']) { // update the changed col in list @@ -114,8 +117,7 @@ if ($_POST['_iid']) } // insert a new identity record -else if (IDENTITIES_LEVEL < 2) -{ +else if (IDENTITIES_LEVEL < 2) { if (IDENTITIES_LEVEL == 1) { $save_data['email'] = $RCMAIL->get_user_email(); } @@ -136,7 +138,7 @@ else if (IDENTITIES_LEVEL < 2) $_GET['_iid'] = $insert_id; - if (!empty($_POST['_standard'])) + if (!empty($save_data['standard'])) $default_id = $insert_id; if ($_POST['_framed']) { -- cgit v1.2.3 From cf8b9fc004e67bd5f8d7b0bf7f573020bcb33804 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 7 Mar 2013 14:10:21 +0100 Subject: Move spellcheck options section below signature options section --- program/steps/settings/func.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'program/steps/settings') diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 3bcca21bf..2f726c7e8 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -483,8 +483,8 @@ function rcmail_user_prefs($current=null) $blocks = array( 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))), 'sig' => array('name' => Q(rcube_label('signatureoptions'))), + 'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))), ); // show checkbox to compose messages in a new window -- cgit v1.2.3 From 1d4c84f4d74217a6639b143c14c99e3473fc539a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 26 Mar 2013 19:36:47 +0100 Subject: Remove sig_above configuration option, use reply_mode only (#1489001) --- CHANGELOG | 1 + config/main.inc.php.dist | 3 --- program/js/app.js | 6 +++--- program/localization/en_US/labels.inc | 3 --- program/steps/mail/compose.inc | 3 +-- program/steps/settings/func.inc | 15 +-------------- program/steps/settings/save_prefs.inc | 1 - 7 files changed, 6 insertions(+), 26 deletions(-) (limited to 'program/steps/settings') diff --git a/CHANGELOG b/CHANGELOG index c1032630b..0dc5d94cc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Remove sig_above configuration option, use reply_mode only (#1489001) - Refresh current folder in opener window after draft save or message sent (#1488997) - Fix saving draft just after entering compose window (#1489012) - Call resize handler in intervals to prevent lags and double onresize calls in Chrome (#1489005) diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index b113b41a8..5a652a5b1 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -835,9 +835,6 @@ $rcmail_config['strip_existing_sig'] = true; // 3 - Forwards and Replies only $rcmail_config['show_sig'] = 1; -// When replying or forwarding place sender's signature above existing message -$rcmail_config['sig_above'] = false; - // Use MIME encoding (quoted-printable) for 8bit characters in message body $rcmail_config['force_7bit'] = false; diff --git a/program/js/app.js b/program/js/app.js index 758e4b893..ad82ba579 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3376,7 +3376,7 @@ function rcube_webmail() sig = this.env.signatures[sig].text; sig = sig.replace(/\r\n/g, '\n'); - p = this.env.sig_above ? message.indexOf(sig) : message.lastIndexOf(sig); + p = this.env.top_posting ? message.indexOf(sig) : message.lastIndexOf(sig); if (p >= 0) message = message.substring(0, p) + message.substring(p+sig.length, message.length); } @@ -3385,7 +3385,7 @@ function rcube_webmail() sig = this.env.signatures[id].text; sig = sig.replace(/\r\n/g, '\n'); - if (this.env.sig_above) { + if (this.env.top_posting) { if (p >= 0) { // in place of removed signature message = message.substring(0, p) + sig + message.substring(p, message.length); cursor_pos = p - 1; @@ -3429,7 +3429,7 @@ function rcube_webmail() sigElem = doc.createElement('div'); sigElem.setAttribute('id', '_rc_sig'); - if (this.env.sig_above) { + if (this.env.top_posting) { // if no existing sig and top posting then insert at caret pos editor.getWin().focus(); // correct focus in IE & Chrome diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 252e0ce68..0a4e329e5 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -454,9 +454,6 @@ $labels['replyremovesignature'] = 'When replying remove original signature from $labels['autoaddsignature'] = 'Automatically add signature'; $labels['newmessageonly'] = 'new message only'; $labels['replyandforwardonly'] = 'replies and forwards only'; -$labels['replysignaturepos'] = 'When replying or forwarding place signature'; -$labels['belowquote'] = 'below the quote'; -$labels['abovequote'] = 'above the quote'; $labels['insertsignature'] = 'Insert signature'; $labels['previewpanemarkread'] = 'Mark previewed messages as read'; $labels['afternseconds'] = 'after $n seconds'; diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 129d43701..cc7cf687f 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -139,7 +139,6 @@ if (!empty($CONFIG['drafts_mbox'])) { } // set current mailbox in client environment $OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder()); -$OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false)); $OUTPUT->set_env('top_posting', intval($RCMAIL->config->get('reply_mode')) > 0); $OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ','))); @@ -462,7 +461,7 @@ function rcmail_compose_header_from($attrib) if (count($MESSAGE->identities)) { $a_signatures = array(); - $separator = $RCMAIL->config->get('sig_above') + $separator = intval($RCMAIL->config->get('reply_mode')) > 0 && ($compose_mode == RCUBE_COMPOSE_REPLY || $compose_mode == RCUBE_COMPOSE_FORWARD) ? '---' : '-- '; $field_attrib['onchange'] = JS_OBJECT_NAME.".change_identity(this)"; diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 2f726c7e8..319c58db9 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -581,8 +581,7 @@ function rcmail_user_prefs($current=null) if (!isset($no_override['reply_mode'])) { $field_id = 'rcmfd_reply_mode'; - $select_replymode = new html_select(array('name' => '_reply_mode', 'id' => $field_id, - 'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex<2)")); + $select_replymode = new html_select(array('name' => '_reply_mode', 'id' => $field_id)); $select_replymode->add(rcube_label('replyempty'), -1); $select_replymode->add(rcube_label('replybottomposting'), 0); $select_replymode->add(rcube_label('replytopposting'), 1); @@ -631,18 +630,6 @@ function rcmail_user_prefs($current=null) ); } - if (!isset($no_override['sig_above'])) { - $field_id = 'rcmfd_sig_above'; - $select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => $config['reply_mode'] < 1)); - $select_sigabove->add(rcube_label('belowquote'), 0); - $select_sigabove->add(rcube_label('abovequote'), 1); - - $blocks['sig']['options']['sig_above'] = array( - 'title' => html::label($field_id, Q(rcube_label('replysignaturepos'))), - 'content' => $select_sigabove->show($config['sig_above']?1:0), - ); - } - if (!isset($no_override['strip_existing_sig'])) { $field_id = 'rcmfd_strip_existing_sig'; $input_stripexistingsig = new html_checkbox(array('name' => '_strip_existing_sig', 'id' => $field_id, 'value' => 1)); diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 5daab0d24..140f173c6 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -86,7 +86,6 @@ switch ($CURR_SECTION) 'show_sig' => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1, 'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0, 'strip_existing_sig' => isset($_POST['_strip_existing_sig']), - 'sig_above' => !empty($_POST['_sig_above']) && $_POST['_reply_mode'] > 0, 'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST), 'forward_attachment' => !empty($_POST['_forward_attachment']), ); -- cgit v1.2.3