summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/edit_identity.inc10
-rw-r--r--program/steps/settings/folders.inc7
-rw-r--r--program/steps/settings/func.inc46
-rw-r--r--program/steps/settings/identities.inc6
-rw-r--r--program/steps/settings/save_identity.inc5
-rw-r--r--program/steps/settings/save_prefs.inc28
6 files changed, 47 insertions, 55 deletions
diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc
index 7e7be1f83..d70a7aef7 100644
--- a/program/steps/settings/edit_identity.inc
+++ b/program/steps/settings/edit_identity.inc
@@ -42,8 +42,9 @@ else {
rcmail_overwrite_action('identities');
return;
}
- else if (IDENTITIES_LEVEL == 1)
- $IDENTITY_RECORD['email'] = $RCMAIL->user->get_username();
+ else if (IDENTITIES_LEVEL == 1) {
+ $IDENTITY_RECORD['email'] = $RCMAIL->get_user_email();
+ }
}
@@ -87,9 +88,10 @@ function rcube_identity_form($attrib)
if ($IDENTITY_RECORD['html_signature']) {
$form['signature']['content']['signature']['class'] = 'mce_editor';
$form['signature']['content']['signature']['is_escaped'] = true;
- }
- $IDENTITY_RECORD['signature'] = htmlentities($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCMAIL_CHARSET);
+ // Correctly handle HTML entities in HTML editor (#1488483)
+ $IDENTITY_RECORD['signature'] = htmlspecialchars($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCMAIL_CHARSET);
+ }
// disable some field according to access level
if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) {
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..3bcca21bf 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));
@@ -699,7 +695,7 @@ function rcmail_user_prefs($current=null)
);
if (!isset($no_override['default_addressbook'])
- && ($books = $RCMAIL->get_address_sources(true))
+ && ($books = $RCMAIL->get_address_sources(true, true))
) {
$field_id = 'rcmfd_default_addressbook';
$select_abook = new html_select(array('name' => '_default_addressbook', 'id' => $field_id));
@@ -709,7 +705,7 @@ function rcmail_user_prefs($current=null)
}
$blocks['main']['options']['default_addressbook'] = array(
- 'title' => html::label($field_id, Q(rcube_label('defaultaddressbook'))),
+ 'title' => html::label($field_id, Q(rcube_label('defaultabook'))),
'content' => $select_abook->show($config['default_addressbook']),
);
}
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_identity.inc b/program/steps/settings/save_identity.inc
index c3b8cc4a7..88adc795e 100644
--- a/program/steps/settings/save_identity.inc
+++ b/program/steps/settings/save_identity.inc
@@ -116,8 +116,9 @@ if ($_POST['_iid'])
// insert a new identity record
else if (IDENTITIES_LEVEL < 2)
{
- if (IDENTITIES_LEVEL == 1)
- $save_data['email'] = $RCMAIL->user->get_username();
+ if (IDENTITIES_LEVEL == 1) {
+ $save_data['email'] = $RCMAIL->get_user_email();
+ }
$plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data));
$save_data = $plugin['record'];
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