• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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