Conditions | 6 |
Paths | 7 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
48 | public function checkLockedDomains($email) |
||
49 | { |
||
50 | $lockDomains = Plugin::getInstance()->getSettings()->lockDomains; |
||
51 | |||
52 | if (is_array($lockDomains) && $lockDomains !== []) { |
||
53 | $domainRejected = true; |
||
54 | |||
55 | foreach ($lockDomains as $lockDomain) { |
||
56 | if (strpos($email, '@' . $lockDomain) !== false) { |
||
57 | $domainRejected = false; |
||
58 | } |
||
59 | } |
||
60 | |||
61 | if ($domainRejected) { |
||
62 | throw new RegistrationException('Couldn’t register with this email (domain is not allowed): ' . $email); |
||
63 | } |
||
67 |