| | |
| | | * It's clickable interface which operates on text scripts and communicates |
| | | * with server using managesieve protocol. Adds Filters tab in Settings. |
| | | * |
| | | * @version 2.0 |
| | | * @version 2.2 |
| | | * @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> |
| | | * |
| | | * Configuration (see config.inc.php.dist): |
| | | * Configuration (see config.inc.php.dist) |
| | | * |
| | | * $Id$ |
| | | */ |
| | | |
| | | class managesieve extends rcube_plugin |
| | |
| | | // filter add/edit action |
| | | else if (isset($_POST['_name'])) |
| | | { |
| | | $name = trim(get_input_value('_name', RCUBE_INPUT_POST)); |
| | | $name = trim(get_input_value('_name', RCUBE_INPUT_POST, true)); |
| | | $fid = trim(get_input_value('_fid', RCUBE_INPUT_POST)); |
| | | $join = trim(get_input_value('_join', RCUBE_INPUT_POST)); |
| | | |
| | |
| | | else foreach($headers as $idx => $header) |
| | | { |
| | | $header = $this->strip_value($header); |
| | | $target = $this->strip_value($targets[$idx]); |
| | | $target = $this->strip_value($targets[$idx], true); |
| | | $op = $this->strip_value($ops[$idx]); |
| | | |
| | | // normal header |
| | |
| | | { |
| | | $this->rc->output->show_message('managesieve.filtersaved', 'confirmation'); |
| | | $this->rc->output->add_script(sprintf("rcmail.managesieve_updatelist('%s', '%s', %d);", |
| | | isset($new) ? 'add' : 'update', $this->form['name'], $fid), 'foot'); |
| | | // $this->rc->output->command('managesieve_updatelist', isset($new) ? 'add' : 'update', $this->form['name'], $fid); |
| | | // $this->rc->output->send(); |
| | | isset($new) ? 'add' : 'update', Q($this->form['name']), $fid), 'foot'); |
| | | } |
| | | else |
| | | { |
| | |
| | | $out .= '<select id="action_mailbox' .$id. '" name="_action_mailbox[]" style="display:' |
| | | .(!isset($action) || $action['type']=='fileinto' ? 'inline' : 'none'). '">'; |
| | | |
| | | $this->rc->imap_init(true); |
| | | $this->rc->imap_connect(); |
| | | |
| | | $a_folders = $this->rc->imap->list_mailboxes(); |
| | | $delimiter = $this->rc->imap->get_hierarchy_delimiter(); |
| | |
| | | return $result; |
| | | } |
| | | |
| | | private function strip_value($str) |
| | | private function strip_value($str, $allow_html=false) |
| | | { |
| | | return trim(strip_tags($str)); |
| | | if (!$allow_html) |
| | | $str = strip_tags($str); |
| | | |
| | | return trim($str); |
| | | } |
| | | |
| | | private function error_class($id, $type, $target, $name_only=false) |