From 62b5bb50dca647fc9eea5d6bfbfc43f597574eb8 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 17 Mar 2010 18:23:43 +0100 Subject: [PATCH] MFB: Allow to update existing identities while requiring email confirmation (Sebastian Radish, Bug #8877). --- framework/Prefs/lib/Horde/Prefs/Identity.php | 19 ++++++++++++++----- horde/docs/CHANGES | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/framework/Prefs/lib/Horde/Prefs/Identity.php b/framework/Prefs/lib/Horde/Prefs/Identity.php index 98959a56c..0e0c8c733 100644 --- a/framework/Prefs/lib/Horde/Prefs/Identity.php +++ b/framework/Prefs/lib/Horde/Prefs/Identity.php @@ -484,13 +484,22 @@ class Horde_Prefs_Identity } $identity = $this->_prefs->convertFromDriver($confirm[$hash], Horde_Nls::getCharset()); - $verified = array(); - foreach ($identity as $key => $value) { - if (!$this->_prefs->isLocked($key)) { - $verified[$key] = $value; + $id = array_search($identity['id'], $this->getAll('id')); + if ($id === false) { + /* Adding a new identity. */ + $verified = array(); + foreach ($identity as $key => $value) { + if (!$this->_prefs->isLocked($key)) { + $verified[$key] = $value; + } + } + $this->add($verified); + } else { + /* Updating an existing identity. */ + foreach ($identity as $key => $value) { + $this->setValue($key, $value, $id); } } - $this->add($verified); $this->save(); unset($confirm[$hash]); $this->_prefs->setValue('confirm_email', serialize($confirm), false); diff --git a/horde/docs/CHANGES b/horde/docs/CHANGES index 23eae81cb..6ff3550f7 100644 --- a/horde/docs/CHANGES +++ b/horde/docs/CHANGES @@ -37,6 +37,8 @@ v4.0-cvs v3.3.7-cvs ---------- +[jan] Allow to update existing identities while requiring email confirmation + (Sebastian Radish, Bug #8877). [jan] Fix casting errors when using SQL shares and groups on PostgreSQL (Bug #8899). [gwr] Allow conf.d style directory configuration overriding (Request #8172). -- 2.11.0