Workaround for IE not sending referer with location.href (#1487806)

release-0.6
thomascube 14 years ago
parent 7835e2ded8
commit d7167e9eeb

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Force IE to send referers (#1487806)
- Fixed de_CH Localization bugs (#1487773) - Fixed de_CH Localization bugs (#1487773)
- Better display of vcard import results (#1485457) - Better display of vcard import results (#1485457)
- Improved vcard import - Improved vcard import

@ -1851,7 +1851,7 @@ function rcube_webmail()
if (!this.env.frame_lock) { if (!this.env.frame_lock) {
(this.is_framed() ? parent.rcmail : this).env.frame_lock = this.set_busy(true, 'loading'); (this.is_framed() ? parent.rcmail : this).env.frame_lock = this.set_busy(true, 'loading');
} }
target.location.href = this.env.comm_path+url; this.location_href(this.env.comm_path+url, target);
// mark as read and change mbox unread counter // mark as read and change mbox unread counter
if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read >= 0) { if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read >= 0) {
@ -1973,7 +1973,7 @@ function rcube_webmail()
// load message list to target frame/window // load message list to target frame/window
if (mbox) { if (mbox) {
this.set_busy(true, 'loading'); this.set_busy(true, 'loading');
target.location.href = this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+url; this.location_href(this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+url, target);
} }
}; };
@ -3666,7 +3666,7 @@ function rcube_webmail()
add_url += '&_search='+this.env.search_request; add_url += '&_search='+this.env.search_request;
this.set_busy(true, 'loading'); this.set_busy(true, 'loading');
target.location.href = this.env.comm_path + (src ? '&_source='+urlencode(src) : '') + add_url; this.location_href(this.env.comm_path + (src ? '&_source='+urlencode(src) : '') + add_url, target);
}; };
// send remote request to load contacts list // send remote request to load contacts list
@ -3712,7 +3712,7 @@ function rcube_webmail()
add_url += '&_gid='+urlencode(this.env.group); add_url += '&_gid='+urlencode(this.env.group);
this.set_busy(true); this.set_busy(true);
target.location.href = this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url; this.location_href(this.env.comm_path+'&_action='+action+'&_source='+urlencode(this.env.source)+'&_cid='+urlencode(cid) + add_url, target);
} }
return true; return true;
}; };
@ -4187,7 +4187,7 @@ function rcube_webmail()
add_url = '&_framed=1'; add_url = '&_framed=1';
target = window.frames[this.env.contentframe]; target = window.frames[this.env.contentframe];
} }
target.location.href = this.env.comm_path+'&_action=edit-prefs&_section='+id+add_url; this.location_href(this.env.comm_path+'&_action=edit-prefs&_section='+id+add_url, target);
} }
return true; return true;
@ -4216,7 +4216,7 @@ function rcube_webmail()
if (action && (id || action=='add-identity')) { if (action && (id || action=='add-identity')) {
this.set_busy(true); this.set_busy(true);
target.location.href = this.env.comm_path+'&_action='+action+'&_iid='+id+add_url; this.location_href(this.env.comm_path+'&_action='+action+'&_iid='+id+add_url, target);
} }
return true; return true;
@ -4481,7 +4481,7 @@ function rcube_webmail()
if (!this.env.frame_lock) { if (!this.env.frame_lock) {
(parent.rcmail ? parent.rcmail : this).env.frame_lock = this.set_busy(true, 'loading'); (parent.rcmail ? parent.rcmail : this).env.frame_lock = this.set_busy(true, 'loading');
} }
target.location.href = this.env.comm_path+url; this.location_href(this.env.comm_path+url, target);
} }
}; };
@ -5185,10 +5185,10 @@ function rcube_webmail()
if (lock || lock === null) if (lock || lock === null)
this.set_busy(true); this.set_busy(true);
if (this.env.framed && window.parent) if (this.is_framed())
parent.location.href = url; parent.redirect(url, lock);
else else
location.href = url; this.location_href(url, window);
}; };
this.goto_url = function(action, query, lock) this.goto_url = function(action, query, lock)
@ -5196,6 +5196,15 @@ function rcube_webmail()
this.redirect(this.url(action, query)); this.redirect(this.url(action, query));
}; };
this.location_href = function(url, target)
{
// simulate real link click to force IE to send referer header
if (bw.ie && target == window)
$('<a>').attr('href', url).appendTo(document.body).get(0).click();
else
target.location.href = url;
};
// send a http request to the server // send a http request to the server
this.http_request = function(action, query, lock) this.http_request = function(action, query, lock)
{ {

Loading…
Cancel
Save