ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess:
+ Collaboration diagram for ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess:

Public Member Functions

 __construct (private readonly User $user, private readonly UI $ui, private readonly Routing $routing, private readonly Settings $settings, private readonly Closure $query_parameter, private readonly Provide $legal_documents, private readonly Closure $after_user_withdrawal)
 
 showValidatePasswordMessage ()
 
 isOnGoing ()
 
 withdrawalFinished ()
 
 showWithdraw (string $gui, string $cmd)
 

Private Member Functions

 withdrawalRequested ()
 
 withdraw ()
 
 cancelWithdrawal ()
 
 showWithdrawConfirmation (string $gui, string $cmd)
 
 confirmation (string $gui, string $add_to_question='')
 
 sendMail ()
 
 query (string $query_parameter)
 

Detailed Description

Definition at line 37 of file WithdrawProcess.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::__construct ( private readonly User  $user,
private readonly UI  $ui,
private readonly Routing  $routing,
private readonly Settings  $settings,
private readonly Closure  $query_parameter,
private readonly Provide  $legal_documents,
private readonly Closure  $after_user_withdrawal 
)
Parameters
Closure(string,Closure(Refinery)Transformation): mixed $query_parameter
Closure()void $after_user_withdrawal

Definition at line 43 of file WithdrawProcess.php.

51  {
52  }

Member Function Documentation

◆ cancelWithdrawal()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::cancelWithdrawal ( )
private

Definition at line 125 of file WithdrawProcess.php.

References ILIAS\Repository\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\showWithdraw().

125  : void
126  {
127  $this->user->withdrawalRequested()->update(false);
128  $this->routing->redirectToOriginalTarget();
129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmation()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::confirmation ( string  $gui,
string  $add_to_question = '' 
)
private

Definition at line 149 of file WithdrawProcess.php.

References ILIAS\Repository\ui(), and ILIAS\Repository\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\showWithdrawConfirmation().

149  : Component
150  {
151  $lng_suffix = $this->user->neverAgreed() ? '_no_consent_yet' : '';
152  $question = 'withdrawal_sure_account' . $add_to_question . $lng_suffix;
153 
154  return $this->ui->create()->messageBox()->confirmation($this->ui->txt($question))->withButtons([
155  $this->ui->create()->button()->standard(
156  $this->ui->txt('confirm'),
157  $this->routing->ctrl()->getLinkTargetByClass($gui, 'indeed')
158  ),
159  $this->ui->create()->button()->standard(
160  $this->ui->txt('cancel'),
161  $this->routing->ctrl()->getLinkTargetByClass($gui, 'cancel')
162  ),
163  ]);
164  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isOnGoing()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::isOnGoing ( )

Implements ILIAS\LegalDocuments\ConsumerSlots\WithdrawProcess.

Definition at line 68 of file WithdrawProcess.php.

References ILIAS\Repository\user().

68  : bool
69  {
70  return $this->user->withdrawalRequested()->value();
71  }
+ Here is the call graph for this function:

◆ query()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::query ( string  $query_parameter)
private

Definition at line 173 of file WithdrawProcess.php.

References $r.

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\withdrawalFinished().

173  : ?string
174  {
175  return ($this->query_parameter)($query_parameter, fn(Refinery $r) => $r->byTrying([
176  $r->null(),
177  $r->to()->string(),
178  ]));
179  }
$r
+ Here is the caller graph for this function:

◆ sendMail()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::sendMail ( )
private

Definition at line 166 of file WithdrawProcess.php.

References ILIAS\Repository\settings(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\withdraw().

166  : void
167  {
168  $mail = new Mail();
169  $mail->setRecipients([$this->settings->adminEmail()->value()]);
170  $mail->sendGeneric($this->ui->txt('withdrawal_mail_subject'), $this->user->format($this->ui->txt('withdrawal_mail_text')));
171  }
RFC 822 Email address list validation Utility.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showValidatePasswordMessage()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::showValidatePasswordMessage ( )
Returns
list<Component>

Implements ILIAS\LegalDocuments\ConsumerSlots\WithdrawProcess.

Definition at line 54 of file WithdrawProcess.php.

References $lng, null, ILIAS\Repository\ui(), and ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\withdrawalRequested().

54  : array
55  {
56  $status = $this->withdrawalRequested();
57  if ($status === null) {
58  return [];
59  }
60  $lng = 'withdraw_consent_description_' . ($status === 'external' ? 'external' : 'internal');
61 
62  return [
63  $this->ui->create()->divider()->horizontal(),
64  $this->ui->create()->legacy()->content($this->ui->txt($lng))
65  ];
66  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

◆ showWithdraw()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::showWithdraw ( string  $gui,
string  $cmd 
)

◆ showWithdrawConfirmation()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::showWithdrawConfirmation ( string  $gui,
string  $cmd 
)
private

Definition at line 131 of file WithdrawProcess.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\confirmation(), ILIAS\Repository\settings(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\showWithdraw().

131  : PageFragment
132  {
133  $title = $this->ui->txt('refuse_acceptance');
134 
135  if ($this->user->isLDAPUser()) {
136  return new PageContent($title, [
137  $this->ui->create()->panel()->standard($this->ui->txt('withdraw_usr_agreement'), [
138  $this->confirmation($gui),
139  $this->ui->create()->divider()->horizontal(),
140  $this->ui->create()->legacy()->content(nl2br($this->user->format($this->ui->txt('withdrawal_mail_info') . $this->ui->txt('withdrawal_mail_text'))))
141  ])
142  ]);
143  }
144 
145  $deletion = $this->settings->deleteUserOnWithdrawal()->value() ? '_deletion' : '';
146  return new PageContent($title, [$this->confirmation($gui, $deletion)]);
147  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withdraw()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::withdraw ( )
private

Definition at line 106 of file WithdrawProcess.php.

References null, ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\sendMail(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\showWithdraw().

106  : void
107  {
108  $this->user->agreeDate()->update(null);
109  $this->user->withdrawalRequested()->update(false);
110 
111  $withdrawal_type = 'default';
112  if ($this->user->isLDAPUser()) {
113  $this->sendMail();
114  $withdrawal_type = 'external';
115  } elseif ($this->settings->deleteUserOnWithdrawal()->value()) {
116  $this->user->raw()->delete();
117  $withdrawal_type = 'delete_user';
118  }
119 
120  ($this->after_user_withdrawal)();
121 
122  $this->legal_documents->withdrawal()->finishAndLogout(['tos_withdrawal_type' => $withdrawal_type]);
123  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withdrawalFinished()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::withdrawalFinished ( )

Implements ILIAS\LegalDocuments\ConsumerSlots\WithdrawProcess.

Definition at line 86 of file WithdrawProcess.php.

References null, ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\query(), and ILIAS\Repository\ui().

86  : void
87  {
88  $type = $this->query('tos_withdrawal_type');
89 
90  $this->ui->mainTemplate()->setOnScreenMessage('info', match ($type) {
91  'delete_user' => $this->ui->txt('withdrawal_complete_deleted'),
92  'external' => $this->ui->txt('withdrawal_complete_redirect'),
93  null, 'default' => $this->ui->txt('withdrawal_complete'),
94  });
95  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ withdrawalRequested()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess::withdrawalRequested ( )
private

Definition at line 73 of file WithdrawProcess.php.

References null, and ILIAS\Repository\user().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\WithdrawProcess\showValidatePasswordMessage().

73  : ?string
74  {
75  if ($this->user->cannotAgree() || $this->user->neverAgreed()) {
76  return null;
77  }
78 
79  $this->user->withdrawalRequested()->update(true);
80 
81  $external = $this->user->isExternalAccount();
82 
83  return $external ? 'external' : 'internal';
84  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: