[#3701] custom hook support for backend selection
Summary custom hook support for backend selection
Queue Ingo
Queue Version 1.1
Type Enhancement
State Rejected
Priority 1. Low
Owners
Requester srrafa (at) usc (dot) es
Created 03/28/2006 (829 days ago)
Due
Updated 05/25/2006 (771 days ago)
Assigned 04/26/2006 (800 days ago)
Resolved 05/25/2006 (771 days ago)
Attachments ingo-h3-1.1.patch.tgz Download
hooks.php.dist Download
ingo.patch.tgz Download
Milestone
Patch Yes

History
05/25/2006 Chuck Hagenbuch Comment #12
State ⇒ Rejected
Reply to this comment
I think that sometimes we forget it, too. :)
05/25/2006 srrafa (at) usc (dot) es Comment #11 Reply to this comment
Thanks for the tip. I will try it. I forget that the config files are 
php files too,  so they allow this degree of flexibility.
05/24/2006 Chuck Hagenbuch Comment #10 Reply to this comment
Instead of using hooks, or the preferred method, and instead of 
defining all 3 backends in backends.php, use your hooks code right in 
backends.php to figure out which backend the user belongs to, then 
define only that one.
05/24/2006 srrafa (at) usc (dot) es Comment #9 Reply to this comment
Sorry if I was unclear - new features should always be against HEAD,
not a release version (see http://horde.org/source/contribute.php),
so that's what I was applying it against.
Ok. Sorry for that. I use to work on stable releases to get the 
patches working on our production system as fast as possible.

I'll modify it using a CVS checkout if you finally find this patch useful.
What about my question on why this is necessary?
Well, getBackend() in lib/Ingo.php selects the backend wich its 
'preferred' field equals $_SERVER['SERVER_NAME'] or 
$_SERVER['HTTP_HOST']

In our University we have only one URL to access the webmail system 
but three different IMAPservers wich need different backends (procmail 
and sieve, the 3rd server is Exchange), so the unpatched system always 
uses the same backend.

Currently, I have no idea on how to achieve this using backends.php
05/24/2006 Chuck Hagenbuch Comment #8 Reply to this comment
Sorry if I was unclear - new features should always be against HEAD, 
not a release version (see http://horde.org/source/contribute.php), so 
that's what I was applying it against.

What about my question on why this is necessary?
05/24/2006 srrafa (at) usc (dot) es Comment #7 Reply to this comment
The patch to Ingo.php does not apply for me.
I've just downloaded back the patch and a fresh copy of Ingo-h3-1.1.1 
from ftp.horde.org and it applies without errors to both files.
05/24/2006 Chuck Hagenbuch Comment #6
Taken from Horde DevelopersHorde Developers
State ⇒ Feedback
Reply to this comment
The patch to Ingo.php does not apply for me.

Also, is this really something that can't be done inside the 
backends.php config file?
04/26/2006 Jan Schneider State ⇒ Assigned
 
04/25/2006 srrafa (at) usc (dot) es Comment #5
New Attachment: ingo.patch.tgz Download
Reply to this comment
Here's the updated version of the patch with the requested changes.

I've opened an enhancement ticket  for the passwd module to implement   
a similar functionality (see ticket #3821)

I'll update it accordingly when we close all the pending issues with 
this ticket
04/24/2006 srrafa (at) usc (dot) es Comment #4
New Attachment: hooks.php.dist Download
Reply to this comment
Sure.
Here you have an example of the custom hook. I need a little more time 
to address the rest of the issues. I'll upload it tomorrow.
04/24/2006 Jan Schneider Comment #3
State ⇒ Feedback
Reply to this comment
Can you update your patch to use Horde::callHook() instead, use a 
different hook name (_ingo_hook_backend_select), and provide an 
example for horde/config/hooks.php.dist?
03/28/2006 Jan Schneider Comment #2
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
Reply to this comment
Looks good.
03/28/2006 srrafa (at) usc (dot) es Comment #1
Priority ⇒ 1. Low
Summary ⇒ custom hook support for backend selection
Type ⇒ Enhancement
State ⇒ New
Queue ⇒ Ingo
New Attachment: ingo-h3-1.1.patch.tgz Download
Reply to this comment
The attached file contains two patches against ingo-h3-1.1

conf.xml.patch for config/conf.xml
Ingo.php.patch for lib/Ingo.php

They add suport for one custom hook for backend Selection 
(_ingo_hook_selectBackend)