[imp] Access to "name" parameter from servers.php

Mike Cisar mlists at starmania.net
Mon Jul 3 11:26:15 PDT 2006


Hi Jan,

> > the 'name' value from that particular "$servers" section).  This
> > like the easiest method for us to maintain since the appropriate
> > welcome string can be placed in that field when the rest of the server
> > parameters are added when configuring a new server.
> 
> $_SESSION['imp']['server']

I've tried your suggestion and get a blank string... corresponding with the
following error in the httpd error log... "PHP Notice:  Undefined index:
imp in /var/www/html/horde/imp/login.php on line 157"

What I have done is take the existing line...
"$title = sprintf(_("Welcome to %s"), $registry->get('name', ($imp_auth) ?
'horde' : null));"

and changed it to...
$myservername = $_SESSION['imp']['server'];
"$title = "Welcome to the $myservername Web Portal";

I don't think there is a session yet before we log in, is that why it would
give that error?

Also, have checked the value of that variable after login just to see the
value, and it doesn't look like the info I was looking for anyway... it's
showing "mail.testdomain.com"

$servers['mail.testdomain.com'] = array(
    'name' => 'Big Test Corporation',
    'server' => 'mail.testdomain.com',
    ...
    'preferred' => 'webmail.testdomain.com',
...
$servers['mail.testdomain2.com'] = array(
    'name' => 'Small Test Corporation',
    'server' => 'mail.testdomain2.com',
    'hordeauth' => false,
    ...
    'preferred' => 'webmail.testdomain2.com',
...

What I really want is the value of 'name' and not 'server' as defined in
imp/config/servers.php (so by the example above, at the top of the login
screen we would have "Welcome to the Big Test Corporation Web Portal",
"Welcome to the Small Test Corporation Web Portal" dependant on which
'preferred' server is matched)

I tried changing to $_SESSION['imp']['name'] but that errors with 'undefined
index  name' so I'm guessing I still don't quite get how that works either
:-)

Maybe this better explains what I am trying to do anyway.

Thanks again for any assistance!

Regards,
>>>>> Mike <<<<<






More information about the imp mailing list