6.0.0-beta1
7/6/25

[#8877] Can not change mail address if confirmation is needed
Summary Can not change mail address if confirmation is needed
Queue Horde Base
Queue Version 3.3.6
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester sebastian.radish (at) gmx (dot) de
Created 02/18/2010 (5617 days ago)
Due
Updated 10/20/2010 (5373 days ago)
Assigned
Resolved 03/17/2010 (5590 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/20/2010 03:41:32 PM CVS Commit Comment #6 Reply to this comment
10/20/2010 02:47:55 PM sebastian (dot) radish (at) gmx (dot) de Comment #5 Reply to this comment
Lol .. just figured out you put me in the changelog. Thanks a lot.

But maybe you want to put my correct name there:
Sebastian Rettenberger
03/17/2010 04:49:20 PM Jan Schneider Comment #3
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Tweaked and committed, thanks!
03/17/2010 04:48:43 PM CVS Commit Comment #2 Reply to this comment
Changes have been made in CVS for this ticket:

Allow to update existing identities while requiring email confirmation 
(Sebastian Radish, Bug #8877).
http://cvs.horde.org/diff.php/framework/Prefs/Attic/Identity.php?rt=horde&r1=1.1.2.13&r2=1.1.2.14&ty=u
http://cvs.horde.org/diff.php/horde/docs/CHANGES?rt=horde&r1=1.515.2.599&r2=1.515.2.600&ty=u
02/18/2010 06:12:47 PM sebastian (dot) radish (at) gmx (dot) de Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Can not change mail address if confirmation is needed
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
I have configured Horde so users have exactly one identity and they 
need to confirm there mail address if they want to change it.

The problem is, that after confirmation the old address stays. The 
problem is, that if someone confirms an address the address is ALWAYS 
added as a new identity. I think this is not wanted for multiple 
identities either.

I have written a patch that works for me, but it would probably better 
if someone has a look at it and maybe make it official:
------------------------------------
--- a/horde/lib/Horde/Identity.php      2009-04-30 17:34:28.000000000 +0000
+++ b/horde/lib/Horde/Identity.php      2009-08-02 20:06:56.000000000 +0000
@@ -467,13 +467,18 @@
                  return array(_("Email addresses to confirm not 
found."), 'horde.message');
              } else {
                  $identity = 
$this->_prefs->convertFromDriver($confirm[$hash], NLS::getCharset());
-                $verified = array();
-                foreach ($identity as $key => $value) {
-                    if (!$this->_prefs->isLocked($key)) {
-                        $verified[$key] = $value;
-                    }
-                }
-                $this->add($verified);
+               $id = array_search($identity['id'], $this->getAll('id'));
+               if ($id !== false) {
+                   $this->setValue('from_addr', $identity['from_addr'], $id);
+               } else {
+                    $verified = array();
+                    foreach ($identity as $key => $value) {
+                        if (!$this->_prefs->isLocked($key)) {
+                            $verified[$key] = $value;
+                        }
+                     }
+                     $this->add($verified);
+               }
                  $this->save();
                  unset($confirm[$hash]);
                  $this->_prefs->setValue('confirm_email', 
serialize($confirm), false);

Saved Queries