summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/addressbook/delete.inc5
-rw-r--r--program/steps/addressbook/func.inc15
-rw-r--r--program/steps/addressbook/import.inc2
-rw-r--r--program/steps/addressbook/photo.inc10
-rw-r--r--program/steps/mail/check_recent.inc4
-rw-r--r--program/steps/mail/compose.inc24
-rw-r--r--program/steps/mail/func.inc14
-rw-r--r--program/steps/mail/show.inc8
-rw-r--r--program/steps/settings/edit_folder.inc2
-rw-r--r--program/steps/settings/edit_response.inc3
-rw-r--r--program/steps/settings/folders.inc1
-rw-r--r--program/steps/settings/func.inc28
-rw-r--r--program/steps/utils/error.inc12
13 files changed, 73 insertions, 55 deletions
diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc
index f5b8e4eb5..9a23c59bb 100644
--- a/program/steps/addressbook/delete.inc
+++ b/program/steps/addressbook/delete.inc
@@ -20,10 +20,11 @@
*/
// process ajax requests only
-if (!$OUTPUT->ajax_call)
+if (!$OUTPUT->ajax_call) {
return;
+}
-$cids = rcmail_get_cids();
+$cids = rcmail_get_cids(null, rcube_utils::INPUT_POST);
$delcnt = 0;
// remove previous deletes
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 2c22d5a47..c40b517dc 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -279,8 +279,8 @@ function rcmail_savedsearch_list($attrib)
// Saved searches
$sources = $RCMAIL->user->list_searches(rcube_user::SEARCH_ADDRESSBOOK);
- foreach ($sources as $j => $source) {
- $id = $source['id'];
+ foreach ($sources as $source) {
+ $id = $source['id'];
$js_id = rcube::JQ($id);
// set class name(s)
@@ -785,11 +785,12 @@ function rcmail_contact_photo($attrib)
if ($result = $CONTACTS->get_result())
$record = $result->first();
- $photo_img = $attrib['placeholder'] ? $RCMAIL->output->get_skin_file($attrib['placeholder']) : 'program/resources/blank.gif';
+ $photo_img = $attrib['placeholder'] ? $RCMAIL->output->abs_url($attrib['placeholder'], true) : 'program/resources/blank.gif';
if ($record['_type'] == 'group' && $attrib['placeholdergroup'])
- $photo_img = $RCMAIL->output->get_skin_file($attrib['placeholdergroup']);
+ $photo_img = $RCMAIL->output->abs_url($attrib['placeholdergroup'], true);
+
+ $RCMAIL->output->set_env('photo_placeholder', $RCMAIL->output->asset_url($photo_img));
- $RCMAIL->output->set_env('photo_placeholder', $photo_img);
unset($attrib['placeholder']);
$plugin = $RCMAIL->plugins->exec_hook('contact_photo', array('record' => $record, 'data' => $record['photo']));
@@ -896,13 +897,13 @@ function rcmail_search_update($return = false)
*
* @return array List of contact IDs per-source
*/
-function rcmail_get_cids($filter = null)
+function rcmail_get_cids($filter = null, $request_type = rcube_utils::INPUT_GPC)
{
// contact ID (or comma-separated list of IDs) is provided in two
// forms. If _source is an empty string then the ID is a string
// containing contact ID and source name in form: <ID>-<SOURCE>
- $cid = rcube_utils::get_input_value('_cid', rcube_utils::INPUT_GPC);
+ $cid = rcube_utils::get_input_value('_cid', $request_type);
$source = (string) rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
if (is_array($cid)) {
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index 5dee5c06a..80bae662c 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -324,7 +324,7 @@ function rcmail_import_buttons($attrib)
function rcmail_import_group_id($group_name, $CONTACTS, $create, &$import_groups)
{
$group_id = 0;
- foreach ($import_groups as $key => $group) {
+ foreach ($import_groups as $group) {
if (strtolower($group['name']) == strtolower($group_name)) {
$group_id = $group['ID'];
break;
diff --git a/program/steps/addressbook/photo.inc b/program/steps/addressbook/photo.inc
index 30d09ffcc..962ca3126 100644
--- a/program/steps/addressbook/photo.inc
+++ b/program/steps/addressbook/photo.inc
@@ -90,6 +90,12 @@ if (!$cid && $email) {
$RCMAIL->output->future_expire_header(86400);
}
-header('Content-Type: ' . rcube_mime::image_content_type($data));
-echo $data ? $data : file_get_contents('program/resources/blank.gif');
+if ($data) {
+ header('Content-Type: ' . rcube_mime::image_content_type($data));
+ echo $data;
+}
+else {
+ header('Content-Type: image/gif');
+ echo base64_decode(rcmail_output::BLANK_GIF);
+}
exit;
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index b95819415..4e3b15648 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -28,6 +28,8 @@ if (empty($_POST['_folderlist']) && empty($_POST['_list'])) {
$trash = $RCMAIL->config->get('trash_mbox');
$current = $RCMAIL->storage->get_folder();
$check_all = $RCMAIL->action != 'refresh' || (bool)$RCMAIL->config->get('check_all_folders');
+$page = $RCMAIL->storage->get_page();
+$page_size = $RCMAIL->storage->get_pagesize();
$search_request = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC);
if ($search_request && $_SESSION['search_request'] != $search_request) {
@@ -97,8 +99,6 @@ foreach ($a_mailboxes as $mbox_name) {
// did a refresh but only in list mode
$list_mode = $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL';
$all_count = $RCMAIL->storage->count($mbox_name, $list_mode, $list_mode == 'THREADS', false);
- $page = $RCMAIL->storage->get_page();
- $page_size = $RCMAIL->storage->get_pagesize();
// check current page if we're not on the first page
if ($all_count && $page > 1) {
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 751729cc5..92296e525 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -131,8 +131,10 @@ else if ($msg_uid = $COMPOSE['param']['uid']) {
$compose_mode = RCUBE_COMPOSE_EDIT;
}
-$COMPOSE['mode'] = $compose_mode;
-$OUTPUT->set_env('compose_mode', $compose_mode);
+if ($compose_mode) {
+ $COMPOSE['mode'] = $compose_mode;
+ $OUTPUT->set_env('compose_mode', $compose_mode);
+}
if ($compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT) {
// don't add signature in draft/edit mode, we'll also not remove the old-one
@@ -949,7 +951,7 @@ function rcmail_compose_body($attrib)
"googie.setCurrentLanguage('%s');\n".
"googie.setDecoration(false);\n".
"googie.decorateTextarea('%s');\n",
- $RCMAIL->output->get_skin_path(),
+ $RCMAIL->output->asset_url($RCMAIL->output->get_skin_path()),
$RCMAIL->url(array('_task' => 'utils', '_action' => 'spell', '_remote' => 1)),
!empty($dictionary) ? 'true' : 'false',
rcube::JQ(rcube::Q($RCMAIL->gettext('checkspelling'))),
@@ -1309,7 +1311,6 @@ function rcmail_write_forward_attachments()
}
else {
$data = $storage->get_raw_body($message->uid);
- $curr_mem += $message->size;
}
$attachment = array(
@@ -1493,15 +1494,14 @@ function rcmail_compose_attachment_list($attrib)
if (!$attrib['id'])
$attrib['id'] = 'rcmAttachmentList';
- $out = "\n";
- $jslist = array();
- $button = '';
- $skin_path = $RCMAIL->config->get('skin_path');
+ $out = "\n";
+ $jslist = array();
+ $button = '';
if (is_array($COMPOSE['attachments'])) {
if ($attrib['deleteicon']) {
$button = html::img(array(
- 'src' => $skin_path . $attrib['deleteicon'],
+ 'src' => $RCMAIL->output->abs_url($attrib['deleteicon'], true),
'alt' => $RCMAIL->gettext('delete')
));
}
@@ -1540,13 +1540,13 @@ function rcmail_compose_attachment_list($attrib)
}
if ($attrib['deleteicon'])
- $COMPOSE['deleteicon'] = $skin_path . $attrib['deleteicon'];
+ $COMPOSE['deleteicon'] = $RCMAIL->output->abs_url($attrib['deleteicon'], true);
else if (rcube_utils::get_boolean($attrib['textbuttons']))
$COMPOSE['textbuttons'] = true;
if ($attrib['cancelicon'])
- $OUTPUT->set_env('cancelicon', $skin_path . $attrib['cancelicon']);
+ $OUTPUT->set_env('cancelicon', $RCMAIL->output->abs_url($attrib['cancelicon'], true));
if ($attrib['loadingicon'])
- $OUTPUT->set_env('loadingicon', $skin_path . $attrib['loadingicon']);
+ $OUTPUT->set_env('loadingicon', $RCMAIL->output->abs_url($attrib['loadingicon'], true));
$OUTPUT->set_env('attachments', $jslist);
$OUTPUT->add_gui_object('attachmentlist', $attrib['id']);
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 167e30927..6423636f0 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -357,8 +357,6 @@ function rcmail_message_list($attrib)
if (!in_array('threads', $a_show_cols))
array_unshift($a_show_cols, 'threads');
- $_SESSION['skin_path'] = $RCMAIL->config->get('skin_path');
-
// set client env
$OUTPUT->add_gui_object('messagelist', $attrib['id']);
$OUTPUT->set_env('autoexpand_threads', intval($RCMAIL->config->get('autoexpand_threads')));
@@ -543,8 +541,6 @@ function rcmail_message_list_head($attrib, $a_show_cols)
{
global $RCMAIL;
- $skin_path = $_SESSION['skin_path'];
-
// check to see if we have some settings for sorting
$sort_col = $_SESSION['sort_col'];
$sort_order = $_SESSION['sort_order'];
@@ -566,7 +562,7 @@ function rcmail_message_list_head($attrib, $a_show_cols)
$onclick = 'return ' . rcmail_output::JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu', this, event)";
$inner = $RCMAIL->gettext('listoptions');
if (is_string($attrib['optionsmenuicon']) && $attrib['optionsmenuicon'] != 'true') {
- $inner = html::img(array('src' => $skin_path . $attrib['optionsmenuicon'], 'alt' => $RCMAIL->gettext('listoptions')));
+ $inner = html::img(array('src' => $RCMAIL->output->abs_url($attrib['optionsmenuicon'], true), 'alt' => $RCMAIL->gettext('listoptions')));
}
$list_menu = html::a(array(
'href' => '#list-options',
@@ -647,7 +643,7 @@ function rcmail_message_list_head($attrib, $a_show_cols)
*/
function rcmail_messagecontent_frame($attrib)
{
- global $OUTPUT, $RCMAIL;
+ global $OUTPUT;
if (empty($attrib['id']))
$attrib['id'] = 'rcmailcontentwindow';
@@ -1138,7 +1134,7 @@ function rcmail_localized_priority($value)
/**
* return block to show full message headers
*/
-function rcmail_message_full_headers($attrib, $headers=NULL)
+function rcmail_message_full_headers($attrib)
{
global $OUTPUT, $RCMAIL;
@@ -1623,7 +1619,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null,
rcmail_output::JS_OBJECT_NAME, rcube::JQ($string)),
),
html::img(array(
- 'src' => $RCMAIL->config->get('skin_path') . $addicon,
+ 'src' => $RCMAIL->output->abs_url($addicon, true),
'alt' => "Add contact",
)));
}
@@ -2051,7 +2047,7 @@ function rcmail_search_filter($attrib)
return $out;
}
-function rcmail_message_error($uid=null)
+function rcmail_message_error()
{
global $RCMAIL;
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 5adc97900..d9233a923 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -341,20 +341,20 @@ function rcmail_message_contactphoto($attrib)
{
global $RCMAIL, $MESSAGE;
- $placeholder = $attrib['placeholder'] ? $RCMAIL->config->get('skin_path') . $attrib['placeholder'] : null;
+ $placeholder = $attrib['placeholder'] ? $RCMAIL->output->abs_url($attrib['placeholder'], true) : null;
+ $placeholder = $RCMAIL->output->asset_url($placeholder ? $placeholder : 'program/resources/blank.gif');
if ($MESSAGE->sender) {
$photo_img = $RCMAIL->url(array(
'_task' => 'addressbook',
'_action' => 'photo',
'_email' => $MESSAGE->sender['mailto'],
- '_alt' => $placeholder,
));
- $attrib['onerror'] = "this.src = '" . ($placeholder ? $placeholder : 'program/resources/blank.gif') . "'";
+ $attrib['onerror'] = "this.src = '$placeholder'";
}
else {
- $photo_img = $placeholder ? $placeholder : 'program/resources/blank.gif';
+ $photo_img = $placeholder;
}
return html::img(array('src' => $photo_img, 'alt' => $RCMAIL->gettext('contactphoto')) + $attrib);
diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc
index 202578676..f34e3c550 100644
--- a/program/steps/settings/edit_folder.inc
+++ b/program/steps/settings/edit_folder.inc
@@ -298,6 +298,8 @@ function rcmail_folder_form($attrib)
function rcmail_get_form_part($form, $attrib = array())
{
+ global $RCMAIL;
+
$content = '';
if (is_array($form['content']) && !empty($form['content'])) {
diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc
index 10dec1096..03a6878be 100644
--- a/program/steps/settings/edit_response.inc
+++ b/program/steps/settings/edit_response.inc
@@ -79,7 +79,7 @@ $OUTPUT->send('responseedit');
function rcube_response_form($attrib)
{
- global $RCMAIL, $OUTPUT, $RESPONSE_RECORD;
+ global $RCMAIL, $RESPONSE_RECORD;
// Set form tags and hidden fields
$disabled = !empty($RESPONSE_RECORD['static']);
@@ -91,7 +91,6 @@ function rcube_response_form($attrib)
$out = "$form_start\n";
$table = new html_table(array('cols' => 2));
- $label = $RCMAIL->gettext('responsename');
$table->add('title', html::label('ffname', rcube::Q($RCMAIL->gettext('responsename'))));
$table->add(null, rcube_output::get_edit_field('name', $RESPONSE_RECORD['name'],
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index 14e41d607..6db0b17e8 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -269,7 +269,6 @@ function rcmail_subscription_form($attrib)
// create list of available folders
foreach ($list_folders as $i => $folder) {
- $idx = $i + 1;
$sub_key = array_search($folder['id'], $a_subscribed);
$subscribed = $sub_key !== false;
$protected = $protect_default && isset($special_folders[$folder['id']]);
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 0b2039a78..486e679c9 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -94,9 +94,9 @@ function rcmail_identities_list($attrib)
}
// get identities list and define 'mail' column
- $list = $RCMAIL->user->list_identities();
+ $list = $RCMAIL->user->list_emails();
foreach ($list as $idx => $row) {
- $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_utils::idn_to_utf8($row['email']) .'>');
+ $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_utils::idn_to_utf8($row['email']) . '>');
}
// get all identites from DB and define list of cols to be displayed
@@ -334,13 +334,10 @@ function rcmail_user_prefs($current = null)
$input = new html_radiobutton(array('name'=>'_skin'));
foreach ($skins as $skin) {
- $thumbnail = "./skins/$skin/thumbnail.png";
- if (!is_file($thumbnail))
- $thumbnail = './program/resources/blank.gif';
-
+ $thumbnail = "skins/$skin/thumbnail.png";
$skinname = ucfirst($skin);
$author_link = $license_link = '';
- $meta = @json_decode(@file_get_contents("./skins/$skin/meta.json"), true);
+ $meta = @json_decode(@file_get_contents(INSTALL_PATH . "skins/$skin/meta.json"), true);
if (is_array($meta) && $meta['name']) {
$skinname = $meta['name'];
@@ -348,10 +345,19 @@ function rcmail_user_prefs($current = null)
$license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank', 'tabindex' => '-1'), rcube::Q($meta['license'])) : rcube::Q($meta['license']);
}
+ $img = html::img(array(
+ 'src' => $thumbnail,
+ 'class' => 'skinthumbnail',
+ 'alt' => $skin,
+ 'width' => 64,
+ 'height' => 64,
+ 'onerror' => "this.src = rcmail.assets_path('program/resources/blank.gif')",
+ ));
+
$skinnames[] = mb_strtolower($skinname);
$blocks['skin']['options'][$skin]['content'] = html::label(array('class' => 'skinselection'),
html::span('skinitem', $input->show($config['skin'], array('value' => $skin, 'id' => $field_id.$skin))) .
- html::span('skinitem', html::img(array('src' => $thumbnail, 'class' => 'skinthumbnail', 'alt' => $skin, 'width' => 64, 'height' => 64))) .
+ html::span('skinitem', $img) .
html::span('skinitem', html::span('skinname', rcube::Q($skinname)) . html::br() .
html::span('skinauthor', $author_link ? 'by ' . $author_link : '') . html::br() .
html::span('skinlicense', $license_link ? $RCMAIL->gettext('license').':&nbsp;' . $license_link : ''))
@@ -456,7 +462,7 @@ function rcmail_user_prefs($current = null)
$select->add($RCMAIL->gettext('autosend'), 1);
$select->add($RCMAIL->gettext('autosendknown'), 3);
$select->add($RCMAIL->gettext('autosendknownignore'), 4);
- $select->add($RCMAIL->gettext('ignore'), 2);
+ $select->add($RCMAIL->gettext('ignorerequest'), 2);
$blocks['main']['options']['mdn_requests'] = array(
'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('mdnrequests'))),
@@ -890,7 +896,7 @@ function rcmail_user_prefs($current = null)
$select_default_font->add('', '');
$fonts = rcmail::font_defs();
- foreach ($fonts as $fname => $font) {
+ foreach (array_keys($fonts) as $fname) {
$select_default_font->add($fname, $fname);
}
@@ -1360,7 +1366,7 @@ function rcmail_settings_tabs($attrib)
$tagname = $attrib['tagname'];
$tabs = array();
- foreach ($plugin['actions'] as $k => $action) {
+ foreach ($plugin['actions'] as $action) {
if (!$action['command'] && !$action['href'] && $action['action']) {
$action['href'] = $RCMAIL->url(array('_action' => $action['action']));
}
diff --git a/program/steps/utils/error.inc b/program/steps/utils/error.inc
index ec0d038f4..6bbc57fda 100644
--- a/program/steps/utils/error.inc
+++ b/program/steps/utils/error.inc
@@ -50,9 +50,17 @@ else if ($ERROR_CODE == 401) {
// forbidden due to request check
else if ($ERROR_CODE == 403) {
+ if ($_SERVER['REQUEST_METHOD'] == 'GET' && $rcmail->request_status == rcube::REQUEST_ERROR_URL) {
+ parse_str($_SERVER['QUERY_STRING'], $url);
+ $url = $rcmail->url($url, true, false, true);
+ $add = "<br /><a href=\"$url\">Click here to try again.<a/>";
+ }
+ else {
+ $add = "Please contact your server-administrator.";
+ }
+
$__error_title = "REQUEST CHECK FAILED";
- $__error_text = "Access to this service was denied due to failing security checks!<br />\n"
- . "Please contact your server-administrator.";
+ $__error_text = "Access to this service was denied due to failing security checks!<br />\n$add";
}
// failed request (wrong step in URL)