From 2965a981b7ec22866fbdf2d567d87e2d068d3617 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 31 Jul 2015 16:04:08 -0400
Subject: [PATCH] Allow to search and import missing PGP pubkeys from keyservers using Publickey.js

---
 plugins/acl/acl.js |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/plugins/acl/acl.js b/plugins/acl/acl.js
index d82725c..f1e9922 100644
--- a/plugins/acl/acl.js
+++ b/plugins/acl/acl.js
@@ -24,11 +24,7 @@
                     if (e.field.id != 'acluser')
                         return;
 
-                    var value = e.insert;
-                    // get UID from the entry value
-                    if (value.match(/\s*\(([^)]+)\)[, ]*$/))
-                        value = RegExp.$1;
-                    e.field.value = value;
+                    e.field.value = e.insert.replace(/[ ,;]+$/, '');
                 });
             }
         }
@@ -62,8 +58,11 @@
     var users = this.acl_get_usernames();
 
     if (users && users.length && confirm(this.get_label('acl.deleteconfirm'))) {
-        this.http_request('settings/plugin.acl', '_act=delete&_user='+urlencode(users.join(','))
-            + '&_mbox='+urlencode(this.env.mailbox),
+        this.http_post('settings/plugin.acl', {
+                _act: 'delete',
+                _user: users.join(','),
+                _mbox: this.env.mailbox
+            },
             this.set_busy(true, 'acl.deleting'));
     }
 }
@@ -71,7 +70,7 @@
 // Save ACL data
 rcube_webmail.prototype.acl_save = function()
 {
-    var user = $('#acluser', this.acl_form).val(), rights = '', type;
+    var data, type, rights = '', user = $('#acluser', this.acl_form).val();
 
     $((this.env.acl_advanced ? '#advancedrights :checkbox' : '#simplerights :checkbox'), this.acl_form).map(function() {
         if (this.checked)
@@ -92,12 +91,18 @@
         return;
     }
 
-    this.http_request('settings/plugin.acl', '_act=save'
-        + '&_user='+urlencode(user)
-        + '&_acl=' +rights
-        + '&_mbox='+urlencode(this.env.mailbox)
-        + (this.acl_id ? '&_old='+this.acl_id : ''),
-        this.set_busy(true, 'acl.saving'));
+    data = {
+        _act: 'save',
+        _user: user,
+        _acl: rights,
+        _mbox: this.env.mailbox
+    }
+
+    if (this.acl_id) {
+        data._old = this.acl_id;
+    }
+
+    this.http_post('settings/plugin.acl', data, this.set_busy(true, 'acl.saving'));
 }
 
 // Cancel/Hide form
@@ -344,10 +349,11 @@
 
     // display it as popup
     this.acl_popup = this.show_popup_dialog(
-        '<div style="width:480px;height:280px">&nbsp;</div>',
+        this.acl_form.show(),
         id ? this.gettext('acl.editperms') : this.gettext('acl.newuser'),
         buttons,
         {
+            button_classes: ['mainaction'],
             modal: true,
             closeOnEscape: true,
             close: function(e, ui) {
@@ -358,8 +364,6 @@
             }
         }
     );
-
-    this.acl_form.appendTo(this.acl_popup).show();
 
     if (type == 'user')
         name_input.focus();

--
Gitblit v1.9.1