170 : string
171 {
173 if ($this->setting->get('auth_mode')) {
174 $defaultAuth = $this->setting->get('auth_mode');
175 }
176
177 $isLdapUser = (
179 ($this->
user->getAuthMode() ===
'default' && $defaultAuth ==
AUTH_LDAP)
180 );
181
182 $lng_suffix = '';
183 if (!$this->
user->getAgreeDate()) {
184 $lng_suffix = '_no_consent_yet';
185 }
186 $question = $this->lng->txt('withdrawal_sure_account' . $lng_suffix);
187 if (!$isLdapUser && (bool) $this->setting->get('tos_withdrawal_usr_deletion', false)) {
188 $question = $this->lng->txt('withdrawal_sure_account_deletion' . $lng_suffix);
189 }
190
191 $confirmation = $this->uiFactory->messageBox()->confirmation($question)->withButtons([
192 $this->uiFactory->button()->standard(
193 $this->lng->txt('confirm'),
194 $this->ctrl->getFormAction($parentObject, 'withdrawAcceptance')
195 ),
196 $this->uiFactory->button()->standard(
197 $this->lng->txt('cancel'),
198 $this->ctrl->getFormAction($parentObject, 'cancelWithdrawal')
199 ),
200 ]);
201
202 if ($isLdapUser) {
203 $message = nl2br(str_ireplace(
"[BR]",
"\n", sprintf(
204 $this->lng->txt('withdrawal_mail_info') . $this->lng->txt('withdrawal_mail_text'),
205 $this->user->getFullname(),
206 $this->user->getLogin(),
207 $this->user->getExternalAccount()
208 )));
209
210 $panelContent = $this->uiFactory->legacy(
211 $this->uiRenderer->render([
212 $confirmation,
213 $this->uiFactory->divider()->horizontal(),
215 ])
216 );
217
218 $content = $this->uiRenderer->render(
219 $this->uiFactory->panel()->standard($this->lng->txt('withdraw_usr_agreement'), $panelContent)
220 );
221 } else {
222 $content = $this->uiRenderer->render($confirmation);
223 }
224
225 return $content;
226 }