From 7b274b8871767a9a28e18cb182d8e49f26a61cd7 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 03 Oct 2012 03:05:37 -0400
Subject: [PATCH] Fix so scripts listed in managesieve_filename_exceptions aren't displayed on the list (#1488724)

---
 plugins/managesieve/Changelog       |    3 +++
 plugins/managesieve/managesieve.php |    8 +++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index c0428c4..ce93861 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,7 +1,10 @@
+* version 6.0 [2012-10-03]
+-----------------------------------------------------------
 - Fixed issue with DBMail bug [http://pear.php.net/bugs/bug.php?id=19077] (#1488594)
 - Added support for enotify/notify (RFC5435, RFC5436, draft-ietf-sieve-notify-00)
 - Change default port to 4190 (IANA-allocated), add port auto-detection (#1488713)
 - Added request size limits detection and script corruption prevention (#1488648)
+- Fix so scripts listed in managesieve_filename_exceptions aren't displayed on the list (#1488724)
 
 * version 5.2 [2012-07-24]
 -----------------------------------------------------------
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php
index 7282ff2..7f4624e 100644
--- a/plugins/managesieve/managesieve.php
+++ b/plugins/managesieve/managesieve.php
@@ -62,7 +62,7 @@
         "x-beenthere",
     );
 
-    const VERSION  = '5.2';
+    const VERSION  = '6.0';
     const PROGNAME = 'Roundcube (Managesieve)';
     const PORT     = 4190;
 
@@ -1839,6 +1839,12 @@
             if ($active = $this->sieve->get_active()) {
                 $this->active = array($active);
             }
+
+            // Hide scripts from config
+            $exceptions = $this->rc->config->get('managesieve_filename_exceptions');
+            if (!empty($exceptions)) {
+                $this->list = array_diff($this->list, (array)$exceptions);
+            }
         }
 
         return $this->list;

--
Gitblit v1.9.1