[imp] Adding items to the menu that: Sub menu and who logged in

Eric Rostetter eric.rostetter at physics.utexas.edu
Wed Mar 12 17:01:30 PST 2003


Quoting Eric Robbins <erobbins at westusa.com>:

> How do I recognize the user who logs in?  I tried the following code and it

Try using Auth::getAuth()

> $_menu[] = array(
> 	'url' => 'http://www.someurl.com/user=echo($imp->user)'
> 	'text' =>
> 	'target' => '_blank'
> 	'onclick' => ''
> );
> 
> When I view my IMP email program in the browser the link comes up as
> http://www.someurl.com/user=echo($imp->user)
> Not parsing the user variable from the session.

because you put it inside single quotes.  You need to use double quotes
instead, or put the variable outside of the quotes. Examples:

> 	'url' => "http://www.someurl.com/user=$imp->user"
> 	'url' => 'http://www.someurl.com/user=' . $imp->user
> 	'url' => 'http://www.someurl.com/user=' . Auth::getAuth()

You seem to be missing commas at the end of the lines too, no?

Didn't understand your second question, so I'm not answering it...

-- 
Eric Rostetter
The Department of Physics
The University of Texas at Austin

Why get even? Get odd!


More information about the imp mailing list