vinfo hook no longer needed - use preauth hook instead
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 23 Jul 2009 17:00:44 +0000 (11:00 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 23 Jul 2009 17:02:37 +0000 (11:02 -0600)
imp/config/conf.xml
imp/config/hooks.php.dist
imp/docs/UPGRADING
imp/lib/Auth.php

index 4348364..0e03d70 100644 (file)
 
  <configtab name="hooks" desc="Custom Hooks">
   <configsection name="hooks">
-   <configboolean name="vinfo" required="false" desc="Should we use a custom
-   virtual users hook? If so, make sure you define _imp_hook_vinfo() in
-   hooks.php. The hook will be used to set $_SESSION['imp']['user'] at login
-   time. There are examples in hooks.php.dist.">false</configboolean>
    <configboolean name="postsent" required="false" desc="Should we
    run a custom function after sending a message? If so, make sure you define
    _imp_hook_postsent() in hooks.php. The hook will be used to do anything
index fa8293d..ea842f5 100644 (file)
 //     }
 // }
 
-// Here is an example _imp_hook_vinfo function.
-//
-// If $type == 'username', this function returns a unique username composed of
-// username + vdomain. $data is set to the username.
-//
-// If $type == 'vdomain', this function returns the HTTP_HOST variable after
-// removing the 'mail.' subdomain. $data is null.
-//
-// ex. $HTTP_HOST = 'mail.mydomain.com', $username = 'myname':
-//   $vdomain  = 'mydomain.com'
-//   $username = 'myname_mydomain_com'
-//
-// Throw a Horde_Exception object on failure.
-
-// if (!function_exists('_imp_hook_vinfo')) {
-//     function _imp_hook_vinfo($type = 'username', $data = null)
-//     {
-//         $vdomain = Horde_String::lower(preg_replace('|^mail\.|i', '', getenv('HTTP_HOST')));
-//
-//         switch ($type) {
-//         case 'username':
-//             return preg_replace('|\.|', '_', $data . '_' . $vdomain);
-//
-//         case 'vdomain':
-//             return $vdomain;
-//
-//         default:
-//             throw new Horde_Exception('invalid type: ' . $type);
-//         }
-//     }
-// }
-
 // Here is an example of the _imp_hook_fetchmail_filter function to run
 // SpamAssassin on email before it is written to the mailbox.
 // Note: to use the spamassassin instead of spamd, change 'spamc' to
index 40c387f..ac280b4 100644 (file)
@@ -24,7 +24,7 @@ supported.
 TODO
 ----
 * servers.php has changed
-* imp_hook_vinfo has changed
+* imp_hook_vinfo has been removed - use preauth hook instead
 * alternative_display, attachment_display, forward_default pref is gone.
 * imp_hook_spam_bounce -> imp_hook_spam_email
 * imp_hook_msglist_format hook has been removed - instead:
index 6e967c7..0801e80 100644 (file)
@@ -201,14 +201,6 @@ class IMP_Auth
             'showunsub' => false
         );
 
-        /* Run the username through virtualhost expansion functions if
-         * necessary. */
-        if (!empty($conf['hooks']['vinfo'])) {
-            try {
-                $credentials['userId'] = Horde::callHook('_imp_hook_vinfo', array('username', $credentials['userId']), 'imp');
-            } catch (Horde_Exception $e) {}
-        }
-
         /* Load the server configuration. */
         $ptr = $GLOBALS['imp_imap']->loadServerConfig($credentials['server']);
         if ($ptr === false) {