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