| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function checkEmail($request = null, $params = []) |
||
| 44 | { |
||
| 45 | /** @var Member|null $user */ |
||
| 46 | $user = Security::getCurrentUser(); |
||
| 47 | |||
| 48 | if ($user !== null) { |
||
| 49 | /** @var HaveIBeenPwnedService $service */ |
||
| 50 | $service = Injector::inst()->createWithArgs(HaveIBeenPwnedService::class, [$params]); |
||
| 51 | |||
| 52 | $breachedEmails = $service->checkPwnedEmail($user); |
||
| 53 | |||
| 54 | $contentText = str_replace("\r\n", '<br />', $breachedEmails); |
||
| 55 | |||
| 56 | |||
| 57 | $this->data()->Content = trim( |
||
| 58 | $this->data()->Content . '<p><h3>We found the following breaches for your account:</h3>' . |
||
| 59 | $contentText . |
||
| 60 | '</p>' |
||
| 61 | ); |
||
| 62 | } |
||
| 63 | |||
| 64 | return $this; |
||
| 65 | } |
||
| 67 |