[imp] How to use imp_get_vinfo

eculp at encontacto.net eculp at encontacto.net
Thu May 1 18:03:46 PDT 2003


Quoting Thomas O'Brien <thomas at creativebusinessystems.com>:

| Ed,
| I hadn't tried prior to my last reply. I just wanted to give you more
| information. It sounded like you needed more in order to advise me.
|
| At any rate, found something. Your function was called _imp_hook_vinfo.
| I was refrencing imp_get_vinfo. So I fixed that so conf.php now reads
|
| $conf['hooks']['vinfo'] = '_imp_hook_vinfo';

In current HEAD it is just

$conf['hooks']['vinfo'] = true;

and I've ereased my old versions, I'm afraid. Ahhhh no I think I've
found one.  This is from last year so YMMV.  I can't keep up with all
the different combinations of Horde and Imp.  Sorry.

In this version the hook is in horde/imp/config/conf.php

If yours is the same, Try:

$conf['hooks']['vinfo'] = 'imp_get_vinfo';

if (!function_exists('imp_get_vinfo')) {
     function imp_get_vinfo ( $type ='username') {
        global $conf, $imp;

        $vdomain = strtolower(preg_replace('|^www\.|i', '', $_SERVER['HTTP_HOST
']));

         if ($type == 'username') {
             return $_SESSION['imp']['user'] . '@' . $vdomain;
        } elseif ($type == "vdomain") {
            return $vdomain;
        } else {
            return new PEAR_Error('invalid type: ' . $type);
        }
    }
}

If it isn't, is there a horde/config/hooks.php?

We are close, I hope.

ed


-------------------------------------------------



More information about the imp mailing list