| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function checkEmail($request = null, $params = []) |
||
| 40 | { |
||
| 41 | /** @var Member|null $user */ |
||
| 42 | $user = Security::getCurrentUser(); |
||
| 43 | |||
| 44 | if ($user) { |
||
| 45 | /** @var HaveIBeenPwnedService $service */ |
||
| 46 | $service = Injector::inst()->createWithArgs(HaveIBeenPwnedService::class, [$params]); |
||
| 47 | |||
| 48 | $breachedEmails = $service->checkPwndEmail($user); |
||
| 49 | |||
| 50 | $contentText = str_replace("\r\n", '<br />', $breachedEmails); |
||
| 51 | |||
| 52 | $this->dataRecord->Content .= '<p>' . $contentText . '</p>'; |
||
| 53 | } |
||
| 54 | |||
| 55 | return $this; |
||
| 56 | } |
||
| 58 |