ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilTermsOfServiceWithdrawalStartUpStep.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
6
13{
15 private $dic;
16
21 public function __construct(Container $dic)
22 {
23 $this->dic = $dic;
24 }
25
29 public function shouldStoreRequestTarget() : bool
30 {
31 return true;
32 }
33
37 public function isInFulfillment() : bool
38 {
39 return (
40 strtolower($this->dic->ctrl()->getCmdClass()) === 'ilpersonalprofilegui' && (
41 strtolower($this->dic->ctrl()->getCmd()) === 'showuseragreement' ||
42 strtolower($this->dic->ctrl()->getCmd()) === 'confirmwithdrawal' ||
43 strtolower($this->dic->ctrl()->getCmd()) === 'showconsentwithdrawalconfirmation' ||
44 strtolower($this->dic->ctrl()->getCmd()) === 'cancelwithdrawal' ||
45 strtolower($this->dic->ctrl()->getCmd()) === 'withdrawacceptance' ||
46 strtolower($this->dic->ctrl()->getCmd()) === 'rejectwithdrawal'
47 )
48 );
49 }
50
54 public function shouldInterceptRequest() : bool
55 {
56 if ($this->isInFulfillment()) {
57 return false;
58 }
59
60 if ($this->dic->user()->getPref('consent_withdrawal_requested')) {
61 return true;
62 }
63
64 return false;
65 }
66
70 public function execute() : void
71 {
72 $this->dic->ctrl()->redirectByClass(
73 [ilDashboardGUI::class, ilPersonalProfileGUI::class],
74 'showConsentWithdrawalConfirmation'
75 );
76 }
77}
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:19
__construct(Container $dic)
ilTermsOfServiceAcceptanceStartUpStep constructor.