-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
249 additions
and
45 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
namespace In2code\Lux\Domain\Service\Provider; | ||
|
||
/** | ||
* Class CustomerMail | ||
* this class can decide if an email belongs to a b2c or b2b contact | ||
*/ | ||
class CustomerMail | ||
{ | ||
protected AllowedMail $allowedMail; | ||
|
||
protected array $b2cEmailDomains = [ | ||
'1und1.de', | ||
'aok.de', | ||
'aon.at', | ||
'arcor.de', | ||
'barmer.de', | ||
'bluemail.ch', | ||
'bluewin.ch', | ||
'chello.at', | ||
'dak.de', | ||
'email.de', | ||
'ewe.net', | ||
'freenet.de', | ||
'gmail.com', | ||
'gmx.at', | ||
'gmx.ch', | ||
'gmx.de', | ||
'gmx.net', | ||
'googlemail.com', | ||
'hotmail.com', | ||
'hotmail.de', | ||
'htp-tel.de', | ||
'icloud.com', | ||
'ikk-classic.de', | ||
'kabelbw.de', | ||
'live.com', | ||
'mac.com', | ||
'mail.de', | ||
'me.com', | ||
'mozmail.com', | ||
'o2online.de', | ||
'online.de', | ||
'osnanet.de', | ||
'ostfalia.de', | ||
'outlook.com', | ||
'outlook.de', | ||
'posteo.de', | ||
't-online.de', | ||
'telekom.de', | ||
'tk.de', | ||
'versanet.de', | ||
'vodafone.de', | ||
'vodafonemail.de', | ||
'web.de', | ||
'yahoo.com', | ||
'yahoo.de', | ||
]; | ||
|
||
public function __construct(AllowedMail $allowedMail) | ||
{ | ||
$this->allowedMail = $allowedMail; | ||
} | ||
|
||
public function isB2cEmail(string $email): bool | ||
{ | ||
$domain = strtolower(substr(strrchr($email, '@'), 1)); | ||
return in_array($domain, $this->b2cEmailDomains) || $this->allowedMail->isEmailAllowed($email) === false; | ||
} | ||
|
||
public function isB2bEmail(string $email): bool | ||
{ | ||
return $this->isB2cEmail($email) === false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\Directive; | ||
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\Mutation; | ||
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\MutationCollection; | ||
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\MutationMode; | ||
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\Scope; | ||
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\SourceScheme; | ||
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue; | ||
use TYPO3\CMS\Core\Type\Map; | ||
|
||
return Map::fromEntries([ | ||
Scope::backend(), | ||
|
||
new MutationCollection( | ||
new Mutation( | ||
MutationMode::Extend, | ||
Directive::ImgSrc, | ||
SourceScheme::data, | ||
new UriValue('*'), | ||
), | ||
), | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.