• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

IMP Login Patch

E

evangelion

Guest
I found this in :
/usr/share/psa-horde/imp/lib/Session.php

PHP:
/* Patch for PSA: I not found a config based-way to disable
         * short names, without @ so apply this patch */

        if (!preg_match('/^(.+)@(.+)$/', $imapuser, $matches)){                                 $imapuser .= '@' . $DomainName;
            $_SESSION['imp']['user'] = trim($imapuser);
        }

By the way IMP has this function and is checked just a few lines before:
PHP:
 /* Run the username through virtualhost expansion functions if
         * necessary. */
        $_SESSION['imp']['user'] = $imapuser;
        if (!empty($conf['hooks']['vinfo'])) {
            require_once HORDE_BASE . '/config/hooks.php';
            if (function_exists('_imp_hook_vinfo')) {
                $_SESSION['imp']['user'] = call_user_func('_imp_hook_vinfo');
            }
        }

I reccomend You to put these lines in horde/hooks.php instead


PHP:
if (!function_exists('_mimp_hook_vinfo')) {
    function _mimp_hook_vinfo($type = 'username')
    {
        $vdomain = getenv('HTTP_HOST');
        $vdomain = preg_replace('|^webmail\.|i', '', $vdomain);
        $vdomain = String::lower($vdomain);

        if ($type == 'username') {
            if( strpos( $_SESSION['mimp']['user'], '@' ) === FALSE ) {
                return $_SESSION['mimp']['user'] . '@' . $vdomain;
            }
            else {
                return $_SESSION['mimp']['user'];
            }
        } elseif ($type == 'vdomain') {
            return $vdomain;
        } else {
            return PEAR::raiseError('invalid type: ' . $type);
        }
    }
}

Thank You
 
Back
Top