[Svn] r4579 - in trunk/roundcubemail: . program/js

trac at roundcube.net trac at roundcube.net
Mon Feb 28 10:21:46 CET 2011


Author: thomasb
Date: 2011-02-28 03:21:46 -0600 (Mon, 28 Feb 2011)
New Revision: 4579

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/js/app.js
Log:
Workaround for IE not sending referer with location.href (#1487806)

Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-02-27 13:58:12 UTC (rev 4578)
+++ trunk/roundcubemail/CHANGELOG	2011-02-28 09:21:46 UTC (rev 4579)
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Force IE to send referers (#1487806)
 - Fixed de_CH Localization bugs (#1487773)
 - Better display of vcard import results (#1485457)
 - Improved vcard import

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2011-02-27 13:58:12 UTC (rev 4578)
+++ trunk/roundcubemail/program/js/app.js	2011-02-28 09:21:46 UTC (rev 4579)
@@ -1851,7 +1851,7 @@
       if (!this.env.frame_lock) {
         (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
       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 @@
     // load message list to target frame/window
     if (mbox) {
       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 @@
       add_url += '&_search='+this.env.search_request;
 
     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
@@ -3712,7 +3712,7 @@
         add_url += '&_gid='+urlencode(this.env.group);
 
       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;
   };
@@ -4187,7 +4187,7 @@
         add_url = '&_framed=1';
         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;
@@ -4216,7 +4216,7 @@
 
     if (action && (id || action=='add-identity')) {
       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;
@@ -4481,7 +4481,7 @@
       if (!this.env.frame_lock) {
         (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 @@
     if (lock || lock === null)
       this.set_busy(true);
 
-    if (this.env.framed && window.parent)
-      parent.location.href = url;
+    if (this.is_framed())
+      parent.redirect(url, lock);
     else
-      location.href = url;
+      this.location_href(url, window);
   };
 
   this.goto_url = function(action, query, lock)
@@ -5196,6 +5196,15 @@
     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
   this.http_request = function(action, query, lock)
   {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list