[imp] Login without Domain, hook_vinfo help!

carlos maca macacohorde at gmail.com
Fri Jun 9 11:24:27 PDT 2006


I want to login without the domain, only with the username. *Jan Schneider,
give me a answer to search for the vinfo, and i find it on hooks.php on
/horde/config, but i try it and cant do it at all, can someone give me a
help in how to configure (_imp_hook_vinfo) line 765-702. Here is the copy of
the hook:
// Here is an example _imp_hook_vinfo function. If $type == 'vdomain', this
// function returns the HTTP_HOST variable after removing the 'mail.'
// subdomain.
//
// If $type == 'username', this function returns a unique username composed
of
// $_SESSION['imp']['user'] + vdomain.
//
// ex. $HTTP_HOST = 'mail.mydomain.com', $_SESSION['imp']['user'] =
'myname':
   //$vdomain  = 'mydomain.com'
   //$username = 'myname_mydomain_com'

if (!function_exists('_imp_hook_vinfo'))
function _imp_hook_vinfo($type = 'vdomain')
{
 $vdomain = getenv('HTTP_HOST');
   $vdomain = 'pop-ro.rnp.br'
   $vdomain = preg_replace('|^mail\.|i', '', $vdomain);
   $vdomain = String::lower($vdomain);
if ($type == 'username') {
        return preg_replace('|\.|', '_', $_SESSION['imp']['user'] . '_' .
$vdomain);
                                } elseif ($type == 'vdomain') {
                                     return $vdomain;
                 } else {
                    return PEAR::raiseError('invalid type: ' . $type);
                 }
             }
         }

*


More information about the imp mailing list