[horde] _prefs_hook_from_addr(): inexistant index in $_SESSION

Hans Lellelid hans at appliedsec.com
Tue Feb 11 06:36:52 PST 2003


I'm not sure what the solution to this problem is, but I can tell you 
that the problem is that hooks are called very early on in the order of 
things -- in this case, before your $_SESSION has been setup.  Is IMP 
session setup in imp/lib/base.php ?  Is it setup before the call to 
$registry->pushApp() ?

Also ... you may want to simply wrap your hook declaration in if 
(Auth::getAuth()) { } because you probably don't want Horde to try to 
set those hooks if you are not logged-in.  (Preferences can exist for 
users who are not logged-in, which means that Horde will process 
preference hooks pre-login too).  Maybe this would solve your problem 
altogether?

Cheers,
Hans

Florent AIDE wrote:

>Hello list, 
> 
>When I try to use the _prefs_hook_from_addr() hook, in horde/config/hooks.php 
>and activate it in horde/imp/config/prefs.php 
> 
>I use   
> 
>$cmd = '/usr/bin/ldapsearch -b o=myorg -s sub cn='; 
>$cmd .= escapeShellCmd($_SESSION['imp']['user']); 
>$cmd .= ' | /usr/bin/grep mail | /usr/bin/awk \'{print $2}\''; 
> 
>and php answers me: 
> 
>Notice: Undefined index: imp in /MYPATH/config/hooks.php on line 102 
> 
>it seems that $_SESSION is not yet existant.... I cannot find the imp index... 
> 
>Where is the catch ? The comment in the sample hook tell that we can use 
>$_SESSION['imp']['user'] 
>It even uses it in the sample code... 
> 
>I also tried to use $_SESSION['__auth']['userID'] but with the same error, the 
>script does not find the __auth index 
> 
>Anyone got an idea ? 
>Thanks a lot. 
>
>
>  
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3299 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.horde.org/archives/horde/attachments/20030211/eb169ae6/smime-0002.bin


More information about the horde mailing list