diff options
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/addressbook/func.inc | 7 | ||||
-rw-r--r-- | program/steps/addressbook/import.inc | 17 | ||||
-rw-r--r-- | program/steps/addressbook/save.inc | 10 | ||||
-rw-r--r-- | program/steps/addressbook/show.inc | 3 | ||||
-rw-r--r-- | program/steps/mail/check_recent.inc | 10 | ||||
-rw-r--r-- | program/steps/mail/compose.inc | 32 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 73 | ||||
-rw-r--r-- | program/steps/mail/get.inc | 36 | ||||
-rw-r--r-- | program/steps/mail/sendmail.inc | 2 | ||||
-rw-r--r-- | program/steps/settings/folders.inc | 7 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 42 | ||||
-rw-r--r-- | program/steps/settings/identities.inc | 6 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 28 |
13 files changed, 185 insertions, 88 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 3a0508025..cefe49e01 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -367,12 +367,7 @@ function rcmail_contact_frame($attrib) if (!$attrib['id']) $attrib['id'] = 'rcmcontactframe'; - $attrib['name'] = $attrib['id']; - - $OUTPUT->set_env('contentframe', $attrib['name']); - $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif'); - - return html::iframe($attrib); + return $OUTPUT->frame($attrib, true); } diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc index fb2251f18..6d60f829c 100644 --- a/program/steps/addressbook/import.inc +++ b/program/steps/addressbook/import.inc @@ -64,7 +64,7 @@ function rcmail_import_form($attrib) $OUTPUT->add_label('selectimportfile','importwait'); $OUTPUT->add_gui_object('importform', $attrib['id']); - $out = html::p(null, Q(rcube_label('importtext'), 'show')); + $out = html::p(null, Q(rcube_label('importdesc'), 'show')); $out .= $OUTPUT->form_tag(array( 'action' => $RCMAIL->url('import'), @@ -159,11 +159,22 @@ if (is_array($_FILES['_file'])) { $upload_error = $err; } else { + $file_content = file_get_contents($filepath); + // let rcube_vcard do the hard work :-) $vcard_o = new rcube_vcard(); $vcard_o->extend_fieldmap($CONTACTS->vcard_map); + $v_list = $vcard_o->import($file_content); + + if (!empty($v_list)) { + $vcards = array_merge($vcards, $v_list); + continue; + } - $v_list = $vcard_o->import(file_get_contents($filepath)); + // no vCards found, try CSV + $csv = new rcube_csv2vcard($_SESSION['language']); + $csv->import($file_content); + $v_list = $csv->export(); if (!empty($v_list)) { $vcards = array_merge($vcards, $v_list); @@ -181,7 +192,7 @@ if (is_array($_FILES['_file'])) { $OUTPUT->show_message('fileuploaderror', 'error'); } else { - $OUTPUT->show_message('importerror', 'error'); + $OUTPUT->show_message('importformaterror', 'error'); } } else { diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 887e49827..901ea0190 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -179,18 +179,24 @@ else { $insert_id = $plugin['result']; if ($insert_id) { + $CONTACTS->reset(); + // add new contact to the specified group if ($CONTACTS->groups && $CONTACTS->group_id) { $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array( 'group_id' => $CONTACTS->group_id, 'ids' => $insert_id, 'source' => $source)); + $counts = $CONTACTS->count(); + if (!$plugin['abort']) { - if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + 1 > $maxnum)) + if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($counts->count + 1 > $maxnum)) $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum)); $CONTACTS->add_to_group($gid, $plugin['ids']); } } + else + $counts = $CONTACTS->count(); if ((string)$source === (string)$orig_source) { // add contact row or jump to the page where it should appear @@ -202,7 +208,7 @@ else { // update record count display $CONTACTS->reset(); - $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text()); + $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text($counts)); } else { // re-set iframe diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc index 48e37256d..16be89f94 100644 --- a/program/steps/addressbook/show.inc +++ b/program/steps/addressbook/show.inc @@ -5,7 +5,7 @@ | program/steps/addressbook/show.inc | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2005-2009, The Roundcube Dev Team | + | Copyright (C) 2005-2012, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -32,6 +32,7 @@ $SOURCE_ID = $source; if ($cid && ($record = $CONTACTS->get_record($cid, true))) { $OUTPUT->set_env('readonly', $CONTACTS->readonly || $record['readonly']); $OUTPUT->set_env('cid', $record['ID']); + $OUTPUT->set_env('compose_extwin', $RCMAIL->config->get('compose_extwin',false)); } // get address book name (for display) diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index 1a1b08c60..90d17c15b 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -19,8 +19,14 @@ +-----------------------------------------------------------------------+ */ +// If there's no folder or messages list, there's nothing to update +// This can happen on 'refresh' request +if (empty($_REQUEST['_folderlist']) && empty($_REQUEST['_list'])) { + return; +} + $current = $RCMAIL->storage->get_folder(); -$check_all = !empty($_GET['_refresh']) || (bool)$RCMAIL->config->get('check_all_folders'); +$check_all = $RCMAIL->action != 'refresh' || (bool)$RCMAIL->config->get('check_all_folders'); // list of folders to check if ($check_all) { @@ -102,6 +108,4 @@ foreach ($a_mailboxes as $mbox_name) { } } -$RCMAIL->plugins->exec_hook('keep_alive', array()); - $OUTPUT->send(); diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 2d45105c2..ffc1c7518 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -611,13 +611,13 @@ function rcmail_compose_editor_mode() $useHtml = !empty($_POST['_is_html']); } else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) { - $useHtml = $MESSAGE->has_html_part(false); + $useHtml = $MESSAGE->has_html_part(false, true); } else if ($compose_mode == RCUBE_COMPOSE_REPLY) { - $useHtml = ($html_editor == 1 || ($html_editor >= 2 && $MESSAGE->has_html_part(false))); + $useHtml = ($html_editor == 1 || ($html_editor >= 2 && $MESSAGE->has_html_part(false, true))); } else if ($compose_mode == RCUBE_COMPOSE_FORWARD) { - $useHtml = ($html_editor == 1 || ($html_editor == 3 && $MESSAGE->has_html_part(false))); + $useHtml = ($html_editor == 1 || ($html_editor == 3 && $MESSAGE->has_html_part(false, true))); } else { $useHtml = ($html_editor == 1); @@ -730,6 +730,10 @@ function rcmail_compose_part_body($part, $isHtml = false) if ($isHtml) { if ($part->ctype_secondary == 'html') { } + else if ($part->ctype_secondary == 'enriched') { + require_once(INSTALL_PATH . 'program/lib/enriched.inc'); + $body = enriched_to_html($body); + } else { // try to remove the signature if ($RCMAIL->config->get('strip_existing_sig', true)) { @@ -743,6 +747,12 @@ function rcmail_compose_part_body($part, $isHtml = false) } } else { + if ($part->ctype_secondary == 'enriched') { + require_once(INSTALL_PATH . 'program/lib/enriched.inc'); + $body = enriched_to_html($body); + $part->ctype_secondary = 'html'; + } + if ($part->ctype_secondary == 'html') { // use html part if it has been used for message (pre)viewing // decrease line length for quoting @@ -750,6 +760,10 @@ function rcmail_compose_part_body($part, $isHtml = false) $txt = new html2text($body, false, true, $len); $body = $txt->get_text(); } + else if ($part->ctype_secondary == 'enriched') { + require_once(INSTALL_PATH . 'program/lib/enriched.inc'); + $body = enriched_to_html($body); + } else { if ($part->ctype_secondary == 'plain' && $part->ctype_parameters['format'] == 'flowed') { $body = rcube_mime::unfold_flowed($body); @@ -906,9 +920,10 @@ function rcmail_create_reply_body($body, $bodyIsHtml) if (!$bodyIsHtml) { $body = preg_replace('/\r?\n/', "\n", $body); + $body = trim($body, "\n"); // soft-wrap and quote message text - $body = rcmail_wrap_and_quote(rtrim($body, "\n"), $LINE_LENGTH); + $body = rcmail_wrap_and_quote($body, $LINE_LENGTH); $prefix .= "\n"; $suffix = ''; @@ -953,8 +968,7 @@ function rcmail_create_forward_body($body, $bodyIsHtml) $date = format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')); $charset = $RCMAIL->output->get_charset(); - if (!$bodyIsHtml) - { + if (!$bodyIsHtml) { $prefix = "\n\n\n-------- " . rcube_label('originalmessage') . " --------\n"; $prefix .= rcube_label('subject') . ': ' . $MESSAGE->subject . "\n"; $prefix .= rcube_label('date') . ': ' . $date . "\n"; @@ -967,9 +981,9 @@ function rcmail_create_forward_body($body, $bodyIsHtml) $prefix .= rcube_label('replyto') . ': ' . $MESSAGE->get_header('replyto') . "\n"; $prefix .= "\n"; + $body = trim($body, "\r\n"); } - else - { + else { // set is_safe flag (we need this for html body washing) rcmail_check_safe($MESSAGE); // clean up html tags @@ -1614,7 +1628,7 @@ function rcmail_addressbook_list($attrib = array()) html_identifier($id), $class_name, $source['id'], - $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id))); + $js_id, (!empty($source['name']) ? $source['name'] : $id)); } $OUTPUT->add_gui_object('addressbookslist', $attrib['id']); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 47d1a484a..df83b03a8 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -471,7 +471,7 @@ function rcmail_messagecontent_frame($attrib) $OUTPUT->set_env('contentframe', $attrib['id']); $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif'); - return html::iframe($attrib); + return $OUTPUT->frame($attrib, true); } @@ -751,9 +751,10 @@ function rcmail_print_body($part, $p = array()) } // text/enriched else if ($data['type'] == 'enriched') { - $part->ctype_secondary = 'html'; require_once(INSTALL_PATH . 'program/lib/enriched.inc'); - $body = Q(enriched_to_html($data['body']), 'show'); + $body = enriched_to_html($data['body']); + $body = rcmail_wash_html($body, $data, $part->replaces); + $part->ctype_secondary = 'html'; } else { // assert plaintext @@ -801,8 +802,8 @@ function rcmail_plain_body($body, $flowed=false) // find/mark quoted lines... for ($n=0, $cnt=count($body); $n < $cnt; $n++) { - if ($body[$n][0] == '>' && preg_match('/^(>+\s*)+/', $body[$n], $regs)) { - $q = strlen(preg_replace('/\s/', '', $regs[0])); + if ($body[$n][0] == '>' && preg_match('/^(>+ {0,1})+/', $body[$n], $regs)) { + $q = substr_count($regs[0], '>'); $body[$n] = substr($body[$n], strlen($regs[0])); if ($q > $quote_level) { @@ -1186,7 +1187,9 @@ function rcmail_message_body($attrib) } // list images after mail body - if ($CONFIG['inline_images'] && !empty($MESSAGE->attachments)) { + if ($RCMAIL->config->get('inline_images', true) && !empty($MESSAGE->attachments)) { + $thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240); + foreach ($MESSAGE->attachments as $attach_prop) { // skip inline images if ($attach_prop->content_id && $attach_prop->disposition == 'inline') { @@ -1195,12 +1198,45 @@ function rcmail_message_body($attrib) // Content-Type: image/*... if (rcmail_part_image_type($attach_prop)) { - $out .= html::tag('hr') . html::p(array('align' => "center"), - html::img(array( - 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, true), - 'title' => $attach_prop->filename, - 'alt' => $attach_prop->filename, - ))); + // display thumbnails + if ($thumbnail_size) { + $show_link = array( + 'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false), + 'onclick' => sprintf( + 'return %s.command(\'load-attachment\',{part:\'%s\', mimetype:\'%s\'},this)', + JS_OBJECT_NAME, + $attach_prop->mime_id, + rcmail_fix_mimetype($attach_prop->mimetype)) + ); + $out .= html::p('image-attachment', + html::a($show_link + array('class' => 'image-link'), + html::img(array( + 'class' => 'image-thumbnail', + 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, true) . '&_thumb=1', + 'title' => $attach_prop->filename, + 'alt' => $attach_prop->filename, + 'style' => sprintf('max-width:%dpx; max-height:%dpx', $thumbnail_size, $thumbnail_size), + )) + ) . + html::span('image-filename', Q($attach_prop->filename)) . + html::span('image-filesize', Q($RCMAIL->show_bytes($attach_prop->size))) . + html::span('attachment-links', + html::a($show_link['href'] . '&_download=1', rcube_label('download')) + ) . + html::br(array('style' => 'clear:both')) + ); + } + else { + $out .= html::tag('fieldset', 'image-attachment', + html::tag('legend', 'image-filename', Q($attach_prop->filename)) . + html::p(array('align' => "center"), + html::img(array( + 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, true), + 'title' => $attach_prop->filename, + 'alt' => $attach_prop->filename, + ))) + ); + } } } } @@ -1247,7 +1283,7 @@ function rcmail_part_image_type($part) if ($part->filename && preg_match('/^application\/octet-stream$/i', $part->mimetype) - && preg_match('/\.([^.])$/i', $part->filename, $m) + && preg_match('/\.([^.]+)$/i', $part->filename, $m) && ($extension = strtolower($m[1])) && isset($types[$extension]) ) { @@ -1294,7 +1330,7 @@ function rcmail_html4inline($body, $container_id, $body_id='', &$attributes=null // modify HTML links to open a new window if clicked $GLOBALS['rcmail_html_container_id'] = $container_id; - $body = preg_replace_callback('/<(a|link)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body); + $body = preg_replace_callback('/<(a|link|area)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body); unset($GLOBALS['rcmail_html_container_id']); $body = preg_replace(array( @@ -1407,7 +1443,11 @@ function rcmail_alter_html_link($matches) $attrib['target'] = '_blank'; } - return "<$tag" . html::attrib_string($attrib, array('href','name','target','onclick','id','class','style','title','rel','type','media')) . $end; + // allowed attributes for a|link|area tags + $allow = array('href','name','target','onclick','id','class','style','title', + 'rel','type','media','alt','coords','nohref','hreflang','shape'); + + return "<$tag" . html::attrib_string($attrib, $allow) . $end; } @@ -1555,7 +1595,7 @@ function rcmail_wrap_and_quote($text, $length = 72) $out .= $line . "\n"; } - return $out; + return rtrim($out, "\n"); } @@ -1806,6 +1846,7 @@ $OUTPUT->add_handlers(array( // register action aliases $RCMAIL->register_action_map(array( + 'refresh' => 'check_recent.inc', 'preview' => 'show.inc', 'print' => 'show.inc', 'moveto' => 'move_del.inc', diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index bcd57dee0..2397358a1 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -60,6 +60,42 @@ if (!empty($_GET['_frame'])) { exit; } +// render thumbnail of an image attachment +else if ($_GET['_thumb']) { + $pid = get_input_value('_part', RCUBE_INPUT_GET); + if ($part = $MESSAGE->mime_parts[$pid]) { + $thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240); + $temp_dir = $RCMAIL->config->get('temp_dir'); + list(,$ext) = explode('/', $part->mimetype); + $cache_basename = $temp_dir . '/' . md5($MESSAGE->headers->messageID . $part->mime_id . ':' . $RCMAIL->user->ID . ':' . $thumbnail_size); + $cache_file = $cache_basename . '.' . $ext; + $mimetype = $part->mimetype; + + // render thumbnail image if not done yet + if (!is_file($cache_file)) { + $fp = fopen(($orig_name = $cache_basename . '.orig.' . $ext), 'w'); + $MESSAGE->get_part_content($part->mime_id, $fp); + fclose($fp); + + $image = new rcube_image($orig_name); + if ($imgtype = $image->resize($RCMAIL->config->get('image_thumbnail_size', 240), $cache_file, true)) { + $mimetype = 'image/' . $imgtype; + unlink($orig_name); + } + else { + rename($orig_name, $cache_file); + } + } + + if (is_file($cache_file)) { + header('Content-Type: ' . $mimetype); + readfile($cache_file); + } + } + + exit; +} + else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) { if ($part = $MESSAGE->mime_parts[$pid]) { diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 4fac872d1..348ac9b96 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -364,7 +364,7 @@ if (!empty($mailcc)) { if (!empty($mailbcc)) { $headers['Bcc'] = $mailbcc; } -if (!empty($identity_arr['bcc'])) { +if (!empty($identity_arr['bcc']) && stripos($headers['Bcc'], $identity_arr['bcc']) === false) { $headers['Bcc'] = ($headers['Bcc'] ? $headers['Bcc'].', ' : '') . $identity_arr['bcc']; $RECIPIENT_COUNT ++; } diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 12e449e80..0c7d9063f 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -369,12 +369,7 @@ function rcmail_folder_frame($attrib) if (!$attrib['id']) $attrib['id'] = 'rcmfolderframe'; - $attrib['name'] = $attrib['id']; - - $OUTPUT->set_env('contentframe', $attrib['name']); - $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif'); - - return html::iframe($attrib); + return $OUTPUT->frame($attrib, true); } function rcmail_rename_folder($oldname, $newname) diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index d5ccbb2d7..876e02761 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -31,12 +31,7 @@ function rcmail_preferences_frame($attrib) if (!$attrib['id']) $attrib['id'] = 'rcmprefsframe'; - $attrib['name'] = $attrib['id']; - - $OUTPUT->set_env('contentframe', $attrib['name']); - $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif'); - - return html::iframe($attrib); + return $OUTPUT->frame($attrib, true); } @@ -242,6 +237,24 @@ function rcmail_user_prefs($current=null) ); } + if (!isset($no_override['refresh_interval'])) { + $field_id = 'rcmfd_refresh_interval'; + $select_refresh_interval = new html_select(array('name' => '_refresh_interval', 'id' => $field_id)); + + $select_refresh_interval->add(rcube_label('never'), 0); + foreach (array(1, 3, 5, 10, 15, 30, 60) as $min) { + if (!$config['min_refresh_interval'] || $config['min_refresh_interval'] <= $min * 60) { + $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))); + $select_refresh_interval->add($label, $min); + } + } + + $blocks['main']['options']['refresh_interval'] = array( + 'title' => html::label($field_id, Q(rcube_label('refreshinterval'))), + 'content' => $select_refresh_interval->show($config['refresh_interval']/60), + ); + } + // show drop-down for available skins if (!isset($no_override['skin'])) { $skins = rcmail_get_skins(); @@ -375,23 +388,6 @@ function rcmail_user_prefs($current=null) 'content' => $input_pagesize->show($size ? $size : 50), ); } - - if (!isset($no_override['keep_alive'])) { - $field_id = 'rcmfd_keep_alive'; - $select_keep_alive = new html_select(array('name' => '_keep_alive', 'id' => $field_id)); - - foreach(array(1, 3, 5, 10, 15, 30, 60) as $min) - if((!$config['min_keep_alive'] || $config['min_keep_alive'] <= $min * 60) - && (!$config['session_lifetime'] || $config['session_lifetime'] > $min)) { - $select_keep_alive->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min); - } - - $blocks['new_message']['options']['keep_alive'] = array( - 'title' => html::label($field_id, Q(rcube_label('keepalive'))), - 'content' => $select_keep_alive->show($config['keep_alive']/60), - ); - } - if (!isset($no_override['check_all_folders'])) { $field_id = 'rcmfd_check_all_folders'; $input_check_all = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1)); diff --git a/program/steps/settings/identities.inc b/program/steps/settings/identities.inc index 26bd432c2..82a1841a3 100644 --- a/program/steps/settings/identities.inc +++ b/program/steps/settings/identities.inc @@ -33,11 +33,7 @@ function rcmail_identity_frame($attrib) if (!$attrib['id']) $attrib['id'] = 'rcmIdentityFrame'; - $attrib['name'] = $attrib['id']; - - $OUTPUT->set_env('contentframe', $attrib['name']); - - return html::iframe($attrib); + return $OUTPUT->frame($attrib, true); } $OUTPUT->add_handler('identityframe', 'rcmail_identity_frame'); diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index db7b134c4..5daab0d24 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -33,7 +33,8 @@ switch ($CURR_SECTION) 'date_format' => isset($_POST['_date_format']) ? get_input_value('_date_format', RCUBE_INPUT_POST) : $CONFIG['date_format'], 'time_format' => isset($_POST['_time_format']) ? get_input_value('_time_format', RCUBE_INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'), 'prettydate' => isset($_POST['_pretty_date']) ? TRUE : FALSE, - 'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'], + 'refresh_interval' => isset($_POST['_refresh_interval']) ? intval($_POST['_refresh_interval'])*60 : $CONFIG['refresh_interval'], + 'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'], ); // compose derived date/time format strings @@ -50,7 +51,6 @@ switch ($CURR_SECTION) 'preview_pane_mark_read' => isset($_POST['_preview_pane_mark_read']) ? intval($_POST['_preview_pane_mark_read']) : $CONFIG['preview_pane_mark_read'], 'autoexpand_threads' => isset($_POST['_autoexpand_threads']) ? intval($_POST['_autoexpand_threads']) : 0, 'mdn_requests' => isset($_POST['_mdn_requests']) ? intval($_POST['_mdn_requests']) : 0, - 'keep_alive' => isset($_POST['_keep_alive']) ? intval($_POST['_keep_alive'])*60 : $CONFIG['keep_alive'], 'check_all_folders' => isset($_POST['_check_all_folders']) ? TRUE : FALSE, 'mail_pagesize' => is_numeric($_POST['_mail_pagesize']) ? max(2, intval($_POST['_mail_pagesize'])) : $CONFIG['mail_pagesize'], ); @@ -157,16 +157,16 @@ switch ($CURR_SECTION) $a_user_prefs['timezone'] = (string) $a_user_prefs['timezone']; - break; - case 'mailbox': - - // force keep_alive - if (isset($a_user_prefs['keep_alive'])) { - $a_user_prefs['keep_alive'] = max(60, $CONFIG['min_keep_alive'], $a_user_prefs['keep_alive']); - if (!empty($CONFIG['session_lifetime'])) - $a_user_prefs['keep_alive'] = min($CONFIG['session_lifetime']*60, $a_user_prefs['keep_alive']); + if (isset($a_user_prefs['refresh_interval']) && !empty($CONFIG['min_refresh_interval'])) { + if ($a_user_prefs['refresh_interval'] > $CONFIG['min_refresh_interval']) { + $a_user_prefs['refresh_interval'] = $CONFIG['min_refresh_interval']; + } } + break; + + case 'mailbox': + // force min size if ($a_user_prefs['mail_pagesize'] < 1) $a_user_prefs['mail_pagesize'] = 10; @@ -174,7 +174,8 @@ switch ($CURR_SECTION) if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['mail_pagesize'] > $CONFIG['max_pagesize'])) $a_user_prefs['mail_pagesize'] = (int) $CONFIG['max_pagesize']; - break; + break; + case 'addressbook': // force min size @@ -184,7 +185,8 @@ switch ($CURR_SECTION) if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['addressbook_pagesize'] > $CONFIG['max_pagesize'])) $a_user_prefs['addressbook_pagesize'] = (int) $CONFIG['max_pagesize']; - break; + break; + case 'folders': // special handling for 'default_folders' @@ -199,7 +201,7 @@ switch ($CURR_SECTION) } } - break; + break; } // Save preferences |