| | |
| | | 1 => 'notifyimportancehigh' |
| | | ); |
| | | |
| | | const VERSION = '8.1'; |
| | | const VERSION = '8.2'; |
| | | const PROGNAME = 'Roundcube (Managesieve)'; |
| | | const PORT = 4190; |
| | | |
| | |
| | | * |
| | | * @return int Connection status: 0 on success, >0 on failure |
| | | */ |
| | | public function load_script($script_name = null) |
| | | protected function load_script($script_name = null) |
| | | { |
| | | // Get list of scripts |
| | | $list = $this->list_scripts(); |
| | | |
| | | if ($script_name === null || $script_name === '') { |
| | | // get (first) active script |
| | | if (!empty($this->active[0])) { |
| | | if (!empty($this->active)) { |
| | | $script_name = $this->active[0]; |
| | | } |
| | | else if ($list) { |
| | |
| | | } |
| | | else if ($action == 'setget') { |
| | | $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); |
| | | $script = $this->sieve->get_script($script_name); |
| | | $script = $this->sieve->get_script($script_name); |
| | | |
| | | if (PEAR::isError($script)) |
| | | if (is_a($script, 'PEAR_Error')) { |
| | | exit; |
| | | } |
| | | |
| | | $browser = new rcube_browser; |
| | | |
| | |
| | | |
| | | // Handle active script(s) and list of scripts according to Kolab's KEP:14 |
| | | if ($this->rc->config->get('managesieve_kolab_master')) { |
| | | |
| | | // Skip protected names |
| | | foreach ((array)$this->list as $idx => $name) { |
| | | $_name = strtoupper($name); |
| | |
| | | foreach ($rules['actions'] as $action) { |
| | | if ($action['type'] == 'include' && empty($action['global'])) { |
| | | $name = preg_replace($filename_regex, '', $action['target']); |
| | | $this->active[] = $name; |
| | | // make sure the script exist |
| | | if (in_array($name, $this->list)) { |
| | | $this->active[] = $name; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (!empty($exceptions)) { |
| | | $this->list = array_diff($this->list, (array)$exceptions); |
| | | } |
| | | } |
| | | |
| | | // reindex |
| | | if (!empty($this->list)) { |
| | | $this->list = array_values($this->list); |
| | | } |
| | | |
| | | return $this->list; |
| | |
| | | */ |
| | | protected function init_script() |
| | | { |
| | | $this->script = $this->sieve->script->as_array(); |
| | | |
| | | if (!$this->script) { |
| | | if (!$this->sieve->script) { |
| | | return; |
| | | } |
| | | |
| | | $this->script = $this->sieve->script->as_array(); |
| | | |
| | | $headers = array(); |
| | | $exceptions = array('date', 'currentdate', 'size', 'body'); |
| | | |