[sork] passwd hooks problem

Chris Nojima chris at toastedpixel.com
Thu Apr 8 10:30:36 PDT 2004


Hi all,

I've been hosting a few virtual domains on my qmail/horde box.
Through reading this group, i've managed to get horde/passwd to play 
nice with my vpopmail+mysql authentication backend.

The final issue before i'll be happy is to have the "Username:" field to 
fill automatically with the full email address.

I've read a few post here saying, "Use the hooks bit."

I've tried, read the documentation, re-read posts, but it doesn't seem 
to do anything.

The default settings in horde/passwd/config/conf.php is:
_____________________________________________________________
$conf['hooks']['username'] = false;
$conf['hooks']['default_username'] = false;
_____________________________________________________________


i've set it to:
_____________________________________________________________
$conf['hooks']['username'] = true;
$conf['hooks']['default_username'] = false;
_____________________________________________________________


in horde/config/hooks.php
i've deleted everything but this:
_____________________________________________________________
<?php 

if (!function_exists('_passwd_hook_username')) {
    function _passwd_hook_username($userid)
    {
    $domain = str_replace('www.','',$_SERVER["SERVER_NAME"]);
        return $userid . $domain;
    }
}
_____________________________________________________________
(i don't think this is an issue, but in the CVS version of 
hooks.php.dist, there is no trailing "?>" to close the php doc - in any 
case, i've tried it both ways)


the original line was:
_____________________________________________________________
if (!function_exists('_passwd_hook_username')) {
    function _passwd_hook_username($userid)
    {
        return $userid . '@example.com';
    }
}
_____________________________________________________________


I would've expected at least the default line to rewrite the username, 
but it did nothing.

Am i missing something glaringly obvious?  Thanks for any help offered!

-chris



More information about the sork mailing list