From 43752a8d04b5b2ccc5b85b907c96887be32d50ed Mon Sep 17 00:00:00 2001 From: alec Date: Wed, 7 Sep 2011 07:25:54 +0000 Subject: - 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 --- plugins/managesieve/managesieve.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins/managesieve/managesieve.php') 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; } } -- cgit v1.2.3