[imp] imp_get_vinfo bug and fix ?

Jan Schneider jan at horde.org
Mon Sep 22 11:36:16 PDT 2003


Zitat von Andrew Morgan <morgan at orst.edu>:

>
> On Mon, 22 Sep 2003, Andrew Morgan wrote:
>
> > On Mon, 22 Sep 2003, stephan wrote:
> >
> > > Hello there,
> > >
> > > like Andrew Roseman posted on Fri Sep 5 07:18:28 PDT 2003,
> > > something about imp_get_vinfo is broken.
> > >
> > > I downloaded the actual stable releases of imp and horde
> > > the last days and figured out that $imp['user'] does
> > > not contain anything at all when a imp_get_vinfo function gets
> > > called. Which probably was not the case before, because
> > > it worked then.
> > >
> > > And, yes, after what I might see, inside IMP.php is something
> > > missing right before calling the vinfo hook, is it possible
> > > that $imp['user'] no longer is the way the user information
> > > is stored ? If so would it be $_SESSION['imp']['user'] ?
> > > For instance, this is how it works for me, if I am
> > > right you should correct your imp/config/conf.php to use
> > > this variable instead of the old one.
> > >
> > > If I am wrong, the please correct the bug ...
> > >
> > > Regards, Stephan
> >
> > Let me second this.  I just found this exact same bug and was about to
> > report it here, but Stephan beat me to it.  I've tested that using
> > $_SESSION['imp']['user'] instead of $imp['user'] works here.  However,
> a
> > grep shows that conf.php is not the only place that is still being
> used:
> >
> > ./lib/Identity/IMP.php
> > ./lib/Maintenance/Task/purge_trash.php
> > ./message.php
> > ./compose.php
> > ./mailbox.php
> > ./config/conf.php.dist
> > ./config/conf.php
> >
> > I'll look into the other occurances and see if there are problems...
>
> Okay, I guess I don't understand how it ever worked!  :P

Because of:
$GLOBALS['imp'] = &$_SESSION['imp'];
in several places.

> I'll leave it to someone that knows this code to figure out the proper
> fix.  For now, I've changed the code in my vinfo hook to use
> $_SESSION['imp']['user'] instead of $imp['user'].

This is hook and hence only an example. You have to put there anything that
matches your needs. But agreed that this is example won't work in any case,
so it's fixed now in CVS.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the imp mailing list