[Tickets #13185] Get access to current set of addresses in vacation_addresses() hook

noreply at bugs.horde.org noreply at bugs.horde.org
Wed May 14 14:21:01 UTC 2014


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/13185
------------------------------------------------------------------------------
  Ticket             | 13185
  Created By         | skhorde at smail.inf.fh-bonn-rhein-sieg.de
  Summary            | Get access to current set of addresses in
                     | vacation_addresses() hook
  Queue              | Ingo
  Version            | 3.1.4
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             |
------------------------------------------------------------------------------


skhorde at smail.inf.fh-bonn-rhein-sieg.de (2014-05-14 14:21) wrote:

Maybe related to bug #10764

When you enable this hook, the returned array overrides the addresses  
on save and each time the form is opened. I found no way to get the  
current set of addresses, which the user had modified probably.

Attached patch changes the interface of the hook function to pass the  
current value, just like the pref_init() hook does.

Now you can return defaults, if no addresses are available already,  
but keep that existing set otherwise:
//        // Example #2: Keep user-supplied values, return defaults only
//        return is_array($value) && count($array)
//         ? $value
//         : array($user . '@example.com', $user . '@foobar.com');

Because now you have both the user-modified set and the set of the  
administrator (well, the default one), the hook can keep user-supplied  
entries, add new ones or remove ones.



skhorde at smail.inf.fh-bonn-rhein-sieg.de (2014-05-14 14:21) uploaded:  
h5_ingo-hook-vacation_addresses.diff.bz2

http://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=h5_ingo-hook-vacation_addresses.diff.bz2&ticket=13185&fn=%2Fh5_ingo-hook-vacation_addresses.diff.bz2





More information about the bugs mailing list