| | |
| | | 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')); |
| | | } |
| | | } |
| | |
| | | // 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) |
| | |
| | | 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 |
| | |
| | | |
| | | var buttons = {}, me = this, body = document.body; |
| | | |
| | | buttons[this.gettext('save')] = function(e) { me.command('acl-save'); }; |
| | | buttons[this.gettext('cancel')] = function(e) { me.command('acl-cancel'); }; |
| | | buttons[this.get_label('save')] = function(e) { me.command('acl-save'); }; |
| | | buttons[this.get_label('cancel')] = function(e) { me.command('acl-cancel'); }; |
| | | |
| | | // display it as popup |
| | | this.acl_popup = this.show_popup_dialog( |
| | | '<div style="width:480px;height:280px"> </div>', |
| | | id ? this.gettext('acl.editperms') : this.gettext('acl.newuser'), |
| | | this.acl_form.show(), |
| | | id ? this.get_label('acl.editperms') : this.get_label('acl.newuser'), |
| | | buttons, |
| | | { |
| | | button_classes: ['mainaction'], |
| | | modal: true, |
| | | closeOnEscape: true, |
| | | close: function(e, ui) { |
| | |
| | | } |
| | | } |
| | | ); |
| | | |
| | | this.acl_form.appendTo(this.acl_popup).show(); |
| | | |
| | | if (type == 'user') |
| | | name_input.focus(); |