diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/archive/archive.js | 2 | ||||
-rw-r--r-- | plugins/archive/archive.php | 2 | ||||
-rw-r--r-- | plugins/archive/skins/classic/archive.css | 2 | ||||
-rw-r--r-- | plugins/help/help.js | 2 | ||||
-rw-r--r-- | plugins/managesieve/Changelog | 2 | ||||
-rw-r--r-- | plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php | 16 | ||||
-rw-r--r-- | plugins/managesieve/managesieve.js | 28 | ||||
-rw-r--r-- | plugins/managesieve/managesieve.php | 1 | ||||
-rw-r--r-- | plugins/password/password.js | 16 | ||||
-rw-r--r-- | plugins/vcard_attachments/vcardattach.js | 3 |
10 files changed, 44 insertions, 30 deletions
diff --git a/plugins/archive/archive.js b/plugins/archive/archive.js index 6ed4f971a..813033401 100644 --- a/plugins/archive/archive.js +++ b/plugins/archive/archive.js @@ -1,4 +1,4 @@ -/* +/** * Archive plugin script * @version 2.1 */ diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 4a00d5f58..a0fd2efa9 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -268,7 +268,7 @@ class archive extends rcube_plugin $archive_type->add($this->gettext('archivetypefolder'), 'folder'); $args['blocks']['archive'] = array( - 'name' => Q(rcube_label('settingstitle', 'archive')), + 'name' => Q($this->gettext('settingstitle')), 'options' => array('archive_type' => array( 'title' => $this->gettext('archivetype'), 'content' => $archive_type->show($rcmail->config->get('archive_type')) diff --git a/plugins/archive/skins/classic/archive.css b/plugins/archive/skins/classic/archive.css index 3880fe3da..fc5984b39 100644 --- a/plugins/archive/skins/classic/archive.css +++ b/plugins/archive/skins/classic/archive.css @@ -4,7 +4,7 @@ background: url(archive_act.png) 0 0 no-repeat; } -#mailboxlist li.mailbox.archive { +#mailboxlist li.mailbox.archive > a { background-image: url(foldericon.png); background-position: 5px 1px; } diff --git a/plugins/help/help.js b/plugins/help/help.js index 59a93c537..03edb7ab2 100644 --- a/plugins/help/help.js +++ b/plugins/help/help.js @@ -1,4 +1,4 @@ -/* +/** * Help plugin client script * @version 1.4 */ diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index b7b9ecf68..a5a231b9a 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,3 +1,5 @@ +- Nicely handle server-side modification of script names (#1489412) + * version 7.1 [2013-11-22] ----------------------------------------------------------- - lib/Net Sieve.php moved to Roundcube /lib directory diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php index e0f6ead9a..4a375d353 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php @@ -132,6 +132,11 @@ class rcube_sieve_engine // Get list of scripts $list = $this->list_scripts(); + // reset current script when entering filters UI (#1489412) + if ($this->rc->action == 'plugin.managesieve') { + $this->rc->session->remove('managesieve_current'); + } + if (!empty($_GET['_set']) || !empty($_POST['_set'])) { $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); } @@ -179,15 +184,20 @@ class rcube_sieve_engine case SIEVE_ERROR_CONNECTION: case SIEVE_ERROR_LOGIN: $this->rc->output->show_message('managesieve.filterconnerror', 'error'); + rcube::raise_error(array('code' => 403, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Unable to connect to managesieve on $host:$port"), true, false); break; + default: $this->rc->output->show_message('managesieve.filterunknownerror', 'error'); break; } - rcube::raise_error(array('code' => 403, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Unable to connect to managesieve on $host:$port"), true, false); + // reload interface in case of possible error when specified script wasn't found (#1489412) + if ($script_name !== null && !empty($list) && !in_array($script_name, $list)) { + $this->rc->output->command('reload', 500); + } // to disable 'Add filter' button set env variable $this->rc->output->set_env('filterconnerror', true); diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index 22a50ba4d..4e810b1ae 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -21,7 +21,7 @@ if (window.rcmail) { rcmail.add_element(tab, 'tabs'); } - if (rcmail.env.task == 'mail' || rcmail.env.action.indexOf('plugin.managesieve') != -1) { + if (rcmail.env.task == 'mail' || rcmail.env.action.startsWith('plugin.managesieve')) { // Create layer for form tips if (!rcmail.env.framed) { rcmail.env.ms_tip_layer = $('<div id="managesieve-tip" class="popupmenu"></div>'); @@ -40,7 +40,7 @@ if (window.rcmail) { rcmail.register_command('plugin.managesieve-setact', function() { rcmail.managesieve_setact() }); rcmail.register_command('plugin.managesieve-setget', function() { rcmail.managesieve_setget() }); - if (rcmail.env.action == 'plugin.managesieve' || rcmail.env.action == 'plugin.managesieve-save') { + if (rcmail.env.action.startsWith('plugin.managesieve')) { if (rcmail.gui_objects.sieveform) { rcmail.enable_command('plugin.managesieve-save', true); @@ -122,7 +122,7 @@ rcube_webmail.prototype.managesieve_del = function() var id = this.filters_list.get_single_selection(); if (confirm(this.get_label('managesieve.filterdeleteconfirm'))) { var lock = this.set_busy(true, 'loading'); - this.http_post('plugin.managesieve', + this.http_post('plugin.managesieve-action', '_act=delete&_fid='+this.filters_list.rows[id].uid, lock); } }; @@ -132,7 +132,7 @@ rcube_webmail.prototype.managesieve_act = function() var id = this.filters_list.get_single_selection(), lock = this.set_busy(true, 'loading'); - this.http_post('plugin.managesieve', + this.http_post('plugin.managesieve-action', '_act=act&_fid='+this.filters_list.rows[id].uid, lock); }; @@ -150,7 +150,7 @@ rcube_webmail.prototype.managesieve_setselect = function(list) this.show_contentframe(false); this.filters_list.clear(true); this.enable_command('plugin.managesieve-setdel', list.rowcount > 1); - this.enable_command( 'plugin.managesieve-setact', 'plugin.managesieve-setget', true); + this.enable_command('plugin.managesieve-setact', 'plugin.managesieve-setget', true); var id = list.get_single_selection(); if (id != null) @@ -179,7 +179,7 @@ rcube_webmail.prototype.managesieve_list = function(script) { var lock = this.set_busy(true, 'loading'); - this.http_post('plugin.managesieve', '_act=list&_set='+urlencode(script), lock); + this.http_post('plugin.managesieve-action', '_act=list&_set='+urlencode(script), lock); }; // Script download request @@ -188,7 +188,7 @@ rcube_webmail.prototype.managesieve_setget = function() var id = this.filtersets_list.get_single_selection(), script = this.env.filtersets[id]; - location.href = this.env.comm_path+'&_action=plugin.managesieve&_act=setget&_set='+urlencode(script); + location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_act=setget&_set='+urlencode(script); }; // Set activate/deactivate request @@ -199,7 +199,7 @@ rcube_webmail.prototype.managesieve_setact = function() script = this.env.filtersets[id], action = $('#rcmrow'+id).hasClass('disabled') ? 'setact' : 'deact'; - this.http_post('plugin.managesieve', '_act='+action+'&_set='+urlencode(script), lock); + this.http_post('plugin.managesieve-action', '_act='+action+'&_set='+urlencode(script), lock); }; // Set delete request @@ -212,7 +212,7 @@ rcube_webmail.prototype.managesieve_setdel = function() lock = this.set_busy(true, 'loading'), script = this.env.filtersets[id]; - this.http_post('plugin.managesieve', '_act=setdel&_set='+urlencode(script), lock); + this.http_post('plugin.managesieve-action', '_act=setdel&_set='+urlencode(script), lock); }; // Set add request @@ -224,7 +224,7 @@ rcube_webmail.prototype.managesieve_setadd = function() if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { var lock = this.set_busy(true, 'loading'); target = window.frames[this.env.contentframe]; - target.location.href = this.env.comm_path+'&_action=plugin.managesieve&_framed=1&_newset=1&_unlock='+lock; + target.location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_framed=1&_newset=1&_unlock='+lock; } }; @@ -384,7 +384,7 @@ rcube_webmail.prototype.load_managesieveframe = function(id) if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { target = window.frames[this.env.contentframe]; var msgid = this.set_busy(true, 'loading'); - target.location.href = this.env.comm_path+'&_action=plugin.managesieve&_framed=1' + target.location.href = this.env.comm_path+'&_action=plugin.managesieve-action&_framed=1' +(has_id ? '&_fid='+id : '')+'&_unlock='+msgid; } }; @@ -405,7 +405,7 @@ rcube_webmail.prototype.managesieve_dragend = function(e) var lock = this.set_busy(true, 'loading'); this.show_contentframe(false); - this.http_post('plugin.managesieve', '_act=move&_fid='+this.drag_filter + this.http_post('plugin.managesieve-action', '_act=move&_fid='+this.drag_filter +'&_to='+this.drag_filter_target, lock); } this.drag_active = false; @@ -458,7 +458,7 @@ rcube_webmail.prototype.managesieve_save = function() // Operations on filters form rcube_webmail.prototype.managesieve_ruleadd = function(id) { - this.http_post('plugin.managesieve', '_act=ruleadd&_rid='+id); + this.http_post('plugin.managesieve-action', '_act=ruleadd&_rid='+id); }; rcube_webmail.prototype.managesieve_rulefill = function(content, id, after) @@ -497,7 +497,7 @@ rcube_webmail.prototype.managesieve_ruledel = function(id) rcube_webmail.prototype.managesieve_actionadd = function(id) { - this.http_post('plugin.managesieve', '_act=actionadd&_aid='+id); + this.http_post('plugin.managesieve-action', '_act=actionadd&_aid='+id); }; rcube_webmail.prototype.managesieve_actionfill = function(content, id, after) diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 6970193c2..46c4e2e5b 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -41,6 +41,7 @@ class managesieve extends rcube_plugin // register actions $this->register_action('plugin.managesieve', array($this, 'managesieve_actions')); + $this->register_action('plugin.managesieve-action', array($this, 'managesieve_actions')); $this->register_action('plugin.managesieve-save', array($this, 'managesieve_save')); if ($this->rc->task == 'settings') { diff --git a/plugins/password/password.js b/plugins/password/password.js index 12c9074ff..1bfb2a0d3 100644 --- a/plugins/password/password.js +++ b/plugins/password/password.js @@ -1,4 +1,4 @@ -/* +/** * Password plugin script * @version @package_version@ */ @@ -8,17 +8,17 @@ if (window.rcmail) { // register command handler rcmail.register_command('plugin.password-save', function() { - var input_curpasswd = rcube_find_object('_curpasswd'); - var input_newpasswd = rcube_find_object('_newpasswd'); - var input_confpasswd = rcube_find_object('_confpasswd'); - - if (input_curpasswd && input_curpasswd.value=='') { + var input_curpasswd = rcube_find_object('_curpasswd'), + input_newpasswd = rcube_find_object('_newpasswd'), + input_confpasswd = rcube_find_object('_confpasswd'); + + if (input_curpasswd && input_curpasswd.value == '') { alert(rcmail.gettext('nocurpassword', 'password')); input_curpasswd.focus(); - } else if (input_newpasswd && input_newpasswd.value=='') { + } else if (input_newpasswd && input_newpasswd.value == '') { alert(rcmail.gettext('nopassword', 'password')); input_newpasswd.focus(); - } else if (input_confpasswd && input_confpasswd.value=='') { + } else if (input_confpasswd && input_confpasswd.value == '') { alert(rcmail.gettext('nopassword', 'password')); input_confpasswd.focus(); } else if (input_newpasswd && input_confpasswd && input_newpasswd.value != input_confpasswd.value) { diff --git a/plugins/vcard_attachments/vcardattach.js b/plugins/vcard_attachments/vcardattach.js index 29bc1a60f..b287acd4a 100644 --- a/plugins/vcard_attachments/vcardattach.js +++ b/plugins/vcard_attachments/vcardattach.js @@ -1,4 +1,4 @@ -/* +/** * vcard_attachments plugin script * @version @package_version@ */ @@ -13,6 +13,7 @@ function plugin_vcard_save_contact(mime_id) function plugin_vcard_insertrow(data) { var ctype = data.row.ctype; + if (ctype == 'text/vcard' || ctype == 'text/x-vcard' || ctype == 'text/directory') { $('#rcmrow'+data.uid+' > td.attachment').html('<img src="'+rcmail.env.vcard_icon+'" alt="" />'); } |