|
@@ 155-164 (lines=10) @@
|
| 152 |
|
public function resendToken($userId) { |
| 153 |
|
$user = $this->userManager->get($userId); |
| 154 |
|
|
| 155 |
|
if ($user === null) { |
| 156 |
|
$this->log->error('User: ' . $userId . ' does not exist', ['app' => 'core']); |
| 157 |
|
return new TemplateResponse( |
| 158 |
|
'core', 'error', |
| 159 |
|
[ |
| 160 |
|
"errors" => [["error" => $this->l10n->t('Failed to create activation link. Please contact your administrator.')]] |
| 161 |
|
], |
| 162 |
|
'guest' |
| 163 |
|
); |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
if ($user->getEMailAddress() === null) { |
| 167 |
|
$this->log->error('Email address not set for: ' . $userId, ['app' => 'core']); |
|
@@ 166-175 (lines=10) @@
|
| 163 |
|
); |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
if ($user->getEMailAddress() === null) { |
| 167 |
|
$this->log->error('Email address not set for: ' . $userId, ['app' => 'core']); |
| 168 |
|
return new TemplateResponse( |
| 169 |
|
'core', 'error', |
| 170 |
|
[ |
| 171 |
|
"errors" => [["error" => $this->l10n->t('Failed to create activation link. Please contact your administrator.', [$userId])]] |
| 172 |
|
], |
| 173 |
|
'guest' |
| 174 |
|
); |
| 175 |
|
} |
| 176 |
|
|
| 177 |
|
try { |
| 178 |
|
$this->userSendMail->generateTokenAndSendMail($user->getUID(), $user->getEMailAddress()); |