diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-07 07:25:54 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-07 07:25:54 +0000 |
| commit | 43752a8d04b5b2ccc5b85b907c96887be32d50ed (patch) | |
| tree | 5aa2880e44b2d76e241b23fcc9cfe5c5dc2415f2 /plugins/managesieve/managesieve.php | |
| parent | 6c8f69857832b4a3188cd1b9230f950f4054e10b (diff) | |
- Add managesieve_script_name option for default name of the script (#1487956)
git-svn-id: https://svn.roundcube.net/trunk@5187 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/managesieve/managesieve.php')
| -rw-r--r-- | plugins/managesieve/managesieve.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 8161516f1..da3d4c069 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -205,14 +205,18 @@ class managesieve extends rcube_plugin else { // if script not exists build default script contents $script_file = $this->rc->config->get('managesieve_default'); - $script_name = 'roundcube'; + $script_name = $this->rc->config->get('managesieve_script_name'); + + if (empty($script_name)) + $script_name = 'roundcube'; + if ($script_file && is_readable($script_file)) $content = file_get_contents($script_file); - // add script and set it active - if ($this->sieve->save_script($script_name, $content)) - if ($this->sieve->activate($script_name)) - $_SESSION['managesieve_active'] = $script_name; + // add script and set it active + if ($this->sieve->save_script($script_name, $content)) + if ($this->sieve->activate($script_name)) + $_SESSION['managesieve_active'] = $script_name; } } |
