ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilForcedUserPasswordChangeStartUpStep.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use Psr\Http\Message\ServerRequestInterface;
24
26{
28 private ilCtrl $ctrl;
29 private ServerRequestInterface $request;
30
31 public function __construct(
34 ServerRequestInterface $request
35 ) {
36 $this->user = $user;
37 $this->ctrl = $ctrl;
38 $this->request = $request;
39 }
40
41 public function shouldStoreRequestTarget(): bool
42 {
43 return true;
44 }
45
46 public function isInFulfillment(): bool
47 {
48 if (
49 !isset($this->request->getQueryParams()['baseClass']) ||
50 strtolower($this->request->getQueryParams()['baseClass']) !== strtolower(ilDashboardGUI::class)
51 ) {
52 return false;
53 }
54
55 return
56 (
57 strtolower($this->ctrl->getCmdClass()) === strtolower(ilLocalUserPasswordSettingsGUI::class)
58 ) &&
59 in_array(
60 $this->ctrl->getCmd(),
61 [
64 ],
65 true
66 )
67 ;
68 }
69
70 public function shouldInterceptRequest(): bool
71 {
72 if (ilSession::get('used_external_auth_mode')) {
73 return false;
74 }
75
76 if (!$this->isInFulfillment() && ($this->user->isPasswordChangeDemanded() || $this->user->isPasswordExpired(
77 ))) {
78 return true;
79 }
80
81 return false;
82 }
83
84 public function execute(): void
85 {
86 $this->ctrl->redirectToURL(
87 $this->ctrl->getLinkTargetByClass(
88 [
89 ilDashboardGUI::class,
90 PersonalSettingsGUI::class,
91 ilLocalUserPasswordSettingsGUI::class
92 ],
94 )
95 );
96 }
97}
@ilCtrl_Calls ILIAS\User\Settings\PersonalSettingsGUI: ILIAS\User\Account\DeleteAccountGUI @ilCtrl_Ca...
Class ilCtrl provides processing control methods.
__construct(ilObjUser $user, ilCtrl $ctrl, ServerRequestInterface $request)
User class.
static get(string $a_var)