[imp] Problem with vinfo hook & realms

Todd Aiken taiken at ubishops.ca
Thu Jul 22 08:40:07 PDT 2004


I am trying to use the following example in vinfo hook which I found 
in a message on Marc dated back 6/12/2002 from Jeremy Gault:

if(!function_exists('imp_get_vinfo')) {
  function imp_get_vinfo ($type = 'username') {
    global $conf, $imp, $server, $servers;
    include IMP_BASE . '/config/servers.php';
    if($type == 'username') {
      if(!empty($servers[$server]['realm'])) {
        $vinfo_return_user = $imp['user'] . '@' .
          $servers[$server]['realm'];
      } else {
        $vinfo_return_user = $imp['user]';
      }
      return $vinfo_return_user;
    } elseif {$type == "vdomain") {
      return $vdomain;
    } else {
      return new PEAR_Error('invalid type: ' . $type);
    }
  }
}

However, when I try to use it, I always get the following error 
messages before the login dialog boxes:

Warning: Undefined index: alternate_login in 
/usr/local/apache/htdocs/horde2/imp/login.php on line 96

Warning: Undefined index: server in 
/usr/local/apache/htdocs/horde2/imp/login.php on line 143

Warning: Undefined index: server in 
/usr/local/apache/htdocs/horde2/imp/templates/login/login.inc on line 
80

Warning: Undefined index: server in 
/usr/local/apache/htdocs/horde2/imp/templates/login/login.inc on line 
83

Warning: Undefined index: server in 
/usr/local/apache/htdocs/horde2/imp/templates/login/login.inc on line 
89

Warning: Undefined index: server in 
/usr/local/apache/htdocs/horde2/imp/templates/login/login.inc on line 
127

What I am trying to do is use the realm variable in my server 
definitions to allow a user to type in only their user name, but then 
the string in the realm variable is added to the username, which 
could be one of several things depending on what server the user 
chooses.  All of the server choices would point to the same IMAP 
server, but the realm string would be different depending on what 
kind of user is trying to log in (faculty, staff, student, etc.).

What am I doing wrong?

test.php entries for Horde and IMP follow.

--------

Horde Versions

    * Horde: 2.2.5-cvs
    * IMP: 3.2.3-cvs (run IMP tests)
    * Turba: 1.2.2-cvs
    * Passwd: 2.2.1-cvs

PHP Version

    * View phpinfo() screen
    * PHP Version: 4.1.2
    * PHP Major Version: 4.1
    * PHP Minor Version: 2
    * PHP Version Classification: release
    * You are running a supported version of PHP.

PHP Module Capabilities

    * DOM XML Support: No
    * FTP Support: No
    * Gettext Support: Yes
    * IMAP Support: Yes
    * LDAP Support: Yes
    * MCAL Support: No
    * Mcrypt Support: No
    * MySQL Support: Yes
    * PostgreSQL Support: No
    * XML Support: Yes

Miscellaneous PHP Settings

    * magic_quotes_runtime disabled: Yes
    * file_uploads enabled: Yes
    * safe_mode disabled: Yes
    * trans_sid disabled: No
    * Horde will work with session.trans_sid turned on, but you may 
see double session-ids in your URLs, and if the session name in 
php.ini differs from the session name configured in Horde, you may 
get two session ids and see other odd behavior. The URL-rewriting 
that trans_sid does also tends to break XHTML compliance.

PHP Sessions

    * Session counter: 1
    * To unregister the session: click here

PEAR

    * PEAR - Yes
    * Recent PEAR - No
    * This version of PEAR is not recent enough. See the Horde PEAR 
page for details.
    * Mail - Yes
    * Log - Yes
    * DB - Yes
    * Net_Socket - Yes
    * Date - Yes
    * HTML_Common/HTML_Select - Yes

--------

IMP Version

    * IMP: 3.2.3-cvs

PHP Version

    * View phpinfo() screen
    * PHP Version: 4.1.2
    * PHP Major Version: 4.1
    * PHP Minor Version: 2
    * PHP Version Classification: release
    * You are running a supported version of PHP.

PHP Module Capabilities

    * IMAP Support: Yes

--------

Thanks in advance.

CU L8R...

Todd A. Aiken 
Systems Analyst - Administrator
Cole Computer Centre
BISHOP'S UNIVERSITY
Lennoxville, Quebec, CANADA

"GUIs on servers... That's like putting an air conditioner on a 
motorcycle...
 or HTML in an email message."

-----BEGIN GEEK CODE BLOCK-----
Version 3.12 (http://www.geekcode.com)
GCS$/MU d+(-) s++:+ a C++$ UL++++$ P+ L++ E->+ W+>++ N++ o? K-
w O- M V? PS PE- Y PGP- t+ 5 X R- tv+ b DI(+) D++ G e+ h !r>r+++ y-
------END GEEK CODE BLOCK------





More information about the imp mailing list