1 <?php declare(strict_types=1);
39 $this->
user = $subjectUser;
41 $this->lng = $DIC->language();
42 $this->ctrl = $DIC->ctrl();
43 $this->setting = $DIC->settings();
44 $this->tpl = $DIC->ui()->mainTemplate();
45 $this->uiFactory = $DIC->ui()->factory();
46 $this->uiRenderer = $DIC->ui()->renderer();
55 $template =
new ilTemplate(
'tpl.tos_withdrawal_section.html',
true,
true,
'Services/TermsOfService');
56 $template->setVariable(
'TXT_TOS_WITHDRAWAL_HEADLINE', $this->lng->txt(
'withdraw_consent_header'));
57 $template->setVariable(
'TXT_TOS_WITHDRAWAL', $this->lng->txt(
'withdraw_consent_description'));
58 $template->setVariable(
60 $this->uiRenderer->render(
61 $this->uiFactory->button()->standard($this->lng->txt(
'withdraw_consent'),
'logout.php?withdraw_consent')
76 $this->tosHelper->isGloballyEnabled() &&
77 $this->tosHelper->isIncludedUser($this->
user) &&
78 $this->
user->getAgreeDate()
80 $entity = $this->tosHelper->getCurrentAcceptanceForUser($this->
user);
81 if ($entity->getId()) {
83 $this->uiFactory->modal()->roundtrip(
86 $this->uiFactory->legacy($this->lng->txt(
'usr_agreement_footer_intro')),
87 $this->uiFactory->divider()->horizontal(),
88 $this->uiFactory->legacy(
96 $this->uiFactory->button()->shy($this->lng->txt(
'usr_agreement'),
'#')
109 RequestInterface $httpRequest,
112 if (!isset($httpRequest->getQueryParams()[
'withdraw_consent'])) {
116 if (!$this->tosHelper->isGloballyEnabled() || !$this->tosHelper->isIncludedUser($this->
user)) {
121 if ($this->setting->get(
'auth_mode')) {
122 $defaultAuth = $this->setting->get(
'auth_mode');
130 ($this->
user->getAuthMode() ===
'default' && $defaultAuth ==
AUTH_ECS)
135 $this->
user->writePref(
'consent_withdrawal_requested', 1);
138 $this->ctrl->setParameter($guiClass,
'withdrawal_relogin_content',
'external');
140 $this->ctrl->setParameter($guiClass,
'withdrawal_relogin_content',
'internal');
150 $withdrawalStatus = ($httpRequest->getQueryParams()[
'withdrawal_relogin_content'] ?? 0);
153 if ($withdrawalStatus !== 0) {
154 $text = $this->uiRenderer->render($this->uiFactory->divider()->horizontal());
155 if ($withdrawalStatus ===
'internal') {
156 $text .= $this->lng->txt(
'withdraw_consent_description_internal');
158 $text .= $this->lng->txt(
'withdraw_consent_description_external');
173 if ($this->setting->get(
'auth_mode')) {
174 $defaultAuth = $this->setting->get(
'auth_mode');
179 ($this->
user->getAuthMode() ===
'default' && $defaultAuth ==
AUTH_LDAP)
183 if (!$this->
user->getAgreeDate()) {
184 $lng_suffix =
'_no_consent_yet';
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);
191 $confirmation = $this->uiFactory->messageBox()->confirmation($question)->withButtons([
192 $this->uiFactory->button()->standard(
193 $this->lng->txt(
'confirm'),
194 $this->ctrl->getFormAction($parentObject,
'withdrawAcceptance')
196 $this->uiFactory->button()->standard(
197 $this->lng->txt(
'cancel'),
198 $this->ctrl->getFormAction($parentObject,
'cancelWithdrawal')
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()
210 $panelContent = $this->uiFactory->legacy(
211 $this->uiRenderer->render([
213 $this->uiFactory->divider()->horizontal(),
218 $content = $this->uiRenderer->render(
219 $this->uiFactory->panel()->standard($this->lng->txt(
'withdraw_usr_agreement'), $panelContent)
222 $content = $this->uiRenderer->render($confirmation);
233 if (isset($httpRequest->getQueryParams()[
'tos_withdrawal_type'])) {
234 $withdrawalType = (int) $httpRequest->getQueryParams()[
'tos_withdrawal_type'];
235 if (1 === $withdrawalType) {
237 } elseif (2 === $withdrawalType) {
getWithdrawalSectionForModal()
Class ilTermsOfServiceWithdrawalGUIHelper.
__construct(ilObjUser $subjectUser)
ilTermsOfServiceWithdrawalGUIHelper constructor.
withAdditionalModalAndTrigger(Modal\RoundTrip $roundTripModal, Button\Shy $shyButton)
getWithdrawalTextForLogoutScreen(RequestInterface $httpRequest)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
modifyFooter(Footer $footer)
handleWithdrawalLogoutRequest(RequestInterface $httpRequest, object $guiClass)
Class ilTermsOfServiceHelper.
setWithdrawalInfoForLoginScreen(RequestInterface $httpRequest)
getConsentWithdrawalConfirmation(object $parentObject)
This describes the Footer.