[horde] problems writing a hook, hook called as guest before successfull login?
Dominique LALOT
dom.lalot at gmail.com
Wed Dec 17 15:58:52 UTC 2008
Hello,
I try to write a hook for imp. I wanted to find a way to get
search_sources working with localsql in share mode.
I did'nt understand why my hook was not working till I discovered that
my hook was called as guest before a successfull login. So I try to get
addressbooks for guest!
What should I do and is it normal? In the log, it appears clearly that
imp hook is called before successfull login.
Here is my horde authentication:
$conf['auth']['params']['app'] = 'imp';
$conf['auth']['driver'] = 'application';
Dec 17 16:39:55 HORDE [error] [] tracedom hook username: [pid 6049 on
line 50 of "/var/www/perso/horde-webmail-1.2.1/imp/config/hooks.php"]
Dec 17 16:39:55 HORDE [debug] [] Guest user does not have READ
permission for turba [pid 6049 on line 814 of
"/var/www/perso/horde-webmail-1.2.1/lib/Horde/Registry.php"]
Dec 17 16:39:55 HORDE [error] [] tracedom hook readable: Guest user is
not authorised for Address Book. [pid 6049 on line 58 of
"/var/www/perso/horde-webmail-1.2.1/imp/config/hooks.php"]
Dec 17 16:39:55 HORDE [error] [] tracedom hook [pid 6049 on line 66 of
"/var/www/perso/horde-webmail-1.2.1/imp/config/hooks.php"]
Dec 17 16:39:55 HORDE [error] [imp] tracedom hook username: [pid 6049
on line 50 of "/var/www/perso/horde-webmail-1.2.1/imp/config/hooks.php"]
Dec 17 16:39:55 HORDE [debug] [imp] Guest user does not have READ
permission for turba [pid 6049 on line 814 of
"/var/www/perso/horde-webmail-1.2.1/lib/Horde/Registry.php"]
Dec 17 16:39:55 HORDE [error] [imp] tracedom hook readable: Guest user
is not authorised for Address Book. [pid 6049 on line 58 of
"/var/www/perso/horde-webmail-1.2.1/imp/config/hooks.php"]
Dec 17 16:39:55 HORDE [error] [imp] tracedom hook [pid 6049 on line 66 of
Dec 17 16:39:55 HORDE [debug] [imp] Hook _prefs_change_hook_last_login
in application horde not called. [pid 6049 on line 1688 of
"/var/www/perso/horde-webmail-1.2.1/lib/Horde.php"]
*Dec 17 16:39:56 HORDE [notice] [imp] Login success for lalot [XXX] to
{yy:143 [imap/notls]} [pid 6049 on line 304 of*
and my hook
if (!function_exists('_prefs_hook_search_sources')) {
//require_once IMP_BASE . '/lib/MIME/Contents.php';
#require_once '/var/www/perso/horde/imp/lib/base.php';
function _prefs_hook_search_sources($username = null)
{
global $registry;
Horde::logMessage("tracedom hook username: $username",
__FILE__, __LINE__, PEAR_LOG_ERR);
$username = Auth::getAuth();
if ($registry->hasMethod('contacts/sources')) {
$readable = $registry->call('contacts/sources');
Horde::logMessage("tracedom hook $username readable:
".$readable, __FILE__, __LINE__, PEAR_LOG_ERR);
//$sources=array_keys($readable);
//foreach ($sources as $source){
Thanks
Dom
--
Dominique LALOT
Ingenieur Systeme et Reseaux
Universite de la Mediterrane (Aix-Marseille 2)
http://annuaire.univmed.fr/showuser.php?uid=lalot
More information about the horde
mailing list