Improved handling of Internationalized Domain Names in punycode

This commit is contained in:
the-djmaze 2024-03-12 16:06:17 +01:00
parent fd54796710
commit 696a2bbd3c
45 changed files with 661 additions and 236 deletions

View file

@ -57,12 +57,12 @@ class ChangePasswordDriverLDAP
public function ChangePassword(\RainLoop\Model\Account $oAccount, string $sPrevPassword, string $sNewPassword) : bool
{
$sDomain = \MailSo\Base\Utils::GetDomainFromEmail($oAccount->Email());
$sDomain = \MailSo\Base\Utils::getEmailAddressDomain($oAccount->Email());
$sUserDn = \strtr($this->sUserDnFormat, array(
'{domain}' => $sDomain,
'{domain:dc}' => 'dc='.\strtr($sDomain, array('.' => ',dc=')),
'{email}' => $oAccount->Email(),
'{email:user}' => \MailSo\Base\Utils::GetAccountNameFromEmail($oAccount->Email()),
'{email:user}' => \MailSo\Base\Utils::getEmailAddressLocalPart($oAccount->Email()),
'{email:domain}' => $sDomain,
'{login}' => $oAccount->IncLogin(),
'{imap:login}' => $oAccount->IncLogin(),

View file

@ -87,8 +87,8 @@ class ChangePasswordDriverPDO
':email' => $sEmail,
':oldpass' => $encrypt_prefix . \ChangePasswordPlugin::encrypt($encrypt, $sPrevPassword),
':newpass' => $encrypt_prefix . \ChangePasswordPlugin::encrypt($encrypt, $sNewPassword),
':domain' => \MailSo\Base\Utils::GetDomainFromEmail($sEmail),
':username' => \MailSo\Base\Utils::GetAccountNameFromEmail($sEmail),
':domain' => \MailSo\Base\Utils::getEmailAddressDomain($sEmail),
':username' => \MailSo\Base\Utils::getEmailAddressLocalPart($sEmail),
':login_name' => $oAccount->IncLogin()
);

View file

@ -7,8 +7,8 @@ class ChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin
const
NAME = 'Change Password',
VERSION = '2.20',
RELEASE = '2024-03-10',
REQUIRED = '2.23.0',
RELEASE = '2024-03-12',
REQUIRED = '2.35.3',
CATEGORY = 'Security',
DESCRIPTION = 'Extension to allow users to change their passwords';