ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ProvideWithdrawal.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ilSession;
26use ilStartUpGUI;
27use Closure;
28
30{
32 private readonly Closure $close_session_context;
33
35 private readonly Closure $logout_url;
36
41 public function __construct(
42 private readonly string $id,
43 private readonly ilCtrlInterface $ctrl,
44 private readonly ilAuthSession $auth_session,
45 ?Closure $logout_url = null,
46 ?Closure $close_session_context = null
47 ) {
48 $this->logout_url = $logout_url ?? ilStartUpGUI::logoutUrl(...);
49 $this->close_session_context = $close_session_context ?? ilSession::setClosingContext(...);
50 }
51
52 public function beginProcessURL(): string
53 {
54 return ($this->logout_url)(['withdraw_consent' => $this->id]);
55 }
56
60 public function finishAndLogout(array $additional_url_parameters = []): void
61 {
63 $this->auth_session->logout();
64
65 $this->ctrl->redirectToURL('login.php?' . http_build_query(array_merge($additional_url_parameters, [
66 'withdrawal_finished' => $this->id,
67 'cmd' => 'force_login',
68 ])));
69 }
70}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(private readonly string $id, private readonly ilCtrlInterface $ctrl, private readonly ilAuthSession $auth_session, ?Closure $logout_url=null, ?Closure $close_session_context=null)
finishAndLogout(array $additional_url_parameters=[])
static setClosingContext(int $a_context)
set closing context (for statistics)
const int SESSION_CLOSE_USER
@ilCtrl_Calls ilStartUpGUI: ilAccountRegistrationGUI, ilPasswordAssistanceGUI, ilLoginPageGUI,...
static logoutUrl(array $parameters=[])
Return the logout URL with a valid CSRF token.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...