From a3b85d7b8560cdc1057fcaffa3acbd247b4b5b7a Mon Sep 17 00:00:00 2001
From: Thomas B. <thomas@roundcube.net>
Date: Mon, 07 Oct 2013 13:19:03 -0400
Subject: [PATCH] Merge pull request #133 from cwickert/release-0.9-canned-responses

---
 program/lib/Roundcube/rcube_user.php |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php
index b027506..586002a 100644
--- a/program/lib/Roundcube/rcube_user.php
+++ b/program/lib/Roundcube/rcube_user.php
@@ -2,8 +2,6 @@
 
 /*
  +-----------------------------------------------------------------------+
- | program/include/rcube_user.inc                                        |
- |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
  |                                                                       |
@@ -14,13 +12,11 @@
  | PURPOSE:                                                              |
  |   This class represents a system user linked and provides access      |
  |   to the related database records.                                    |
- |                                                                       |
  +-----------------------------------------------------------------------+
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  | Author: Aleksander Machniak <alec@alec.pl>                            |
  +-----------------------------------------------------------------------+
 */
-
 
 /**
  * Class representing a system user
@@ -167,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;
@@ -263,7 +267,7 @@
 
                 $sql_arr['email_ascii'] = $ascii_email;
                 $sql_arr['email']       = $utf8_email;
-                $sql_arr['ident']       = format_email_recipient($ascii_email, $ident['name']);
+                $sql_arr['ident']       = format_email_recipient($ascii_email, $sql_arr['name']);
             }
 
             $result[] = $sql_arr;

--
Gitblit v1.9.1