[imp] Hook - translate char /create username from full email.

Lauro Costa G. Borges lauro at npd.ufsc.br
Wed Dec 12 17:25:19 UTC 2007



  Hi,


  I'm using Horde 3.1.4, Imp 4.1.4 and Passwd 3.0.1.

  I set passwd to use a custom hook to send the correct username to  
the backend:

  $conf['hooks']['username'] = true; on horde/passwd/config/conf.php

  and on horde/config/hooks.php :

  --
  if (!function_exists('_passwd_hook_username')) {
         function _passwd_hook_username($userid)
         {
                 $userid_retorn = eregi_replace("@", "~", $userid);
                 return $userid_retorn;
         }
  }
  --

  This works. If I let the user type his username at the change  
password page, and he types something like: "me at ourdomain.com" the "@"  
gets translated to "~". I sniffed the traffic, it works ok.

  The problem is Horde is set to use Imp as auth app, and Imp does not  
use that hook, of course. I tried copying the function and renaming it  
to _imp_hook_password, and also adding  $conf['hooks']['username'] =  
true to horde/imp/config/conf.php (I don't know if the applications  
use any hook instance on their conf.php or if just some things are  
able to use hooks, which makes more sense, code to use and process  
that hook has to exist), and it didn't work. Is there a hook on Imp  
which I can use to translate characters the user types in the login  
form?


  thanks

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the imp mailing list