From 8c985e87d6d6b494c57c2f98371985cc591c39ff Mon Sep 17 00:00:00 2001
From: Thomas <thomas@roundcube.net>
Date: Mon, 07 Oct 2013 03:21:13 -0400
Subject: [PATCH] Backported the canned responses feature to the 0.9 release series

---
 program/lib/Roundcube/rcube_user.php |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php
index 505b190..586002a 100644
--- a/program/lib/Roundcube/rcube_user.php
+++ b/program/lib/Roundcube/rcube_user.php
@@ -163,8 +163,16 @@
         if (!$this->ID)
             return false;
 
-        $config    = $this->rc->config;
-        $old_prefs = (array)$this->get_prefs();
+        $plugin = $this->rc->plugins->exec_hook('preferences_update', array(
+            'userid' => $this->ID, 'prefs' => $a_user_prefs, 'old' => (array)$this->get_prefs()));
+
+        if (!empty($plugin['abort'])) {
+            return;
+        }
+
+        $a_user_prefs = $plugin['prefs'];
+        $old_prefs    = $plugin['old'];
+        $config       = $this->rc->config;
 
         // merge (partial) prefs array with existing settings
         $save_prefs = $a_user_prefs + $old_prefs;

--
Gitblit v1.9.1