• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/integration/sender/allowedsender.php
  • Класс: BitrixCalendarIntegrationSenderAllowedSender
  • Вызов: AllowedSender::isAllowed
static function isAllowed($email, $userId = null)
{
	if ($email == '')
	{
		return false;
	}

	$address = new Address();
	$address->set($email);
	$normalizedEmail = $address->getEmail();
	if (!$normalizedEmail)
	{
		return false;
	}
	$normalizedEmail = mb_strtolower($normalizedEmail);
	$allowedSenders = self::getList($userId);
	if (empty(array_filter($allowedSenders, function ($item) use ($normalizedEmail)
	{
		return mb_strtolower($item['email']) === $normalizedEmail;
	})))
	{
		return false;
	}

	return true;
}