From f06aa8058b7e32ba32d4551074b6e0b8a300f751 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Mon, 21 Oct 2013 15:02:40 -0400
Subject: [PATCH] Bump version after security fix

---
 program/include/rcube_plugin_api.php |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php
index fbf3584..a1e634a 100644
--- a/program/include/rcube_plugin_api.php
+++ b/program/include/rcube_plugin_api.php
@@ -30,12 +30,14 @@
 class rcube_plugin_api
 {
   static private $instance;
-  
+
   public $dir;
   public $url = 'plugins/';
   public $output;
   public $config;
-  
+  public $allowed_prefs         = array();
+  public $allowed_session_prefs = array();
+
   public $handlers = array();
   private $plugins = array();
   private $tasks = array();
@@ -188,6 +190,9 @@
             $plugin->init();
             $this->plugins[$plugin_name] = $plugin;
           }
+          if (!empty($plugin->allowed_prefs)) {
+            $this->allowed_prefs = array_merge($this->allowed_prefs, $plugin->allowed_prefs);
+          }
           return true;
         }
       }
@@ -230,6 +235,20 @@
         'message' => "Invalid callback function for $hook"), true, false);
   }
 
+  /**
+   * Allow a plugin object to unregister a callback.
+   *
+   * @param string $hook Hook name
+   * @param mixed  $callback String with global function name or array($obj, 'methodname')
+   */
+  public function unregister_hook($hook, $callback)
+  {
+    $callback_id = array_search($callback, $this->handlers[$hook]);
+    if ($callback_id !== false) {
+      unset($this->handlers[$hook][$callback_id]);
+    }
+  }
+
 
   /**
    * Triggers a plugin hook.

--
Gitblit v1.9.1