From bd0551b22076b82a6d49e9f7a2b2e0c90a1b2326 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 05 Feb 2016 07:25:27 -0500
Subject: [PATCH] Secure also downloads of addressbook exports, managesieve script exports and Enigma keys exports

---
 plugins/managesieve/managesieve.js |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js
index 1098b5b..117f01a 100644
--- a/plugins/managesieve/managesieve.js
+++ b/plugins/managesieve/managesieve.js
@@ -181,7 +181,7 @@
   var id = this.filtersets_list.get_single_selection(),
     script = this.env.filtersets[id];
 
-  location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_act=setget&_set='+urlencode(script);
+  this.goto_url('plugin.managesieve-action', {_act: 'setget', _set: script}, false, true);
 };
 
 // Set activate/deactivate request
@@ -246,7 +246,7 @@
         var rowid = this.id.substr(6);
 
         // remove all attached events
-        $(this).unbind();
+        $(this).off();
 
         // update row id
         if (rowid > id) {
@@ -417,7 +417,7 @@
 rcube_webmail.prototype.managesieve_fixdragend = function(elem)
 {
   var p = this;
-  $(elem).bind('mouseup' + ((bw.iphone || bw.ipad) ? ' touchend' : ''), function(e) {
+  $(elem).on('mouseup' + ((bw.iphone || bw.ipad) ? ' touchend' : ''), function(e) {
     if (p.drag_active)
       p.filters_list.drag_mouse_up(e);
   });
@@ -837,10 +837,11 @@
   var n, framed = parent.rcmail,
     tip = framed ? parent.rcmail.env.ms_tip_layer : rcmail.env.ms_tip_layer;
 
-  for (var n in tips) {
+  for (n in tips) {
     $('#'+tips[n][0])
       .data('tip', tips[n][1])
-      .bind('mouseenter', function(e) {
+      .mouseleave(function(e) { tip.hide(); })
+      .mouseenter(function(e) {
         var elem = $(this),
           offset = elem.offset(),
           left = offset.left,
@@ -857,8 +858,7 @@
         top -= tip.height();
 
         tip.css({left: left, top: top, minWidth: (minwidth-2) + 'px'}).show();
-      })
-    .bind('mouseleave', function(e) { tip.hide(); });
+      });
   }
 };
 
@@ -983,7 +983,7 @@
   }
 
   // build dialog window content
-  html = '<fieldset><legend>'+this.gettext('managesieve.usedata')+'</legend><ul>';
+  html = '<fieldset><legend>'+this.get_label('managesieve.usedata')+'</legend><ul>';
   for (i in this.env.sieve_headers)
     html += '<li><input type="checkbox" name="headers[]" id="sievehdr'+i+'" value="'+i+'" checked="checked" />'
       +'<label for="sievehdr'+i+'">'+this.env.sieve_headers[i][0]+':</label> '+this.env.sieve_headers[i][1]+'</li>';
@@ -992,11 +992,11 @@
   dialog.html(html);
 
   // [Next Step] button action
-  buttons[this.gettext('managesieve.nextstep')] = function () {
+  buttons[this.get_label('managesieve.nextstep')] = function () {
     // check if there's at least one checkbox checked
     var hdrs = $('input[name="headers[]"]:checked', dialog);
     if (!hdrs.length) {
-      alert(rcmail.gettext('managesieve.nodata'));
+      alert(rcmail.get_label('managesieve.nodata'));
       return;
     }
 
@@ -1016,7 +1016,7 @@
 
     // Change [Next Step] button with [Save] button
     buttons = {};
-    buttons[rcmail.gettext('save')] = function() {
+    buttons[rcmail.get_label('save')] = function() {
       var win = $('iframe', dialog).get(0).contentWindow;
       win.rcmail.managesieve_save();
     };
@@ -1028,7 +1028,7 @@
     modal: false,
     resizable: true,
     closeOnEscape: !bw.ie7,  // disable for performance reasons
-    title: this.gettext('managesieve.newfilter'),
+    title: this.get_label('managesieve.newfilter'),
     close: function() { rcmail.managesieve_dialog_close(); },
     buttons: buttons,
     minWidth: 600,

--
Gitblit v1.9.1